@backtest-kit/ui 7.4.0 → 7.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/modules/frontend/build/assets/{Article-C5-2kK-h.js → Article-Z1gwQi4C.js} +1 -1
- package/build/modules/frontend/build/assets/{Background-Cw2iN6KJ.js → Background-DS1gKl45.js} +1 -1
- package/build/modules/frontend/build/assets/{IconPhoto-B9wAeXe1.js → IconPhoto-BitDk5sL.js} +1 -1
- package/build/modules/frontend/build/assets/{KeyboardArrowLeft-C1qRm69Y.js → KeyboardArrowLeft-BT0IHVDD.js} +1 -1
- package/build/modules/frontend/build/assets/{Refresh-TNgz_b0v.js → Refresh-BgupECvn.js} +1 -1
- package/build/modules/frontend/build/assets/emitters-BJfdDGbd.js +1 -0
- package/build/modules/frontend/build/assets/{hasRouteMatch-CYLF108Z.js → hasRouteMatch-CcXyiBjV.js} +1 -1
- package/build/modules/frontend/build/assets/{html2canvas-BiE4mNf-.js → html2canvas-CxpxaxUC.js} +1 -1
- package/build/modules/frontend/build/assets/{index-D_xsPZ0X.js → index-1kyziIc7.js} +1 -1
- package/build/modules/frontend/build/assets/{index-AF9AvKwr.js → index-3ZYgMfYi.js} +1 -1
- package/build/modules/frontend/build/assets/{index-HmxUvvMu.js → index-9YHmY3Zv.js} +1 -1
- package/build/modules/frontend/build/assets/{index-UiRxh0X0.js → index-BR0aHfoe.js} +1 -1
- package/build/modules/frontend/build/assets/{index-C_jQT6Zw.js → index-Bg2qm7TJ.js} +1 -1
- package/build/modules/frontend/build/assets/{index-Cle4ryUi.js → index-C4dzv30q.js} +1 -1
- package/build/modules/frontend/build/assets/{index-C4_OGd1K.js → index-C8Wdopwt.js} +1 -1
- package/build/modules/frontend/build/assets/{index-mHMR_sVK.js → index-CWErSuod.js} +1 -1
- package/build/modules/frontend/build/assets/{index-BCP4aeGv.js → index-CnRuFJIf.js} +1 -1
- package/build/modules/frontend/build/assets/{index-DycIUKAc.js → index-DzrwP4k5.js} +5 -5
- package/build/modules/frontend/build/assets/{index-DDXw0lYL.js → index-J3hGIAw0.js} +1 -1
- package/build/modules/frontend/build/assets/{index-Coo1fwWW.js → index-nfZ8sdZp.js} +1 -1
- package/build/modules/frontend/build/assets/{index.es-qA9pRd9t.js → index.es-Du6U2Hyj.js} +1 -1
- package/build/modules/frontend/build/assets/{markdownit-B5MND-Q3.js → markdownit-SQF1Xc8y.js} +1 -1
- package/build/modules/frontend/build/index.html +1 -1
- package/package.json +3 -3
- package/build/modules/frontend/build/assets/emitters-Uy5NDw0B.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C4dzv30q.js","assets/emitters-BJfdDGbd.js","assets/Refresh-BgupECvn.js","assets/index-J3hGIAw0.js","assets/KeyboardArrowLeft-BT0IHVDD.js","assets/IconPhoto-BitDk5sL.js","assets/Background-DS1gKl45.js","assets/index-1kyziIc7.js","assets/index-CWErSuod.js","assets/index-9YHmY3Zv.js","assets/Article-Z1gwQi4C.js","assets/index-Bg2qm7TJ.js","assets/hasRouteMatch-CcXyiBjV.js","assets/index-nfZ8sdZp.js","assets/index-C8Wdopwt.js","assets/index-3ZYgMfYi.js","assets/index-BR0aHfoe.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function _mergeNamespaces(e,t){for(var n=0;n<t.length;n++){const r=t[n];if("string"!=typeof r&&!Array.isArray(r))for(const t in r)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(r,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver(e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)}).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs$1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var react={exports:{}},react_production_min={},l$5=Symbol.for("react.element"),n$4=Symbol.for("react.portal"),p$5=Symbol.for("react.fragment"),q$4=Symbol.for("react.strict_mode"),r$5=Symbol.for("react.profiler"),t$4=Symbol.for("react.provider"),u$3=Symbol.for("react.context"),v$5=Symbol.for("react.forward_ref"),w$4=Symbol.for("react.suspense"),x$6=Symbol.for("react.memo"),y$4=Symbol.for("react.lazy"),z$4=Symbol.iterator;function A$4(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=z$4&&e[z$4]||e["@@iterator"])?e:null}var B$4={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$6=Object.assign,D$3={};function E$3(e,t,n){this.props=e,this.context=t,this.refs=D$3,this.updater=n||B$4}function F$2(){}function G$3(e,t,n){this.props=e,this.context=t,this.refs=D$3,this.updater=n||B$4}E$3.prototype.isReactComponent={},E$3.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)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")},E$3.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},F$2.prototype=E$3.prototype;var H$3=G$3.prototype=new F$2;H$3.constructor=G$3,C$6(H$3,E$3.prototype),H$3.isPureReactComponent=!0;var I$4=Array.isArray,J$3=Object.prototype.hasOwnProperty,K$3={current:null},L$3={key:!0,ref:!0,__self:!0,__source:!0};function M$4(e,t,n){var r,o={},i=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(i=""+t.key),t)J$3.call(t,r)&&!L$3.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){for(var l=Array(s),c=0;c<s;c++)l[c]=arguments[c+2];o.children=l}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===o[r]&&(o[r]=s[r]);return{$$typeof:l$5,type:e,key:i,ref:a,props:o,_owner:K$3.current}}function N$3(e,t){return{$$typeof:l$5,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function O$4(e){return"object"==typeof e&&null!==e&&e.$$typeof===l$5}function escape$3(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}var P$4=/\/+/g;function Q$3(e,t){return"object"==typeof e&&null!==e&&null!=e.key?escape$3(""+e.key):t.toString(36)}function R$3(e,t,n,r,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var a=!1;if(null===e)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case l$5:case n$4:a=!0}}if(a)return o=o(a=e),e=""===r?"."+Q$3(a,0):r,I$4(o)?(n="",null!=e&&(n=e.replace(P$4,"$&/")+"/"),R$3(o,t,n,"",function(e){return e})):null!=o&&(O$4(o)&&(o=N$3(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(P$4,"$&/")+"/")+e)),t.push(o)),1;if(a=0,r=""===r?".":r+":",I$4(e))for(var s=0;s<e.length;s++){var l=r+Q$3(i=e[s],s);a+=R$3(i,t,n,l,o)}else if("function"==typeof(l=A$4(e)))for(e=l.call(e),s=0;!(i=e.next()).done;)a+=R$3(i=i.value,t,n,l=r+Q$3(i,s++),o);else if("object"===i)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function S$3(e,t,n){if(null==e)return e;var r=[],o=0;return R$3(e,r,"","",function(e){return t.call(n,e,o++)}),r}function T$3(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var U$3={current:null},V$3={transition:null},W$3={ReactCurrentDispatcher:U$3,ReactCurrentBatchConfig:V$3,ReactCurrentOwner:K$3};function X$3(){throw Error("act(...) is not supported in production builds of React.")}react_production_min.Children={map:S$3,forEach:function(e,t,n){S$3(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return S$3(e,function(){t++}),t},toArray:function(e){return S$3(e,function(e){return e})||[]},only:function(e){if(!O$4(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},react_production_min.Component=E$3,react_production_min.Fragment=p$5,react_production_min.Profiler=r$5,react_production_min.PureComponent=G$3,react_production_min.StrictMode=q$4,react_production_min.Suspense=w$4,react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W$3,react_production_min.act=X$3,react_production_min.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=C$6({},e.props),o=e.key,i=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,a=K$3.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)J$3.call(t,l)&&!L$3.hasOwnProperty(l)&&(r[l]=void 0===t[l]&&void 0!==s?s[l]:t[l])}var l=arguments.length-2;if(1===l)r.children=n;else if(1<l){s=Array(l);for(var c=0;c<l;c++)s[c]=arguments[c+2];r.children=s}return{$$typeof:l$5,type:e.type,key:o,ref:i,props:r,_owner:a}},react_production_min.createContext=function(e){return(e={$$typeof:u$3,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:t$4,_context:e},e.Consumer=e},react_production_min.createElement=M$4,react_production_min.createFactory=function(e){var t=M$4.bind(null,e);return t.type=e,t},react_production_min.createRef=function(){return{current:null}},react_production_min.forwardRef=function(e){return{$$typeof:v$5,render:e}},react_production_min.isValidElement=O$4,react_production_min.lazy=function(e){return{$$typeof:y$4,_payload:{_status:-1,_result:e},_init:T$3}},react_production_min.memo=function(e,t){return{$$typeof:x$6,type:e,compare:void 0===t?null:t}},react_production_min.startTransition=function(e){var t=V$3.transition;V$3.transition={};try{e()}finally{V$3.transition=t}},react_production_min.unstable_act=X$3,react_production_min.useCallback=function(e,t){return U$3.current.useCallback(e,t)},react_production_min.useContext=function(e){return U$3.current.useContext(e)},react_production_min.useDebugValue=function(){},react_production_min.useDeferredValue=function(e){return U$3.current.useDeferredValue(e)},react_production_min.useEffect=function(e,t){return U$3.current.useEffect(e,t)},react_production_min.useId=function(){return U$3.current.useId()},react_production_min.useImperativeHandle=function(e,t,n){return U$3.current.useImperativeHandle(e,t,n)},react_production_min.useInsertionEffect=function(e,t){return U$3.current.useInsertionEffect(e,t)},react_production_min.useLayoutEffect=function(e,t){return U$3.current.useLayoutEffect(e,t)},react_production_min.useMemo=function(e,t){return U$3.current.useMemo(e,t)},react_production_min.useReducer=function(e,t,n){return U$3.current.useReducer(e,t,n)},react_production_min.useRef=function(e){return U$3.current.useRef(e)},react_production_min.useState=function(e){return U$3.current.useState(e)},react_production_min.useSyncExternalStore=function(e,t,n){return U$3.current.useSyncExternalStore(e,t,n)},react_production_min.useTransition=function(){return U$3.current.useTransition()},react_production_min.version="18.3.1",react.exports=react_production_min;var reactExports=react.exports;const React=getDefaultExportFromCjs$1(reactExports),React$1=_mergeNamespaces({__proto__:null,default:React},[reactExports]),factory$1=(e,t)=>window.Translate?window.Translate.jss(e,t):React.createElement(e,t),{Fragment:Fragment}=React,jsxRuntime=Object.freeze(Object.defineProperty({__proto__:null,Fragment:Fragment,jsx:factory$1,jsxs:factory$1},Symbol.toStringTag,{value:"Module"}));var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function __extends$1(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign$2=function(){return __assign$2=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},__assign$2.apply(this,arguments)};function __rest(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function __awaiter(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e2){i(e2)}}function s(e){try{l(r.throw(e))}catch(e2){i(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function __generator(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e2){s=[6,e2],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function __values(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function __spreadArray(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function __await(e){return this instanceof __await?(this.v=e,this):new __await(e)}function __asyncGenerator(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){o[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||s(e,t)})},t&&(r[e]=t(r[e])))}function s(e,t){try{(n=o[e](t)).value instanceof __await?Promise.resolve(n.value.v).then(l,c):u(i[0][2],n)}catch(e2){u(i[0][3],e2)}var n}function l(e){s("next",e)}function c(e){s("throw",e)}function u(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function __makeTemplateObject(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_extends.apply(null,arguments)}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function memoize$1(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}"function"==typeof SuppressedError&&SuppressedError;var reactPropsRegex=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,isPropValid=memoize$1(function(e){return reactPropsRegex.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91});const global$1=globalThis||self;function sheetForTag(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function createStyleElement(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var StyleSheet=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(createStyleElement(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=sheetForTag(t);try{n.insertRule(e,n.cssRules.length)}catch(e2){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),MS="-ms-",MOZ="-moz-",WEBKIT="-webkit-",COMMENT$1="comm",RULESET="rule",DECLARATION="decl",IMPORT="@import",KEYFRAMES="@keyframes",LAYER="@layer",abs$2=Math.abs,from$1=String.fromCharCode,assign$4=Object.assign;function hash$2(e,t){return 45^charat(e,0)?(((t<<2^charat(e,0))<<2^charat(e,1))<<2^charat(e,2))<<2^charat(e,3):0}function trim(e){return e.trim()}function match$1(e,t){return(e=t.exec(e))?e[0]:e}function replace$2(e,t,n){return e.replace(t,n)}function indexof(e,t){return e.indexOf(t)}function charat(e,t){return 0|e.charCodeAt(t)}function substr(e,t,n){return e.slice(t,n)}function strlen(e){return e.length}function sizeof(e){return e.length}function append$1(e,t){return t.push(e),e}function combine$1(e,t){return e.map(t).join("")}var line=1,column=1,length=0,position=0,character=0,characters="";function node$2(e,t,n,r,o,i,a){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:line,column:column,length:a,return:""}}function copy(e,t){return assign$4(node$2("",null,null,"",null,null,0),e,{length:-e.length},t)}function char(){return character}function prev(){return character=position>0?charat(characters,--position):0,column--,10===character&&(column=1,line--),character}function next(){return character=position<length?charat(characters,position++):0,column++,10===character&&(column=1,line++),character}function peek(){return charat(characters,position)}function caret(){return position}function slice(e,t){return substr(characters,e,t)}function token(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function alloc(e){return line=column=1,length=strlen(characters=e),position=0,[]}function dealloc(e){return characters="",e}function delimit(e){return trim(slice(position-1,delimiter$1(91===e?e+2:40===e?e+1:e)))}function whitespace(e){for(;(character=peek())&&character<33;)next();return token(e)>2||token(character)>3?"":" "}function escaping(e,t){for(;--t&&next()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice(e,caret()+(t<6&&32==peek()&&32==next()))}function delimiter$1(e){for(;next();)switch(character){case e:return position;case 34:case 39:34!==e&&39!==e&&delimiter$1(character);break;case 40:41===e&&delimiter$1(e);break;case 92:next()}return position}function commenter(e,t){for(;next()&&e+character!==57&&(e+character!==84||47!==peek()););return"/*"+slice(t,position-1)+"*"+from$1(47===e?e:next())}function identifier(e){for(;!token(peek());)next();return slice(e,position)}function compile$1(e){return dealloc(parse$c("",null,null,null,[""],e=alloc(e),0,[0],e))}function parse$c(e,t,n,r,o,i,a,s,l){for(var c=0,u=0,d=a,p=0,h=0,f=0,A=1,m=1,g=1,y=0,v="",b=o,x=i,w=r,C=v;m;)switch(f=y,y=next()){case 40:if(108!=f&&58==charat(C,d-1)){-1!=indexof(C+=replace$2(delimit(y),"&","&\f"),"&\f")&&(g=-1);break}case 34:case 39:case 91:C+=delimit(y);break;case 9:case 10:case 13:case 32:C+=whitespace(f);break;case 92:C+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:append$1(comment$2(commenter(next(),caret()),t,n),l);break;default:C+="/"}break;case 123*A:s[c++]=strlen(C)*g;case 125*A:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:-1==g&&(C=replace$2(C,/\f/g,"")),h>0&&strlen(C)-d&&append$1(h>32?declaration$2(C+";",r,n,d-1):declaration$2(replace$2(C," ","")+";",r,n,d-2),l);break;case 59:C+=";";default:if(append$1(w=ruleset(C,t,n,c,u,o,s,v,b=[],x=[],d),i),123===y)if(0===u)parse$c(C,t,w,w,b,i,d,s,x);else switch(99===p&&110===charat(C,3)?100:p){case 100:case 108:case 109:case 115:parse$c(e,w,w,r&&append$1(ruleset(e,w,w,0,0,o,s,v,o,b=[],d),x),o,x,d,s,r?b:x);break;default:parse$c(C,w,w,w,[""],x,0,s,x)}}c=u=h=0,A=g=1,v=C="",d=a;break;case 58:d=1+strlen(C),h=f;default:if(A<1)if(123==y)--A;else if(125==y&&0==A++&&125==prev())continue;switch(C+=from$1(y),y*A){case 38:g=u>0?1:(C+="\f",-1);break;case 44:s[c++]=(strlen(C)-1)*g,g=1;break;case 64:45===peek()&&(C+=delimit(next())),p=peek(),u=d=strlen(v=C+=identifier(caret())),y++;break;case 45:45===f&&2==strlen(C)&&(A=0)}}return i}function ruleset(e,t,n,r,o,i,a,s,l,c,u){for(var d=o-1,p=0===o?i:[""],h=sizeof(p),f=0,A=0,m=0;f<r;++f)for(var g=0,y=substr(e,d+1,d=abs$2(A=a[f])),v=e;g<h;++g)(v=trim(A>0?p[g]+" "+y:replace$2(y,/&\f/g,p[g])))&&(l[m++]=v);return node$2(e,t,n,0===o?RULESET:s,l,c,u)}function comment$2(e,t,n){return node$2(e,t,n,COMMENT$1,from$1(char()),substr(e,2,-2),0)}function declaration$2(e,t,n,r){return node$2(e,t,n,DECLARATION,substr(e,0,r),substr(e,r+1,-1),r)}function prefix$1(e,t,n){switch(hash$2(e,t)){case 5103:return WEBKIT+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return WEBKIT+e+e;case 4789:return MOZ+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return WEBKIT+e+MOZ+e+MS+e+e;case 5936:switch(charat(e,t+11)){case 114:return WEBKIT+e+MS+replace$2(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return WEBKIT+e+MS+replace$2(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return WEBKIT+e+MS+replace$2(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return WEBKIT+e+MS+e+e;case 6165:return WEBKIT+e+MS+"flex-"+e+e;case 5187:return WEBKIT+e+replace$2(e,/(\w+).+(:[^]+)/,WEBKIT+"box-$1$2"+MS+"flex-$1$2")+e;case 5443:return WEBKIT+e+MS+"flex-item-"+replace$2(e,/flex-|-self/g,"")+(match$1(e,/flex-|baseline/)?"":MS+"grid-row-"+replace$2(e,/flex-|-self/g,""))+e;case 4675:return WEBKIT+e+MS+"flex-line-pack"+replace$2(e,/align-content|flex-|-self/g,"")+e;case 5548:return WEBKIT+e+MS+replace$2(e,"shrink","negative")+e;case 5292:return WEBKIT+e+MS+replace$2(e,"basis","preferred-size")+e;case 6060:return WEBKIT+"box-"+replace$2(e,"-grow","")+WEBKIT+e+MS+replace$2(e,"grow","positive")+e;case 4554:return WEBKIT+replace$2(e,/([^-])(transform)/g,"$1"+WEBKIT+"$2")+e;case 6187:return replace$2(replace$2(replace$2(e,/(zoom-|grab)/,WEBKIT+"$1"),/(image-set)/,WEBKIT+"$1"),e,"")+e;case 5495:case 3959:return replace$2(e,/(image-set\([^]*)/,WEBKIT+"$1$`$1");case 4968:return replace$2(replace$2(e,/(.+:)(flex-)?(.*)/,WEBKIT+"box-pack:$3"+MS+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+WEBKIT+e+e;case 4200:if(!match$1(e,/flex-|baseline/))return MS+"grid-column-align"+substr(e,t)+e;break;case 2592:case 3360:return MS+replace$2(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(e,n){return t=n,match$1(e.props,/grid-\w+-end/)})?~indexof(e+(n=n[t].value),"span")?e:MS+replace$2(e,"-start","")+e+MS+"grid-row-span:"+(~indexof(n,"span")?match$1(n,/\d+/):+match$1(n,/\d+/)-+match$1(e,/\d+/))+";":MS+replace$2(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(e){return match$1(e.props,/grid-\w+-start/)})?e:MS+replace$2(replace$2(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return replace$2(e,/(.+)-inline(.+)/,WEBKIT+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(strlen(e)-1-t>6)switch(charat(e,t+1)){case 109:if(45!==charat(e,t+4))break;case 102:return replace$2(e,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(108==charat(e,t+3)?"$3":"$2-$3"))+e;case 115:return~indexof(e,"stretch")?prefix$1(replace$2(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return replace$2(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(t,n,r,o,i,a,s){return MS+n+":"+r+s+(o?MS+n+"-span:"+(i?a:+a-+r)+s:"")+e});case 4949:if(121===charat(e,t+6))return replace$2(e,":",":"+WEBKIT)+e;break;case 6444:switch(charat(e,45===charat(e,14)?18:11)){case 120:return replace$2(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+WEBKIT+(45===charat(e,14)?"inline-":"")+"box$3$1"+WEBKIT+"$2$3$1"+MS+"$2box$3")+e;case 100:return replace$2(e,":",":"+MS)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return replace$2(e,"scroll-","scroll-snap-")+e}return e}function serialize(e,t){for(var n="",r=sizeof(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function stringify$8(e,t,n,r){switch(e.type){case LAYER:if(e.children.length)break;case IMPORT:case DECLARATION:return e.return=e.return||e.value;case COMMENT$1:return"";case KEYFRAMES:return e.return=e.value+"{"+serialize(e.children,r)+"}";case RULESET:e.value=e.props.join(",")}return strlen(n=serialize(e.children,r))?e.return=e.value+"{"+n+"}":""}function middleware(e){var t=sizeof(e);return function(n,r,o,i){for(var a="",s=0;s<t;s++)a+=e[s](n,r,o,i)||"";return a}}function rulesheet(e){return function(t){t.root||(t=t.return)&&e(t)}}function prefixer$1(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case DECLARATION:return void(e.return=prefix$1(e.value,e.length,n));case KEYFRAMES:return serialize([copy(e,{value:replace$2(e.value,"@","@"+WEBKIT)})],r);case RULESET:if(e.length)return combine$1(e.props,function(t){switch(match$1(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize([copy(e,{props:[replace$2(t,/:(read-\w+)/,":"+MOZ+"$1")]})],r);case"::placeholder":return serialize([copy(e,{props:[replace$2(t,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy(e,{props:[replace$2(t,/:(plac\w+)/,":"+MOZ+"$1")]}),copy(e,{props:[replace$2(t,/:(plac\w+)/,MS+"input-$1")]})],r)}return""})}}var identifierWithPointTracking=function(e,t,n){for(var r=0,o=0;r=o,o=peek(),38===r&&12===o&&(t[n]=1),!token(o);)next();return slice(e,position)},toRules=function(e,t){var n=-1,r=44;do{switch(token(r)){case 0:38===r&&12===peek()&&(t[n]=1),e[n]+=identifierWithPointTracking(position-1,t,n);break;case 2:e[n]+=delimit(r);break;case 4:if(44===r){e[++n]=58===peek()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=from$1(r)}}while(r=next());return e},getRules=function(e,t){return dealloc(toRules(alloc(e),t))},fixedElements=new WeakMap,compat=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||fixedElements.get(n))&&!r){fixedElements.set(e,!0);for(var o=[],i=getRules(t,o),a=n.props,s=0,l=0;s<i.length;s++)for(var c=0;c<a.length;c++,l++)e.props[l]=o[s]?i[s].replace(/&\f/g,a[c]):a[c]+" "+i[s]}}},removeLabel=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function prefix(e,t){switch(hash$2(e,t)){case 5103:return WEBKIT+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return WEBKIT+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return WEBKIT+e+MOZ+e+MS+e+e;case 6828:case 4268:return WEBKIT+e+MS+e+e;case 6165:return WEBKIT+e+MS+"flex-"+e+e;case 5187:return WEBKIT+e+replace$2(e,/(\w+).+(:[^]+)/,WEBKIT+"box-$1$2"+MS+"flex-$1$2")+e;case 5443:return WEBKIT+e+MS+"flex-item-"+replace$2(e,/flex-|-self/,"")+e;case 4675:return WEBKIT+e+MS+"flex-line-pack"+replace$2(e,/align-content|flex-|-self/,"")+e;case 5548:return WEBKIT+e+MS+replace$2(e,"shrink","negative")+e;case 5292:return WEBKIT+e+MS+replace$2(e,"basis","preferred-size")+e;case 6060:return WEBKIT+"box-"+replace$2(e,"-grow","")+WEBKIT+e+MS+replace$2(e,"grow","positive")+e;case 4554:return WEBKIT+replace$2(e,/([^-])(transform)/g,"$1"+WEBKIT+"$2")+e;case 6187:return replace$2(replace$2(replace$2(e,/(zoom-|grab)/,WEBKIT+"$1"),/(image-set)/,WEBKIT+"$1"),e,"")+e;case 5495:case 3959:return replace$2(e,/(image-set\([^]*)/,WEBKIT+"$1$`$1");case 4968:return replace$2(replace$2(e,/(.+:)(flex-)?(.*)/,WEBKIT+"box-pack:$3"+MS+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+WEBKIT+e+e;case 4095:case 3583:case 4068:case 2532:return replace$2(e,/(.+)-inline(.+)/,WEBKIT+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(strlen(e)-1-t>6)switch(charat(e,t+1)){case 109:if(45!==charat(e,t+4))break;case 102:return replace$2(e,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(108==charat(e,t+3)?"$3":"$2-$3"))+e;case 115:return~indexof(e,"stretch")?prefix(replace$2(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==charat(e,t+1))break;case 6444:switch(charat(e,strlen(e)-3-(~indexof(e,"!important")&&10))){case 107:return replace$2(e,":",":"+WEBKIT)+e;case 101:return replace$2(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+WEBKIT+(45===charat(e,14)?"inline-":"")+"box$3$1"+WEBKIT+"$2$3$1"+MS+"$2box$3")+e}break;case 5936:switch(charat(e,t+11)){case 114:return WEBKIT+e+MS+replace$2(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return WEBKIT+e+MS+replace$2(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return WEBKIT+e+MS+replace$2(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return WEBKIT+e+MS+e+e}return e}var prefixer=function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case DECLARATION:e.return=prefix(e.value,e.length);break;case KEYFRAMES:return serialize([copy(e,{value:replace$2(e.value,"@","@"+WEBKIT)})],r);case RULESET:if(e.length)return combine$1(e.props,function(t){switch(match$1(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize([copy(e,{props:[replace$2(t,/:(read-\w+)/,":"+MOZ+"$1")]})],r);case"::placeholder":return serialize([copy(e,{props:[replace$2(t,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy(e,{props:[replace$2(t,/:(plac\w+)/,":"+MOZ+"$1")]}),copy(e,{props:[replace$2(t,/:(plac\w+)/,MS+"input-$1")]})],r)}return""})}},defaultStylisPlugins=[prefixer],createCache=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,o,i=e.stylisPlugins||defaultStylisPlugins,a={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)a[t[n]]=!0;s.push(e)});var l,c=[compat,removeLabel],u=[stringify$8,rulesheet(function(e){l.insert(e)})],d=middleware(c.concat(i,u));o=function(e,t,n,r){l=n,serialize(compile$1(e?e+"{"+t.styles+"}":t.styles),d),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new StyleSheet({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:o};return p.sheet.hydrate(s),p},reactIs$1={exports:{}},reactIs_production_min$1={},b$5="function"==typeof Symbol&&Symbol.for,c$4=b$5?Symbol.for("react.element"):60103,d$4=b$5?Symbol.for("react.portal"):60106,e$3=b$5?Symbol.for("react.fragment"):60107,f$4=b$5?Symbol.for("react.strict_mode"):60108,g$4=b$5?Symbol.for("react.profiler"):60114,h$3=b$5?Symbol.for("react.provider"):60109,k$5=b$5?Symbol.for("react.context"):60110,l$4=b$5?Symbol.for("react.async_mode"):60111,m$4=b$5?Symbol.for("react.concurrent_mode"):60111,n$3=b$5?Symbol.for("react.forward_ref"):60112,p$4=b$5?Symbol.for("react.suspense"):60113,q$3=b$5?Symbol.for("react.suspense_list"):60120,r$4=b$5?Symbol.for("react.memo"):60115,t$3=b$5?Symbol.for("react.lazy"):60116,v$4=b$5?Symbol.for("react.block"):60121,w$3=b$5?Symbol.for("react.fundamental"):60117,x$5=b$5?Symbol.for("react.responder"):60118,y$3=b$5?Symbol.for("react.scope"):60119;function z$3(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case c$4:switch(e=e.type){case l$4:case m$4:case e$3:case g$4:case f$4:case p$4:return e;default:switch(e=e&&e.$$typeof){case k$5:case n$3:case t$3:case r$4:case h$3:return e;default:return t}}case d$4:return t}}}function A$3(e){return z$3(e)===m$4}reactIs_production_min$1.AsyncMode=l$4,reactIs_production_min$1.ConcurrentMode=m$4,reactIs_production_min$1.ContextConsumer=k$5,reactIs_production_min$1.ContextProvider=h$3,reactIs_production_min$1.Element=c$4,reactIs_production_min$1.ForwardRef=n$3,reactIs_production_min$1.Fragment=e$3,reactIs_production_min$1.Lazy=t$3,reactIs_production_min$1.Memo=r$4,reactIs_production_min$1.Portal=d$4,reactIs_production_min$1.Profiler=g$4,reactIs_production_min$1.StrictMode=f$4,reactIs_production_min$1.Suspense=p$4,reactIs_production_min$1.isAsyncMode=function(e){return A$3(e)||z$3(e)===l$4},reactIs_production_min$1.isConcurrentMode=A$3,reactIs_production_min$1.isContextConsumer=function(e){return z$3(e)===k$5},reactIs_production_min$1.isContextProvider=function(e){return z$3(e)===h$3},reactIs_production_min$1.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===c$4},reactIs_production_min$1.isForwardRef=function(e){return z$3(e)===n$3},reactIs_production_min$1.isFragment=function(e){return z$3(e)===e$3},reactIs_production_min$1.isLazy=function(e){return z$3(e)===t$3},reactIs_production_min$1.isMemo=function(e){return z$3(e)===r$4},reactIs_production_min$1.isPortal=function(e){return z$3(e)===d$4},reactIs_production_min$1.isProfiler=function(e){return z$3(e)===g$4},reactIs_production_min$1.isStrictMode=function(e){return z$3(e)===f$4},reactIs_production_min$1.isSuspense=function(e){return z$3(e)===p$4},reactIs_production_min$1.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===e$3||e===m$4||e===g$4||e===f$4||e===p$4||e===q$3||"object"==typeof e&&null!==e&&(e.$$typeof===t$3||e.$$typeof===r$4||e.$$typeof===h$3||e.$$typeof===k$5||e.$$typeof===n$3||e.$$typeof===w$3||e.$$typeof===x$5||e.$$typeof===y$3||e.$$typeof===v$4)},reactIs_production_min$1.typeOf=z$3,reactIs$1.exports=reactIs_production_min$1;var reactIsExports=reactIs$1.exports,reactIs=reactIsExports,FORWARD_REF_STATICS={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},MEMO_STATICS={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},TYPE_STATICS={};TYPE_STATICS[reactIs.ForwardRef]=FORWARD_REF_STATICS,TYPE_STATICS[reactIs.Memo]=MEMO_STATICS;var isBrowser=!0;function getRegisteredStyles(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}var registerStyles=function(e,t,n){var r=e.key+"-"+t.name;!1!==n&&!1!==isBrowser||void 0!==e.registered[r]||(e.registered[r]=t.styles)},insertStyles=function(e,t,n){registerStyles(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}};function murmur2(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}var unitlessKeys={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},hyphenateRegex=/[A-Z]|^ms/g,animationRegex=/_EMO_([^_]+?)_([^]*?)_EMO_/g,isCustomProperty=function(e){return 45===e.charCodeAt(1)},isProcessableValue=function(e){return null!=e&&"boolean"!=typeof e},processStyleName=memoize$1(function(e){return isCustomProperty(e)?e:e.replace(hyphenateRegex,"-$&").toLowerCase()}),processStyleValue=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(animationRegex,function(e,t,n){return cursor={name:t,styles:n,next:cursor},t})}return 1===unitlessKeys[e]||isCustomProperty(e)||"number"!=typeof t||0===t?t:t+"px"};function handleInterpolation(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return cursor={name:o.name,styles:o.styles,next:cursor},o.name;var i=n;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)cursor={name:a.name,styles:a.styles,next:cursor},a=a.next;return i.styles+";"}return createStringFromObject(e,t,n);case"function":if(void 0!==e){var s=cursor,l=n(e);return cursor=s,handleInterpolation(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}function createStringFromObject(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=handleInterpolation(e,t,n[o])+";";else for(var i in n){var a=n[i];if("object"!=typeof a){var s=a;null!=t&&void 0!==t[s]?r+=i+"{"+t[s]+"}":isProcessableValue(s)&&(r+=processStyleName(i)+":"+processStyleValue(i,s)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var l=handleInterpolation(e,t,a);switch(i){case"animation":case"animationName":r+=processStyleName(i)+":"+l+";";break;default:r+=i+"{"+l+"}"}}else for(var c=0;c<a.length;c++)isProcessableValue(a[c])&&(r+=processStyleName(i)+":"+processStyleValue(i,a[c])+";")}return r}var labelPattern=/label:\s*([^\s;{]+)\s*(;|$)/g,cursor;function serializeStyles(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";cursor=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=handleInterpolation(n,t,i)):o+=i[0];for(var a=1;a<e.length;a++){if(o+=handleInterpolation(n,t,e[a]),r)o+=i[a]}labelPattern.lastIndex=0;for(var s,l="";null!==(s=labelPattern.exec(o));)l+="-"+s[1];return{name:murmur2(o)+l,styles:o,next:cursor}}var syncFallback=function(e){return e()},useInsertionEffect$1=!!React$1.useInsertionEffect&&React$1.useInsertionEffect,useInsertionEffectAlwaysWithSyncFallback=useInsertionEffect$1||syncFallback,useInsertionEffectWithLayoutFallback=useInsertionEffect$1||reactExports.useLayoutEffect,EmotionCacheContext=reactExports.createContext("undefined"!=typeof HTMLElement?createCache({key:"css"}):null),CacheProvider=EmotionCacheContext.Provider,__unsafe_useEmotionCache=function(){return reactExports.useContext(EmotionCacheContext)},withEmotionCache=function(e){return reactExports.forwardRef(function(t,n){var r=reactExports.useContext(EmotionCacheContext);return e(t,r,n)})},ThemeContext$1=reactExports.createContext({}),Global=withEmotionCache(function(e,t){var n=serializeStyles([e.styles],void 0,reactExports.useContext(ThemeContext$1)),r=reactExports.useRef();return useInsertionEffectWithLayoutFallback(function(){var e=t.key+"-global",o=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),i=!1,a=document.querySelector('style[data-emotion="'+e+" "+n.name+'"]');return t.sheet.tags.length&&(o.before=t.sheet.tags[0]),null!==a&&(i=!0,a.setAttribute("data-emotion",e),o.hydrate([a])),r.current=[o,i],function(){o.flush()}},[t]),useInsertionEffectWithLayoutFallback(function(){var e=r.current,o=e[0];if(e[1])e[1]=!1;else{if(void 0!==n.next&&insertStyles(t,n.next,!0),o.tags.length){var i=o.tags[o.tags.length-1].nextElementSibling;o.before=i,o.flush()}t.insert("",n,o,!1)}},[t,n.name]),null});function css(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return serializeStyles(t)}var keyframes=function(){var e=css.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}},testOmitPropsOnStringTag=isPropValid,testOmitPropsOnComponent=function(e){return"theme"!==e},getDefaultShouldForwardProp=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?testOmitPropsOnStringTag:testOmitPropsOnComponent},composeShouldForwardProps=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},Insertion=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return registerStyles(t,n,r),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles(t,n,r)}),null},createStyled$1=function e(t,n){var r,o,i=t.__emotion_real===t,a=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,o=n.target);var s=composeShouldForwardProps(t,n,i),l=s||getDefaultShouldForwardProp(a),c=!l("as");return function(){var u=arguments,d=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&d.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)d.push.apply(d,u);else{d.push(u[0][0]);for(var p=u.length,h=1;h<p;h++)d.push(u[h],u[0][h])}var f=withEmotionCache(function(e,t,n){var r=c&&e.as||a,i="",u=[],p=e;if(null==e.theme){for(var h in p={},e)p[h]=e[h];p.theme=reactExports.useContext(ThemeContext$1)}"string"==typeof e.className?i=getRegisteredStyles(t.registered,u,e.className):null!=e.className&&(i=e.className+" ");var f=serializeStyles(d.concat(u),t.registered,p);i+=t.key+"-"+f.name,void 0!==o&&(i+=" "+o);var A=c&&void 0===s?getDefaultShouldForwardProp(r):l,m={};for(var g in e)c&&"as"===g||A(g)&&(m[g]=e[g]);return m.className=i,m.ref=n,reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(Insertion,{cache:t,serialized:f,isStringTag:"string"==typeof r}),reactExports.createElement(r,m))});return f.displayName=void 0!==r?r:"Styled("+("string"==typeof a?a:a.displayName||a.name||"Component")+")",f.defaultProps=t.defaultProps,f.__emotion_real=f,f.__emotion_base=a,f.__emotion_styles=d,f.__emotion_forwardProp=s,Object.defineProperty(f,"toString",{value:function(){return"."+o}}),f.withComponent=function(t,r){return e(t,_extends({},n,r,{shouldForwardProp:composeShouldForwardProps(f,r,!0)})).apply(void 0,d)},f}},tags=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],newStyled=createStyled$1.bind();function isEmpty$4(e){return null==e||0===Object.keys(e).length}function GlobalStyles$1(e){const{styles:t,defaultTheme:n={}}=e;return factory$1(Global,{styles:"function"==typeof t?e=>t(isEmpty$4(e)?n:e):t})}function styled$1(e,t){return newStyled(e,t)}tags.forEach(function(e){newStyled[e]=newStyled(e)});const internal_processStyles=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))};function isPlainObject$3(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function deepClone(e){if(reactExports.isValidElement(e)||!isPlainObject$3(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=deepClone(e[n])}),t}function deepmerge$2(e,t,n={clone:!0}){const r=n.clone?_extends({},e):e;return isPlainObject$3(e)&&isPlainObject$3(t)&&Object.keys(t).forEach(o=>{reactExports.isValidElement(t[o])?r[o]=t[o]:isPlainObject$3(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&isPlainObject$3(e[o])?r[o]=deepmerge$2(e[o],t[o],n):n.clone?r[o]=isPlainObject$3(t[o])?deepClone(t[o]):t[o]:r[o]=t[o]}),r}function formatMuiErrorMessage(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}function capitalize$2(e){if("string"!=typeof e)throw new Error(formatMuiErrorMessage(7));return e.charAt(0).toUpperCase()+e.slice(1)}function createChainedFunction(...e){return e.reduce((e,t)=>null==t?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}function debounce$2(e,t=166){let n;function r(...r){clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}return r.clear=()=>{clearTimeout(n)},r}function deprecatedPropType(e,t){return()=>null}function isMuiElement(e,t){var n,r;return reactExports.isValidElement(e)&&-1!==t.indexOf(null!=(n=e.type.muiName)?n:null==(r=e.type)||null==(r=r._payload)||null==(r=r.value)?void 0:r.muiName)}function ownerDocument(e){return e&&e.ownerDocument||document}function ownerWindow(e){return ownerDocument(e).defaultView||window}function requirePropFactory(e,t){return()=>null}function setRef(e,t){"function"==typeof e?e(t):e&&(e.current=t)}const useEnhancedEffect="undefined"!=typeof window?reactExports.useLayoutEffect:reactExports.useEffect;let globalId=0;function useGlobalId(e){const[t,n]=reactExports.useState(e),r=e||t;return reactExports.useEffect(()=>{null==t&&(globalId+=1,n(`mui-${globalId}`))},[t]),r}const maybeReactUseId=React$1["useId".toString()];function useId$2(e){if(void 0!==maybeReactUseId){const t=maybeReactUseId();return null!=e?e:t}return useGlobalId(e)}function unsupportedProp(e,t,n,r,o){return null}function useControlled({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=reactExports.useRef(void 0!==e),[i,a]=reactExports.useState(t);return[o?e:i,reactExports.useCallback(e=>{o||a(e)},[])]}function useEventCallback(e){const t=reactExports.useRef(e);return useEnhancedEffect(()=>{t.current=e}),reactExports.useRef((...e)=>(0,t.current)(...e)).current}function useForkRef(...e){return reactExports.useMemo(()=>e.every(e=>null==e)?null:t=>{e.forEach(e=>{setRef(e,t)})},e)}class Timeout{constructor(){this.currentId=null,this.clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new Timeout}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}}let hadKeyboardEvent=!0,hadFocusVisibleRecently=!1;const hadFocusVisibleRecentlyTimeout=new Timeout,inputTypesWhitelist={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function focusTriggersKeyboardModality(e){const{type:t,tagName:n}=e;return!("INPUT"!==n||!inputTypesWhitelist[t]||e.readOnly)||("TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable)}function handleKeyDown(e){e.metaKey||e.altKey||e.ctrlKey||(hadKeyboardEvent=!0)}function handlePointerDown(){hadKeyboardEvent=!1}function handleVisibilityChange(){"hidden"===this.visibilityState&&hadFocusVisibleRecently&&(hadKeyboardEvent=!0)}function prepare(e){e.addEventListener("keydown",handleKeyDown,!0),e.addEventListener("mousedown",handlePointerDown,!0),e.addEventListener("pointerdown",handlePointerDown,!0),e.addEventListener("touchstart",handlePointerDown,!0),e.addEventListener("visibilitychange",handleVisibilityChange,!0)}function isFocusVisible(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch(n){}return hadKeyboardEvent||focusTriggersKeyboardModality(t)}function useIsFocusVisible(){const e=reactExports.useCallback(e=>{null!=e&&prepare(e.ownerDocument)},[]),t=reactExports.useRef(!1);return{isFocusVisibleRef:t,onFocus:function(e){return!!isFocusVisible(e)&&(t.current=!0,!0)},onBlur:function(){return!!t.current&&(hadFocusVisibleRecently=!0,hadFocusVisibleRecentlyTimeout.start(100,()=>{hadFocusVisibleRecently=!1}),t.current=!1,!0)},ref:e}}function getScrollbarSize(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}let cachedType;function detectScrollType(){if(cachedType)return cachedType;const e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),cachedType="reverse",e.scrollLeft>0?cachedType="default":(e.scrollLeft=1,0===e.scrollLeft&&(cachedType="negative")),document.body.removeChild(e),cachedType}function getNormalizedScrollLeft(e,t){const n=e.scrollLeft;if("rtl"!==t)return n;switch(detectScrollType()){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n;default:return n}}const usePreviousProps=e=>{const t=reactExports.useRef({});return reactExports.useEffect(()=>{t.current=e}),t.current},visuallyHidden={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function resolveProps(e,t){const n=_extends({},t);return Object.keys(e).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=_extends({},e[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const o=e[r]||{},i=t[r];n[r]={},i&&Object.keys(i)?o&&Object.keys(o)?(n[r]=_extends({},i),Object.keys(o).forEach(e=>{n[r][e]=resolveProps(o[e],i[e])})):n[r]=i:n[r]=o}else void 0===n[r]&&(n[r]=e[r])}),n}function composeClasses(e,t,n=void 0){const r={};return Object.keys(e).forEach(o=>{r[o]=e[o].reduce((e,r)=>{if(r){const o=t(r);""!==o&&e.push(o),n&&n[r]&&e.push(n[r])}return e},[]).join(" ")}),r}const defaultGenerator=e=>e,createClassNameGenerator=()=>{let e=defaultGenerator;return{configure(t){e=t},generate:t=>e(t),reset(){e=defaultGenerator}}},ClassNameGenerator=createClassNameGenerator(),globalStateClasses={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function generateUtilityClass(e,t,n="Mui"){const r=globalStateClasses[t];return r?`${n}-${r}`:`${ClassNameGenerator.generate(e)}-${t}`}function generateUtilityClasses(e,t,n="Mui"){const r={};return t.forEach(t=>{r[t]=generateUtilityClass(e,t,n)}),r}function r$3(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=r$3(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function clsx$2(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=r$3(e))&&(r&&(r+=" "),r+=t);return r}function merge$2(e,t){return t?deepmerge$2(e,t,{clone:!1}):e}const values$2={xs:0,sm:600,md:900,lg:1200,xl:1536},defaultBreakpoints={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${values$2[e]}px)`};function handleBreakpoints(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const e=r.breakpoints||defaultBreakpoints;return t.reduce((r,o,i)=>(r[e.up(e.keys[i])]=n(t[i]),r),{})}if("object"==typeof t){const e=r.breakpoints||defaultBreakpoints;return Object.keys(t).reduce((r,o)=>{if(-1!==Object.keys(e.values||values$2).indexOf(o)){r[e.up(o)]=n(t[o],o)}else{const e=o;r[e]=t[e]}return r},{})}return n(t)}function createEmptyBreakpointObject(e={}){var t;return(null==(t=e.keys)?void 0:t.reduce((t,n)=>(t[e.up(n)]={},t),{}))||{}}function removeUnusedBreakpoints(e,t){return e.reduce((e,t)=>{const n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e},t)}function mergeBreakpointsInOrder(e,...t){const n=createEmptyBreakpointObject(e),r=[n,...t].reduce((e,t)=>deepmerge$2(e,t),{});return removeUnusedBreakpoints(Object.keys(n),r)}function computeBreakpointsBase(e,t){if("object"!=typeof e)return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((t,r)=>{r<e.length&&(n[t]=!0)}):r.forEach(t=>{null!=e[t]&&(n[t]=!0)}),n}function resolveBreakpointValues({values:e,breakpoints:t,base:n}){const r=n||computeBreakpointsBase(e,t),o=Object.keys(r);if(0===o.length)return e;let i;return o.reduce((t,n,r)=>(Array.isArray(e)?(t[n]=null!=e[r]?e[r]:e[i],i=r):"object"==typeof e?(t[n]=null!=e[n]?e[n]:e[i],i=n):t[n]=e,t),{})}function getPath(e,t,n=!0){if(!t||"string"!=typeof t)return null;if(e&&e.vars&&n){const n=`vars.${t}`.split(".").reduce((e,t)=>e&&e[t]?e[t]:null,e);if(null!=n)return n}return t.split(".").reduce((e,t)=>e&&null!=e[t]?e[t]:null,e)}function getStyleValue$1(e,t,n,r=n){let o;return o="function"==typeof e?e(n):Array.isArray(e)?e[n]||r:getPath(e,n)||r,t&&(o=t(o,r,e)),o}function style$2(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:o}=e,i=e=>{if(null==e[t])return null;const i=e[t],a=getPath(e.theme,r)||{};return handleBreakpoints(e,i,e=>{let r=getStyleValue$1(a,o,e);return e===r&&"string"==typeof e&&(r=getStyleValue$1(a,o,`${t}${"default"===e?"":capitalize$2(e)}`,e)),!1===n?r:{[n]:r}})};return i.propTypes={},i.filterProps=[t],i}function compose(...e){const t=e.reduce((e,t)=>(t.filterProps.forEach(n=>{e[n]=t}),e),{}),n=e=>Object.keys(e).reduce((n,r)=>t[r]?merge$2(n,t[r](e)):n,{});return n.propTypes={},n.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),n}function memoize(e){const t={};return n=>(void 0===t[n]&&(t[n]=e(n)),t[n])}const properties={m:"margin",p:"padding"},directions={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},aliases$1={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},getCssProperties=memoize(e=>{if(e.length>2){if(!aliases$1[e])return[e];e=aliases$1[e]}const[t,n]=e.split(""),r=properties[t],o=directions[n]||"";return Array.isArray(o)?o.map(e=>r+e):[r+o]}),marginKeys=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],paddingKeys=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];function createUnaryUnit(e,t,n,r){var o;const i=null!=(o=getPath(e,t,!1))?o:n;return"number"==typeof i?e=>"string"==typeof e?e:i*e:Array.isArray(i)?e=>"string"==typeof e?e:i[e]:"function"==typeof i?i:()=>{}}function createUnarySpacing(e){return createUnaryUnit(e,"spacing",8)}function getValue(e,t){if("string"==typeof t||null==t)return t;const n=e(Math.abs(t));return t>=0?n:"number"==typeof n?-n:`-${n}`}function getStyleFromPropValue(e,t){return n=>e.reduce((e,r)=>(e[r]=getValue(t,n),e),{})}function resolveCssProperty(e,t,n,r){if(-1===t.indexOf(n))return null;const o=getStyleFromPropValue(getCssProperties(n),r);return handleBreakpoints(e,e[n],o)}function style$1(e,t){const n=createUnarySpacing(e.theme);return Object.keys(e).map(r=>resolveCssProperty(e,t,r,n)).reduce(merge$2,{})}function margin(e){return style$1(e,marginKeys)}function padding(e){return style$1(e,paddingKeys)}function borderTransform(e){return"number"!=typeof e?e:`${e}px solid`}margin.propTypes={},margin.filterProps=marginKeys,padding.propTypes={},padding.filterProps=paddingKeys;const border=style$2({prop:"border",themeKey:"borders",transform:borderTransform}),borderTop=style$2({prop:"borderTop",themeKey:"borders",transform:borderTransform}),borderRight=style$2({prop:"borderRight",themeKey:"borders",transform:borderTransform}),borderBottom=style$2({prop:"borderBottom",themeKey:"borders",transform:borderTransform}),borderLeft=style$2({prop:"borderLeft",themeKey:"borders",transform:borderTransform}),borderColor=style$2({prop:"borderColor",themeKey:"palette"}),borderTopColor=style$2({prop:"borderTopColor",themeKey:"palette"}),borderRightColor=style$2({prop:"borderRightColor",themeKey:"palette"}),borderBottomColor=style$2({prop:"borderBottomColor",themeKey:"palette"}),borderLeftColor=style$2({prop:"borderLeftColor",themeKey:"palette"}),borderRadius=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=createUnaryUnit(e.theme,"shape.borderRadius",4),n=e=>({borderRadius:getValue(t,e)});return handleBreakpoints(e,e.borderRadius,n)}return null};borderRadius.propTypes={},borderRadius.filterProps=["borderRadius"],compose(border,borderTop,borderRight,borderBottom,borderLeft,borderColor,borderTopColor,borderRightColor,borderBottomColor,borderLeftColor,borderRadius);const gap=e=>{if(void 0!==e.gap&&null!==e.gap){const t=createUnaryUnit(e.theme,"spacing",8),n=e=>({gap:getValue(t,e)});return handleBreakpoints(e,e.gap,n)}return null};gap.propTypes={},gap.filterProps=["gap"];const columnGap=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=createUnaryUnit(e.theme,"spacing",8),n=e=>({columnGap:getValue(t,e)});return handleBreakpoints(e,e.columnGap,n)}return null};columnGap.propTypes={},columnGap.filterProps=["columnGap"];const rowGap=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=createUnaryUnit(e.theme,"spacing",8),n=e=>({rowGap:getValue(t,e)});return handleBreakpoints(e,e.rowGap,n)}return null};rowGap.propTypes={},rowGap.filterProps=["rowGap"];const gridColumn=style$2({prop:"gridColumn"}),gridRow=style$2({prop:"gridRow"}),gridAutoFlow=style$2({prop:"gridAutoFlow"}),gridAutoColumns=style$2({prop:"gridAutoColumns"}),gridAutoRows=style$2({prop:"gridAutoRows"}),gridTemplateColumns=style$2({prop:"gridTemplateColumns"}),gridTemplateRows=style$2({prop:"gridTemplateRows"}),gridTemplateAreas=style$2({prop:"gridTemplateAreas"}),gridArea=style$2({prop:"gridArea"});function paletteTransform(e,t){return"grey"===t?t:e}compose(gap,columnGap,rowGap,gridColumn,gridRow,gridAutoFlow,gridAutoColumns,gridAutoRows,gridTemplateColumns,gridTemplateRows,gridTemplateAreas,gridArea);const color$1=style$2({prop:"color",themeKey:"palette",transform:paletteTransform}),bgcolor=style$2({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:paletteTransform}),backgroundColor=style$2({prop:"backgroundColor",themeKey:"palette",transform:paletteTransform});function sizingTransform(e){return e<=1&&0!==e?100*e+"%":e}compose(color$1,bgcolor,backgroundColor);const width=style$2({prop:"width",transform:sizingTransform}),maxWidth=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{var n,r,o;return{maxWidth:(null==(n=e.theme)||null==(r=n.breakpoints)||null==(o=r.values)?void 0:o[t])||values$2[t]||sizingTransform(t)}};return handleBreakpoints(e,e.maxWidth,t)}return null};maxWidth.filterProps=["maxWidth"];const minWidth=style$2({prop:"minWidth",transform:sizingTransform}),height=style$2({prop:"height",transform:sizingTransform}),maxHeight=style$2({prop:"maxHeight",transform:sizingTransform}),minHeight=style$2({prop:"minHeight",transform:sizingTransform});style$2({prop:"size",cssProperty:"width",transform:sizingTransform}),style$2({prop:"size",cssProperty:"height",transform:sizingTransform});const boxSizing=style$2({prop:"boxSizing"});compose(width,maxWidth,minWidth,height,maxHeight,minHeight,boxSizing);const defaultSxConfig={border:{themeKey:"borders",transform:borderTransform},borderTop:{themeKey:"borders",transform:borderTransform},borderRight:{themeKey:"borders",transform:borderTransform},borderBottom:{themeKey:"borders",transform:borderTransform},borderLeft:{themeKey:"borders",transform:borderTransform},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:borderRadius},color:{themeKey:"palette",transform:paletteTransform},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:paletteTransform},backgroundColor:{themeKey:"palette",transform:paletteTransform},p:{style:padding},pt:{style:padding},pr:{style:padding},pb:{style:padding},pl:{style:padding},px:{style:padding},py:{style:padding},padding:{style:padding},paddingTop:{style:padding},paddingRight:{style:padding},paddingBottom:{style:padding},paddingLeft:{style:padding},paddingX:{style:padding},paddingY:{style:padding},paddingInline:{style:padding},paddingInlineStart:{style:padding},paddingInlineEnd:{style:padding},paddingBlock:{style:padding},paddingBlockStart:{style:padding},paddingBlockEnd:{style:padding},m:{style:margin},mt:{style:margin},mr:{style:margin},mb:{style:margin},ml:{style:margin},mx:{style:margin},my:{style:margin},margin:{style:margin},marginTop:{style:margin},marginRight:{style:margin},marginBottom:{style:margin},marginLeft:{style:margin},marginX:{style:margin},marginY:{style:margin},marginInline:{style:margin},marginInlineStart:{style:margin},marginInlineEnd:{style:margin},marginBlock:{style:margin},marginBlockStart:{style:margin},marginBlockEnd:{style:margin},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:gap},rowGap:{style:rowGap},columnGap:{style:columnGap},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:sizingTransform},maxWidth:{style:maxWidth},minWidth:{transform:sizingTransform},height:{transform:sizingTransform},maxHeight:{transform:sizingTransform},minHeight:{transform:sizingTransform},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function objectsHaveSameKeys(...e){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]),n=new Set(t);return e.every(e=>n.size===Object.keys(e).length)}function callIfFn(e,t){return"function"==typeof e?e(t):e}function unstable_createStyleFunctionSx(){function e(e,t,n,r){const o={[e]:t,theme:n},i=r[e];if(!i)return{[e]:t};const{cssProperty:a=e,themeKey:s,transform:l,style:c}=i;if(null==t)return null;const u=getPath(n,s)||{};if(c)return c(o);return handleBreakpoints(o,t,t=>{let n=getStyleValue$1(u,l,t);return t===n&&"string"==typeof t&&(n=getStyleValue$1(u,l,`${e}${"default"===t?"":capitalize$2(t)}`,t)),!1===a?n:{[a]:n}})}return function t(n){var r;const{sx:o,theme:i={}}=n||{};if(!o)return null;const a=null!=(r=i.unstable_sxConfig)?r:defaultSxConfig;function s(n){let r=n;if("function"==typeof n)r=n(i);else if("object"!=typeof n)return n;if(!r)return null;const o=createEmptyBreakpointObject(i.breakpoints),s=Object.keys(o);let l=o;return Object.keys(r).forEach(n=>{const o=callIfFn(r[n],i);if(null!=o)if("object"==typeof o)if(a[n])l=merge$2(l,e(n,o,i,a));else{const e=handleBreakpoints({theme:i},o,e=>({[n]:e}));objectsHaveSameKeys(e,o)?l[n]=t({sx:o,theme:i}):l=merge$2(l,e)}else l=merge$2(l,e(n,o,i,a))}),removeUnusedBreakpoints(s,l)}return Array.isArray(o)?o.map(s):s(o)}}const styleFunctionSx=unstable_createStyleFunctionSx();styleFunctionSx.filterProps=["sx"];const _excluded$1G=["sx"],splitProps=e=>{var t,n;const r={systemProps:{},otherProps:{}},o=null!=(t=null==e||null==(n=e.theme)?void 0:n.unstable_sxConfig)?t:defaultSxConfig;return Object.keys(e).forEach(t=>{o[t]?r.systemProps[t]=e[t]:r.otherProps[t]=e[t]}),r};function extendSxProp(e){const{sx:t}=e,n=_objectWithoutPropertiesLoose(e,_excluded$1G),{systemProps:r,otherProps:o}=splitProps(n);let i;return i=Array.isArray(t)?[r,...t]:"function"==typeof t?(...e)=>{const n=t(...e);return isPlainObject$3(n)?_extends({},r,n):r}:_extends({},r,t),_extends({},o,{sx:i})}function r$2(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r$2(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function clsx$1(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=r$2(e))&&(r&&(r+=" "),r+=t);return r}const _excluded$1F=["values","unit","step"],sortBreakpointsValues=e=>{const t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>_extends({},e,{[t.key]:t.val}),{})};function createBreakpoints(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=e,o=_objectWithoutPropertiesLoose(e,_excluded$1F),i=sortBreakpointsValues(t),a=Object.keys(i);function s(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n})`}function l(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-r/100}${n})`}function c(e,o){const i=a.indexOf(o);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n}) and (max-width:${(-1!==i&&"number"==typeof t[a[i]]?t[a[i]]:o)-r/100}${n})`}return _extends({keys:a,values:i,up:s,down:l,between:c,only:function(e){return a.indexOf(e)+1<a.length?c(e,a[a.indexOf(e)+1]):s(e)},not:function(e){const t=a.indexOf(e);return 0===t?s(a[1]):t===a.length-1?l(a[t]):c(e,a[a.indexOf(e)+1]).replace("@media","@media not all and")},unit:n},o)}const shape={borderRadius:4};function createSpacing(e=8){if(e.mui)return e;const t=createUnarySpacing({spacing:e}),n=(...e)=>(0===e.length?[1]:e).map(e=>{const n=t(e);return"number"==typeof n?`${n}px`:n}).join(" ");return n.mui=!0,n}const _excluded$1E=["breakpoints","palette","spacing","shape"];function createTheme$2(e={},...t){const{breakpoints:n={},palette:r={},spacing:o,shape:i={}}=e,a=_objectWithoutPropertiesLoose(e,_excluded$1E),s=createBreakpoints(n),l=createSpacing(o);let c=deepmerge$2({breakpoints:s,direction:"ltr",components:{},palette:_extends({mode:"light"},r),spacing:l,shape:_extends({},shape,i)},a);return c=t.reduce((e,t)=>deepmerge$2(e,t),c),c.unstable_sxConfig=_extends({},defaultSxConfig,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return styleFunctionSx({sx:e,theme:this})},c}const ThemeContext=reactExports.createContext(null);function useTheme$3(){return reactExports.useContext(ThemeContext)}const hasSymbol$1="function"==typeof Symbol&&Symbol.for,nested=hasSymbol$1?Symbol.for("mui.nested"):"__THEME_NESTED__";function mergeOuterLocalTheme(e,t){if("function"==typeof t){return t(e)}return _extends({},e,t)}function ThemeProvider$1(e){const{children:t,theme:n}=e,r=useTheme$3(),o=reactExports.useMemo(()=>{const e=null===r?n:mergeOuterLocalTheme(r,n);return null!=e&&(e[nested]=null!==r),e},[n,r]);return factory$1(ThemeContext.Provider,{value:o,children:t})}function isObjectEmpty(e){return 0===Object.keys(e).length}function useTheme$2(e=null){const t=useTheme$3();return!t||isObjectEmpty(t)?e:t}const systemDefaultTheme$1=createTheme$2();function useTheme$1(e=systemDefaultTheme$1){return useTheme$2(e)}const _excluded$1D=["className","component"];function createBox(e={}){const{defaultTheme:t,defaultClassName:n="MuiBox-root",generateClassName:r}=e,o=styled$1("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(styleFunctionSx);return reactExports.forwardRef(function(e,i){const a=useTheme$1(t),s=extendSxProp(e),{className:l,component:c="div"}=s,u=_objectWithoutPropertiesLoose(s,_excluded$1D);return factory$1(o,_extends({as:c,ref:i,className:clsx$1(l,r?r(n):n),theme:a},u))})}const _excluded$1C=["variant"];function isEmpty$3(e){return 0===e.length}function propsToClassKey(e){const{variant:t}=e,n=_objectWithoutPropertiesLoose(e,_excluded$1C);let r=t||"";return Object.keys(n).sort().forEach(t=>{r+="color"===t?isEmpty$3(r)?e[t]:capitalize$2(e[t]):`${isEmpty$3(r)?t:capitalize$2(t)}${capitalize$2(e[t].toString())}`}),r}const _excluded$1B=["name","slot","skipVariantsResolver","skipSx","overridesResolver"],_excluded2$6=["theme"],_excluded3=["theme"];function isEmpty$2(e){return 0===Object.keys(e).length}function isStringTag(e){return"string"==typeof e&&e.charCodeAt(0)>96}const getStyleOverrides=(e,t)=>t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null,getVariantStyles=(e,t)=>{let n=[];t&&t.components&&t.components[e]&&t.components[e].variants&&(n=t.components[e].variants);const r={};return n.forEach(e=>{const t=propsToClassKey(e.props);r[t]=e.style}),r},variantsResolver=(e,t,n,r)=>{var o,i;const{ownerState:a={}}=e,s=[],l=null==n||null==(o=n.components)||null==(i=o[r])?void 0:i.variants;return l&&l.forEach(n=>{let r=!0;Object.keys(n.props).forEach(t=>{a[t]!==n.props[t]&&e[t]!==n.props[t]&&(r=!1)}),r&&s.push(t[propsToClassKey(n.props)])}),s};function shouldForwardProp(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const systemDefaultTheme=createTheme$2();function createStyled(e={}){const{defaultTheme:t=systemDefaultTheme,rootShouldForwardProp:n=shouldForwardProp,slotShouldForwardProp:r=shouldForwardProp}=e,o=e=>{const n=isEmpty$2(e.theme)?t:e.theme;return styleFunctionSx(_extends({},e,{theme:n}))};return o.__mui_systemSx=!0,(e,i={})=>{internal_processStyles(e,e=>e.filter(e=>!(null!=e&&e.__mui_systemSx)));const{name:a,slot:s,skipVariantsResolver:l,skipSx:c,overridesResolver:u}=i,d=_objectWithoutPropertiesLoose(i,_excluded$1B),p=void 0!==l?l:s&&"Root"!==s||!1,h=c||!1;let f=shouldForwardProp;"Root"===s?f=n:s?f=r:isStringTag(e)&&(f=void 0);const A=styled$1(e,_extends({shouldForwardProp:f,label:void 0},d)),m=(e,...n)=>{const r=n?n.map(e=>"function"==typeof e&&e.__emotion_real!==e?n=>{let{theme:r}=n,o=_objectWithoutPropertiesLoose(n,_excluded2$6);return e(_extends({theme:isEmpty$2(r)?t:r},o))}:e):[];let i=e;a&&u&&r.push(e=>{const n=isEmpty$2(e.theme)?t:e.theme,r=getStyleOverrides(a,n);if(r){const t={};return Object.entries(r).forEach(([r,o])=>{t[r]="function"==typeof o?o(_extends({},e,{theme:n})):o}),u(e,t)}return null}),a&&!p&&r.push(e=>{const n=isEmpty$2(e.theme)?t:e.theme;return variantsResolver(e,getVariantStyles(a,n),n,a)}),h||r.push(o);const s=r.length-n.length;if(Array.isArray(e)&&s>0){const t=new Array(s).fill("");i=[...e,...t],i.raw=[...e.raw,...t]}else"function"==typeof e&&e.__emotion_real!==e&&(i=n=>{let{theme:r}=n,o=_objectWithoutPropertiesLoose(n,_excluded3);return e(_extends({theme:isEmpty$2(r)?t:r},o))});return A(i,...r)};return A.withConfig&&(m.withConfig=A.withConfig),m}}function getThemeProps(e){const{theme:t,name:n,props:r}=e;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?resolveProps(t.components[n].defaultProps,r):r}function useThemeProps$1({props:e,name:t,defaultTheme:n}){return getThemeProps({theme:useTheme$1(n),name:t,props:e})}function clamp$6(e,t=0,n=1){return Math.min(Math.max(t,e),n)}function hexToRgb(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&1===n[0].length&&(n=n.map(e=>e+e)),n?`rgb${4===n.length?"a":""}(${n.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(", ")})`:""}function decomposeColor(e){if(e.type)return e;if("#"===e.charAt(0))return decomposeColor(hexToRgb(e));const t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(n))throw new Error(formatMuiErrorMessage(9,e));let r,o=e.substring(t+1,e.length-1);if("color"===n){if(o=o.split(" "),r=o.shift(),4===o.length&&"/"===o[3].charAt(0)&&(o[3]=o[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(r))throw new Error(formatMuiErrorMessage(10,r))}else o=o.split(",");return o=o.map(e=>parseFloat(e)),{type:n,values:o,colorSpace:r}}function recomposeColor(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return-1!==t.indexOf("rgb")?r=r.map((e,t)=>t<3?parseInt(e,10):e):-1!==t.indexOf("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=-1!==t.indexOf("color")?`${n} ${r.join(" ")}`:`${r.join(", ")}`,`${t}(${r})`}function hslToRgb(e){e=decomposeColor(e);const{values:t}=e,n=t[0],r=t[1]/100,o=t[2]/100,i=r*Math.min(o,1-o),a=(e,t=(e+n/30)%12)=>o-i*Math.max(Math.min(t-3,9-t,1),-1);let s="rgb";const l=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(s+="a",l.push(t[3])),recomposeColor({type:s,values:l})}function getLuminance(e){let t="hsl"===(e=decomposeColor(e)).type||"hsla"===e.type?decomposeColor(hslToRgb(e)).values:e.values;return t=t.map(t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function getContrastRatio(e,t){const n=getLuminance(e),r=getLuminance(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function alpha$2(e,t){return e=decomposeColor(e),t=clamp$6(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,recomposeColor(e)}function darken$1(e,t){if(e=decomposeColor(e),t=clamp$6(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return recomposeColor(e)}function lighten(e,t){if(e=decomposeColor(e),t=clamp$6(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return recomposeColor(e)}function emphasize(e,t=.15){return getLuminance(e)>.5?darken$1(e,t):lighten(e,t)}const EMPTY_THEME={};function InnerThemeProvider(e){const t=useTheme$1();return factory$1(ThemeContext$1.Provider,{value:"object"==typeof t?t:EMPTY_THEME,children:e.children})}function ThemeProvider(e){const{children:t,theme:n}=e;return factory$1(ThemeProvider$1,{theme:n,children:factory$1(InnerThemeProvider,{children:t})})}function createMixins(e,t){return _extends({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}const common$1={black:"#000",white:"#fff"},grey={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},purple={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2",900:"#4a148c"},red={200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828",900:"#b71c1c"},orange={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},blue={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",500:"#2196f3",700:"#1976d2",800:"#1565c0",900:"#0d47a1"},lightBlue={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},green={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},_excluded$1A=["mode","contrastThreshold","tonalOffset"],light={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:common$1.white,default:common$1.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},dark={text:{primary:common$1.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:common$1.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function addLightOrDark(e,t,n,r){const o=r.light||r,i=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=lighten(e.main,o):"dark"===t&&(e.dark=darken$1(e.main,i)))}function getDefaultPrimary(e="light"){return"dark"===e?{main:blue[200],light:blue[50],dark:blue[400]}:{main:blue[700],light:blue[400],dark:blue[800]}}function getDefaultSecondary(e="light"){return"dark"===e?{main:purple[200],light:purple[50],dark:purple[400]}:{main:purple[500],light:purple[300],dark:purple[700]}}function getDefaultError(e="light"){return"dark"===e?{main:red[500],light:red[300],dark:red[700]}:{main:red[700],light:red[400],dark:red[800]}}function getDefaultInfo(e="light"){return"dark"===e?{main:lightBlue[400],light:lightBlue[300],dark:lightBlue[700]}:{main:lightBlue[700],light:lightBlue[500],dark:lightBlue[900]}}function getDefaultSuccess(e="light"){return"dark"===e?{main:green[400],light:green[300],dark:green[700]}:{main:green[800],light:green[500],dark:green[900]}}function getDefaultWarning(e="light"){return"dark"===e?{main:orange[400],light:orange[300],dark:orange[700]}:{main:"#ed6c02",light:orange[500],dark:orange[900]}}function createPalette(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2}=e,o=_objectWithoutPropertiesLoose(e,_excluded$1A),i=e.primary||getDefaultPrimary(t),a=e.secondary||getDefaultSecondary(t),s=e.error||getDefaultError(t),l=e.info||getDefaultInfo(t),c=e.success||getDefaultSuccess(t),u=e.warning||getDefaultWarning(t);function d(e){return getContrastRatio(e,dark.text.primary)>=n?dark.text.primary:light.text.primary}const p=({color:e,name:t,mainShade:n=500,lightShade:o=300,darkShade:i=700})=>{if(!(e=_extends({},e)).main&&e[n]&&(e.main=e[n]),!e.hasOwnProperty("main"))throw new Error(formatMuiErrorMessage(11,t?` (${t})`:"",n));if("string"!=typeof e.main)throw new Error(formatMuiErrorMessage(12,t?` (${t})`:"",JSON.stringify(e.main)));return addLightOrDark(e,"light",o,r),addLightOrDark(e,"dark",i,r),e.contrastText||(e.contrastText=d(e.main)),e},h={dark:dark,light:light};return deepmerge$2(_extends({common:_extends({},common$1),mode:t,primary:p({color:i,name:"primary"}),secondary:p({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:p({color:s,name:"error"}),warning:p({color:u,name:"warning"}),info:p({color:l,name:"info"}),success:p({color:c,name:"success"}),grey:grey,contrastThreshold:n,getContrastText:d,augmentColor:p,tonalOffset:r},h[t]),o)}const _excluded$1z=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function round$6(e){return Math.round(1e5*e)/1e5}const caseAllCaps={textTransform:"uppercase"},defaultFontFamily='"Roboto", "Helvetica", "Arial", sans-serif';function createTypography(e,t){const n="function"==typeof t?t(e):t,{fontFamily:r=defaultFontFamily,fontSize:o=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:s=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d}=n,p=_objectWithoutPropertiesLoose(n,_excluded$1z),h=o/14,f=d||(e=>e/c*h+"rem"),A=(e,t,n,o,i)=>_extends({fontFamily:r,fontWeight:e,fontSize:f(t),lineHeight:n},r===defaultFontFamily?{letterSpacing:`${round$6(o/t)}em`}:{},i,u),m={h1:A(i,96,1.167,-1.5),h2:A(i,60,1.2,-.5),h3:A(a,48,1.167,0),h4:A(a,34,1.235,.25),h5:A(a,24,1.334,0),h6:A(s,20,1.6,.15),subtitle1:A(a,16,1.75,.15),subtitle2:A(s,14,1.57,.1),body1:A(a,16,1.5,.15),body2:A(a,14,1.43,.15),button:A(s,14,1.75,.4,caseAllCaps),caption:A(a,12,1.66,.4),overline:A(a,12,2.66,1,caseAllCaps)};return deepmerge$2(_extends({htmlFontSize:c,pxToRem:f,fontFamily:r,fontSize:o,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:l},m),p,{clone:!1})}const shadowKeyUmbraOpacity=.2,shadowKeyPenumbraOpacity=.14,shadowAmbientShadowOpacity=.12;function createShadow(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(",")}const shadows=["none",createShadow(0,2,1,-1,0,1,1,0,0,1,3,0),createShadow(0,3,1,-2,0,2,2,0,0,1,5,0),createShadow(0,3,3,-2,0,3,4,0,0,1,8,0),createShadow(0,2,4,-1,0,4,5,0,0,1,10,0),createShadow(0,3,5,-1,0,5,8,0,0,1,14,0),createShadow(0,3,5,-1,0,6,10,0,0,1,18,0),createShadow(0,4,5,-2,0,7,10,1,0,2,16,1),createShadow(0,5,5,-3,0,8,10,1,0,3,14,2),createShadow(0,5,6,-3,0,9,12,1,0,3,16,2),createShadow(0,6,6,-3,0,10,14,1,0,4,18,3),createShadow(0,6,7,-4,0,11,15,1,0,4,20,3),createShadow(0,7,8,-4,0,12,17,2,0,5,22,4),createShadow(0,7,8,-4,0,13,19,2,0,5,24,4),createShadow(0,7,9,-4,0,14,21,2,0,5,26,4),createShadow(0,8,9,-5,0,15,22,2,0,6,28,5),createShadow(0,8,10,-5,0,16,24,2,0,6,30,5),createShadow(0,8,11,-5,0,17,26,2,0,6,32,5),createShadow(0,9,11,-5,0,18,28,2,0,7,34,6),createShadow(0,9,12,-6,0,19,29,2,0,7,36,6),createShadow(0,10,13,-6,0,20,31,3,0,8,38,7),createShadow(0,10,13,-6,0,21,33,3,0,8,40,7),createShadow(0,10,14,-6,0,22,35,3,0,8,42,7),createShadow(0,11,14,-7,0,23,36,3,0,9,44,8),createShadow(0,11,15,-7,0,24,38,3,0,9,46,8)],_excluded$1y=["duration","easing","delay"],easing={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},duration={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function formatMs(e){return`${Math.round(e)}ms`}function getAutoHeightDuration(e){if(!e)return 0;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}function createTransitions(e){const t=_extends({},easing,e.easing),n=_extends({},duration,e.duration);return _extends({getAutoHeightDuration:getAutoHeightDuration,create:(e=["all"],r={})=>{const{duration:o=n.standard,easing:i=t.easeInOut,delay:a=0}=r;return _objectWithoutPropertiesLoose(r,_excluded$1y),(Array.isArray(e)?e:[e]).map(e=>`${e} ${"string"==typeof o?o:formatMs(o)} ${i} ${"string"==typeof a?a:formatMs(a)}`).join(",")}},e,{easing:t,duration:n})}const zIndex={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},_excluded$1x=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function createTheme$1(e={},...t){const{mixins:n={},palette:r={},transitions:o={},typography:i={}}=e,a=_objectWithoutPropertiesLoose(e,_excluded$1x);if(e.vars)throw new Error(formatMuiErrorMessage(18));const s=createPalette(r),l=createTheme$2(e);let c=deepmerge$2(l,{mixins:createMixins(l.breakpoints,n),palette:s,shadows:shadows.slice(),typography:createTypography(s,i),transitions:createTransitions(o),zIndex:_extends({},zIndex)});return c=deepmerge$2(c,a),c=t.reduce((e,t)=>deepmerge$2(e,t),c),c.unstable_sxConfig=_extends({},defaultSxConfig,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return styleFunctionSx({sx:e,theme:this})},c}const defaultTheme$1=createTheme$1();function useTheme(){return useTheme$1(defaultTheme$1)}function useThemeProps({props:e,name:t}){return useThemeProps$1({props:e,name:t,defaultTheme:defaultTheme$1})}const rootShouldForwardProp=e=>shouldForwardProp(e)&&"classes"!==e,slotShouldForwardProp=shouldForwardProp,styled=createStyled({defaultTheme:defaultTheme$1,rootShouldForwardProp:rootShouldForwardProp}),getOverlayAlpha=e=>{let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,(t/100).toFixed(2)},objectFromEntries=Object.fromEntries?Object.fromEntries:e=>{if(!e||!e[Symbol.iterator])throw new Error("Object.fromEntries() requires a single iterable argument");const t={};return Object.keys(e).forEach(n=>{const[r,o]=e[n];t[r]=o}),t};function objectKeys(e){return Object.keys(e)}function assert(e,t){if(!e)throw new Error(t)}function typeGuard(e,t){return t}const classnames=e=>{const t=e.length;let n=0,r="";for(;n<t;n++){const t=e[n];if(null==t)continue;let o;switch(typeof t){case"boolean":break;case"object":if(Array.isArray(t))o=classnames(t);else{assert(!typeGuard(t,!1)),o="";for(const e in t)t[e]&&e&&(o&&(o+=" "),o+=e)}break;default:o=t}o&&(r&&(r+=" "),r+=o)}return r};function useGuaranteedMemo(e,t){var n;const r=reactExports.useRef();return(!r.current||t.length!==(null===(n=r.current.prevDeps)||void 0===n?void 0:n.length)||r.current.prevDeps.map((e,n)=>e===t[n]).indexOf(!1)>=0)&&(r.current={v:e(),prevDeps:[...t]}),r.current.v}function matchCSSObject(e){return e instanceof Object&&!("styles"in e)&&!("length"in e)&&!("__emotion_styles"in e)}const{createCssAndCx:createCssAndCx}=(()=>({createCssAndCx:function(e){const{cache:t}=e,n=(...e)=>{const n=serializeStyles(e,t.registered);insertStyles(t,n,!1);const r=`${t.key}-${n.name}`;{const n=e[0];matchCSSObject(n)&&increaseSpecificityToTakePrecedenceOverMediaQueries.saveClassNameCSSObjectMapping(t,r,n)}return r};return{css:n,cx:(...e)=>{const r=classnames(e),o=increaseSpecificityToTakePrecedenceOverMediaQueries.fixClassName(t,r,n);return function(e,t,n){const r=[],o=getRegisteredStyles(e,r,n);return r.length<2?n:o+t(r)}(t.registered,n,o)}}}}))();function createUseCssAndCx(e){const{useCache:t}=e;return{useCssAndCx:function(){const e=t(),{css:n,cx:r}=useGuaranteedMemo(()=>createCssAndCx({cache:e}),[e]);return{css:n,cx:r}}}}const increaseSpecificityToTakePrecedenceOverMediaQueries=(()=>{const e=new WeakMap;return{saveClassNameCSSObjectMapping:(t,n,r)=>{let o=e.get(t);void 0===o&&(o=new Map,e.set(t,o)),o.set(n,r)},fixClassName:(()=>(t,n,r)=>{const o=e.get(t);return classnames(function(e){let t=!1;return e.map(([e,n])=>{if(void 0===n)return e;let r;if(t)r={"&&":n};else{r=e;for(const e in n)if(e.startsWith("@media")){t=!0;break}}return r})}(n.split(" ").map(e=>[e,null==o?void 0:o.get(e)])).map(e=>"string"==typeof e?e:r(e)))})()}})();function getDependencyArrayRef(e){if(!(e instanceof Object)||"function"==typeof e)return e;const t=[];for(const n in e){const r=e[n],o=typeof r;if("string"!==o&&("number"!==o||isNaN(r))&&"boolean"!==o&&null!=r)return e;t.push(`${n}:${o}_${r}`)}return"xSqLiJdLMd9s"+t.join("|")}function mergeClasses(e,t,n){if(!(t instanceof Object))return e;const r={};return objectKeys(e).forEach(o=>r[o]=n(e[o],t[o])),objectKeys(t).forEach(n=>{if(n in e)return;const o=t[n];"string"==typeof o&&(r[n]=o)}),r}const useMuiThemeStyleOverridesPlugin=({classes:e,theme:t,muiStyleOverridesParams:n,css:r,cx:o,name:i})=>{var a,s;if("makeStyle no name"!==i){if(void 0!==n&&void 0===i)throw new Error("To use muiStyleOverridesParams, you must specify a name using .withName('MyComponent')")}else i=void 0;let l;try{l=void 0===i?void 0:(null===(s=null===(a=t.components)||void 0===a?void 0:a[i])||void 0===s?void 0:s.styleOverrides)||void 0}catch(u){}const c=reactExports.useMemo(()=>{if(void 0===l)return;const e={};for(const o in l){const i=l[o];i instanceof Object&&(e[o]=r("function"==typeof i?i({theme:t,ownerState:null==n?void 0:n.ownerState,...null==n?void 0:n.props}):i))}return e},[l,getDependencyArrayRef(null==n?void 0:n.props),getDependencyArrayRef(null==n?void 0:n.ownerState),r]);return{classes:e=reactExports.useMemo(()=>mergeClasses(e,c,o),[e,c,o])}},useContextualCache=__unsafe_useEmotionCache;let counter$1=0;function createMakeStyles(e){const{useTheme:t,cache:n}=e,{useCache:r}=createUseCache({cacheProvidedAtInception:n}),{useCssAndCx:o}=createUseCssAndCx({useCache:r});return{makeStyles:function(e){const{name:n,uniqId:i=""+counter$1++}=null!=e?e:{},a="object"!=typeof n?n:Object.keys(n)[0];return function(e){const n="function"==typeof e?e:()=>e;return function(e,s){const l=t();let{css:c,cx:u}=o();const d=r();let p=reactExports.useMemo(()=>{const t={},r="undefined"!=typeof Proxy&&new Proxy({},{get:(e,n)=>("symbol"==typeof n&&assert(!1),t[n]=`${d.key}-${i}${void 0!==a?`-${a}`:""}-${n}-ref`)}),o=n(l,e,r||{}),s=objectFromEntries(objectKeys(o).map(e=>{const n=o[e];return n.label||(n.label=`${void 0!==a?`${a}-`:""}${e}`),[e,`${c(n)}${typeGuard(e,e in t)?` ${t[e]}`:""}`]}));return objectKeys(t).forEach(e=>{e in s||(s[e]=t[e])}),s},[d,c,u,l,getDependencyArrayRef(e)]);{const e=null==s?void 0:s.props.classes;p=reactExports.useMemo(()=>mergeClasses(p,e,u),[p,getDependencyArrayRef(e),u])}{const e=useMuiThemeStyleOverridesPlugin({classes:p,css:c,cx:u,name:null!=a?a:"makeStyle no name",muiStyleOverridesParams:s,theme:l});void 0!==e.classes&&(p=e.classes),void 0!==e.css&&(c=e.css),void 0!==e.cx&&(u=e.cx)}return{classes:p,theme:l,css:c,cx:u}}}},useStyles:function(){const e=t(),{css:n,cx:r}=o();return{theme:e,css:n,cx:r}}}}const reactContext=reactExports.createContext(void 0),{createUseCache:createUseCache}=(()=>({createUseCache:function(e){const{cacheProvidedAtInception:t}=e;return{useCache:function(){var e;const n=useContextualCache(),r=reactExports.useContext(reactContext),o=null!==(e=null!=t?t:r)&&void 0!==e?e:n;if(null===o)throw new Error(["In order to get SSR working with tss-react you need to explicitly provide an Emotion cache.","MUI users be aware: This is not an error strictly related to tss-react, with or without tss-react,","MUI needs an Emotion cache to be provided for SSR to work.","Here is the MUI documentation related to SSR setup: https://mui.com/material-ui/guides/server-rendering/","TSS provides helper that makes the process of setting up SSR easier: https://docs.tss-react.dev/ssr"].join("\n"));return o}}}}))();function capitalize$1(e){return e.charAt(0).toUpperCase()+e.slice(1)}function createWithStyles(e){const{useTheme:t,cache:n}=e,{makeStyles:r}=createMakeStyles({useTheme:t,cache:n});function o(e,t,n){const o="string"==typeof e?(()=>{const t=e,n=function({children:e,...n}){return reactExports.createElement(t,n,e)};return Object.defineProperty(n,"name",{value:capitalize$1(t)}),n})():e,i=(()=>{{const{name:e}=null!=n?n:{};if(void 0!==e)return"object"!=typeof e?e:Object.keys(e)[0]}let e;{const t=o.displayName;"string"==typeof t&&""!==t&&(e=t)}e:{if(void 0!==e)break e;const t=o.name;"string"==typeof t&&""!==t&&(e=t)}if(void 0!==e)return e=e.replace(/\$/g,"usd"),e=e.replace(/\(/g,"_").replace(/\)/g,"_"),e=e.replace(/[^a-zA-Z0-9-_]/g,"_"),e})(),a=r({...n,name:i})("function"==typeof t?(e,n,r)=>incorporateMediaQueries(t(e,n,r)):incorporateMediaQueries(t));function s(e){for(const t in e)if("root"!==t)return!0;return!1}const l=reactExports.forwardRef(function(t,n){const{className:r,classes:i,...l}=t,{classes:c,cx:u}=a(t,{props:t}),d=u(c.root,r);return fixedClassesByClasses.set(c,{...c,root:d}),React.createElement(o,{ref:n,className:s(c)?r:d,..."string"==typeof e?{}:{classes:c},...l})});return void 0!==i&&(l.displayName=`${capitalize$1(i)}WithStyles`,Object.defineProperty(l,"name",{value:l.displayName})),l}return o.getClasses=getClasses,{withStyles:o}}const fixedClassesByClasses=new WeakMap,errorMessageGetClasses="getClasses should only be used in conjunction with withStyles";function getClasses(e){const t=e.classes;if(void 0===t)throw new Error(errorMessageGetClasses);const n=fixedClassesByClasses.get(t);if(void 0===n)throw new Error(errorMessageGetClasses);return n}function incorporateMediaQueries(e){const t={},n={};return Object.keys(e).forEach(r=>(r.startsWith("@media")?n:t)[r]=e[r]),Object.keys(n).forEach(e=>{const r=n[e];Object.keys(r).forEach(n=>{var o;return t[n]={...null!==(o=t[n])&&void 0!==o?o:{},[e]:r[n]}})}),t}const isSSR=(()=>{const e="object"==typeof document&&"function"==typeof(null===document||void 0===document?void 0:document.getElementById),t="undefined"!=typeof jest,n="undefined"!=typeof mocha,r="undefined"!=typeof __vitest_worker__;return!(e||t||n||r)})();function createTss(e){counter=0,nestedSelectorUsageTrackRecord.splice(0,nestedSelectorUsageTrackRecord.length);const{useContext:t,usePlugin:n,cache:r}=e,{useCache:o}=createUseCache({cacheProvidedAtInception:r}),{useCssAndCx:i}=createUseCssAndCx({useCache:o});return{tss:createTss_internal({useContext:t,useCache:o,useCssAndCx:i,usePlugin:null!=n?n:({classes:e,cx:t,css:n})=>({classes:e,cx:t,css:n}),name:void 0,doesUseNestedSelectors:!1})}}let counter=0;const nestedSelectorUsageTrackRecord=[];function createTss_internal(e){const{useContext:t,useCache:n,useCssAndCx:r,usePlugin:o,name:i,doesUseNestedSelectors:a}=e;return{withParams:()=>createTss_internal({...e}),withName:t=>createTss_internal({...e,name:"object"!=typeof t?t:Object.keys(t)[0]}),withNestedSelectors:()=>createTss_internal({...e,doesUseNestedSelectors:!0}),create:e=>{const s="x"+counter++;if(void 0!==i)for(;;){const e=nestedSelectorUsageTrackRecord.find(e=>e.name===i);if(void 0===e)break;nestedSelectorUsageTrackRecord.splice(nestedSelectorUsageTrackRecord.indexOf(e),1)}const l="function"==typeof e?e:()=>e;return function(c){var u,d,p;const{classesOverrides:h,...f}=null!=c?c:{},A=t(),{css:m,cx:g}=r(),y=n(),v=runGetClassesOrUseCache({cache:y,cssObjectByRuleNameOrGetCssObjectByRuleName:e,classesOverridesRef:getDependencyArrayRef(h),paramsAndPluginParamsRef:getDependencyArrayRef(f),idOfUseStyles:s,context:A,getClasses:()=>{const e={},t=l({...c,...A,...a?{classes:"undefined"==typeof Proxy?{}:new Proxy({},{get:(t,n)=>{if("symbol"==typeof n&&assert(!1),isSSR&&void 0===i)throw new Error(["tss-react: In SSR setups, in order to use nested selectors, you must also give a unique name to the useStyle function.",'Solution: Use tss.withName("ComponentName").withNestedSelectors<...>()... to set a name.'].join("\n"));e:{if(void 0===i)break e;let e=nestedSelectorUsageTrackRecord.find(e=>e.name===i&&e.idOfUseStyles===s);void 0===e&&(e={name:i,idOfUseStyles:s,nestedSelectorRuleNames:new Set},nestedSelectorUsageTrackRecord.push(e)),e.nestedSelectorRuleNames.add(n)}e:{if(void 0===i)break e;if(void 0!==nestedSelectorUsageTrackRecord.find(e=>e.name===i&&e.idOfUseStyles!==s&&e.nestedSelectorRuleNames.has(n)))throw new Error([`tss-react: There are in your codebase two different useStyles named "${i}" that`,`both use use the nested selector ${n}.\n`,"This may lead to CSS class name collisions, causing nested selectors to target elements outside of the intended scope.\n","Solution: Ensure each useStyles using nested selectors has a unique name.\n",'Use: tss.withName("UniqueName").withNestedSelectors<...>()...'].join(" "))}return e[n]=`${y.key}-${void 0!==i?i:s}-${n}-ref`}})}:{}});let n=objectFromEntries(objectKeys(t).map(n=>{const r=t[n];return r.label||(r.label=`${void 0!==i?`${i}-`:""}${n}`),[n,`${m(r)}${typeGuard(n,n in e)?` ${e[n]}`:""}`]}));return objectKeys(e).forEach(t=>{t in n||(n[t]=e[t])}),n=mergeClasses(n,h,g),n}}),b=o({classes:v,css:m,cx:g,idOfUseStyles:s,name:i,...A,...f});return{classes:null!==(u=b.classes)&&void 0!==u?u:v,css:null!==(d=b.css)&&void 0!==d?d:m,cx:null!==(p=b.cx)&&void 0!==p?p:g,...A}}}}}const mapCache=new WeakMap;function runGetClassesOrUseCache(e){const{cache:t,cssObjectByRuleNameOrGetCssObjectByRuleName:n,classesOverridesRef:r,paramsAndPluginParamsRef:o,idOfUseStyles:i,context:a,getClasses:s}=e;e:{const e=mapCache.get(t);if(void 0===e)break e;const s=e.get(n);if(void 0===s)break e;const l=s.get(r);if(void 0===l)break e;const c=l.get(o);if(void 0===c)break e;const u=c.find(({context:e})=>{if(e===a)return!0;if(objectKeys(e).length!==objectKeys(a).length)return!1;for(const t in e)if(getDependencyArrayRef(e[t])!==getDependencyArrayRef(a[t]))return!1;return!0});if(void 0!==u){if((null==u?void 0:u.idOfUseStyles)===i)return u.result;c.splice(c.indexOf(u),1)}}const l=s();{mapCache.has(t)||mapCache.set(t,new WeakMap);const e=mapCache.get(t);assert(void 0!==e),e.has(n)||e.set(n,new Map);const s=e.get(n);assert(void 0!==s),s.has(r)||(s.size>200&&s.clear(),s.set(r,new Map));const c=s.get(r);if(assert(void 0!==c),!c.has(o)){{const e="string"==typeof o?257:5;c.size<e||c.clear()}c.set(o,[])}let u=c.get(o);assert(void 0!==u),u.length>5&&(u=[]),u.push({idOfUseStyles:i,context:a,result:l})}return l}function createMakeAndWithStyles(e){return{...createMakeStyles(e),...createWithStyles(e)}}const{tss:tss}=createTss({useContext:()=>({})});tss.create({});const defaultTheme=createTheme$1(),Box$1=createBox({defaultTheme:defaultTheme,defaultClassName:"MuiBox-root",generateClassName:ClassNameGenerator.generate});function r$1(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r$1(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function clsx(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=r$1(e))&&(r&&(r+=" "),r+=t);return r}function isHostComponent(e){return"string"==typeof e}function appendOwnerState(e,t,n){return void 0===e||isHostComponent(e)?t:_extends({},t,{ownerState:_extends({},t.ownerState,n)})}function extractEventHandlers(e,t=[]){if(void 0===e)return{};const n={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n)).forEach(t=>{n[t]=e[t]}),n}function resolveComponentProps(e,t){return"function"==typeof e?e(t):e}function omitEventHandlers(e){if(void 0===e)return{};const t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t])).forEach(n=>{t[n]=e[n]}),t}function mergeSlotProps(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:i}=e;if(!t){const e=clsx(null==o?void 0:o.className,null==r?void 0:r.className,i,null==n?void 0:n.className),t=_extends({},null==n?void 0:n.style,null==o?void 0:o.style,null==r?void 0:r.style),a=_extends({},n,o,r);return e.length>0&&(a.className=e),Object.keys(t).length>0&&(a.style=t),{props:a,internalRef:void 0}}const a=extractEventHandlers(_extends({},o,r)),s=omitEventHandlers(r),l=omitEventHandlers(o),c=t(a),u=clsx(null==c?void 0:c.className,null==n?void 0:n.className,i,null==o?void 0:o.className,null==r?void 0:r.className),d=_extends({},null==c?void 0:c.style,null==n?void 0:n.style,null==o?void 0:o.style,null==r?void 0:r.style),p=_extends({},c,n,l,s);return u.length>0&&(p.className=u),Object.keys(d).length>0&&(p.style=d),{props:p,internalRef:c.ref}}const _excluded$1w=["elementType","externalSlotProps","ownerState"];function useSlotProps(e){var t;const{elementType:n,externalSlotProps:r,ownerState:o}=e,i=_objectWithoutPropertiesLoose(e,_excluded$1w),a=resolveComponentProps(r,o),{props:s,internalRef:l}=mergeSlotProps(_extends({},i,{externalSlotProps:a}));return appendOwnerState(n,_extends({},s,{ref:useForkRef(l,null==a?void 0:a.ref,null==(t=e.additionalProps)?void 0:t.ref)}),o)}function stripDiacritics(e){return void 0!==e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function createFilterOptions(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:i,trim:a=!1}=e;return(e,{inputValue:s,getOptionLabel:l})=>{let c=a?s.trim():s;n&&(c=c.toLowerCase()),t&&(c=stripDiacritics(c));const u=c?e.filter(e=>{let r=(i||l)(e);return n&&(r=r.toLowerCase()),t&&(r=stripDiacritics(r)),"start"===o?0===r.indexOf(c):r.indexOf(c)>-1}):e;return"number"==typeof r?u.slice(0,r):u}}function findIndex(e,t){for(let n=0;n<e.length;n+=1)if(t(e[n]))return n;return-1}const defaultFilterOptions=createFilterOptions(),pageSize=5,defaultIsActiveElementInListbox=e=>{var t;return null!==e.current&&(null==(t=e.current.parentElement)?void 0:t.contains(document.activeElement))};function useAutocomplete(e){const{unstable_isActiveElementInListbox:t=defaultIsActiveElementInListbox,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:i=!1,blurOnSelect:a=!1,clearOnBlur:s=!e.freeSolo,clearOnEscape:l=!1,componentName:c="useAutocomplete",defaultValue:u=(e.multiple?[]:null),disableClearable:d=!1,disableCloseOnSelect:p=!1,disabled:h,disabledItemsFocusable:f=!1,disableListWrap:A=!1,filterOptions:m=defaultFilterOptions,filterSelectedOptions:g=!1,freeSolo:y=!1,getOptionDisabled:v,getOptionLabel:b=e=>{var t;return null!=(t=e.label)?t:e},groupBy:x,handleHomeEndKeys:w=!e.freeSolo,id:C,includeInputInList:$=!1,inputValue:_,isOptionEqualToValue:S=(e,t)=>e===t,multiple:E=!1,onChange:k,onClose:B,onHighlightChange:P,onInputChange:T,onOpen:I,open:L,openOnFocus:M=!1,options:D,readOnly:N=!1,selectOnFocus:F=!e.freeSolo,value:O}=e,R=useId$2(C);let U=b;U=e=>{const t=b(e);return"string"!=typeof t?String(t):t};const j=reactExports.useRef(!1),H=reactExports.useRef(!0),Q=reactExports.useRef(null),z=reactExports.useRef(null),[V,W]=reactExports.useState(null),[Y,G]=reactExports.useState(-1),K=o?0:-1,q=reactExports.useRef(K),[J,Z]=useControlled({controlled:O,default:u,name:c}),[X,ee]=useControlled({controlled:_,default:"",name:c,state:"inputValue"}),[te,ne]=reactExports.useState(!1),re=reactExports.useCallback((e,t)=>{if(!(E?J.length<t.length:null!==t)&&!s)return;let n;if(E)n="";else if(null==t)n="";else{const e=U(t);n="string"==typeof e?e:""}X!==n&&(ee(n),T&&T(e,n,"reset"))},[U,X,E,T,ee,s,J]),oe=reactExports.useRef();reactExports.useEffect(()=>{const e=J!==oe.current;oe.current=J,te&&!e||y&&!e||re(null,J)},[J,re,te,oe,y]);const[ie,ae]=useControlled({controlled:L,default:!1,name:c,state:"open"}),[se,le]=reactExports.useState(!0),ce=!E&&null!=J&&X===U(J),ue=ie&&!N,de=ue?m(D.filter(e=>!g||!(E?J:[J]).some(t=>null!==t&&S(e,t))),{inputValue:ce&&se?"":X,getOptionLabel:U}):[],pe=ie&&de.length>0&&!N,he=useEventCallback(e=>{-1===e?Q.current.focus():V.querySelector(`[data-tag-index="${e}"]`).focus()});reactExports.useEffect(()=>{E&&Y>J.length-1&&(G(-1),he(-1))},[J,E,Y,he]);const fe=useEventCallback(({event:e,index:t,reason:r="auto"})=>{if(q.current=t,-1===t?Q.current.removeAttribute("aria-activedescendant"):Q.current.setAttribute("aria-activedescendant",`${R}-option-${t}`),P&&P(e,-1===t?null:de[t],r),!z.current)return;const o=z.current.querySelector(`[role="option"].${n}-focused`);o&&(o.classList.remove(`${n}-focused`),o.classList.remove(`${n}-focusVisible`));const i=z.current.parentElement.querySelector('[role="listbox"]');if(!i)return;if(-1===t)return void(i.scrollTop=0);const a=z.current.querySelector(`[data-option-index="${t}"]`);if(a&&(a.classList.add(`${n}-focused`),"keyboard"===r&&a.classList.add(`${n}-focusVisible`),i.scrollHeight>i.clientHeight&&"mouse"!==r)){const e=a,t=i.clientHeight+i.scrollTop,n=e.offsetTop+e.offsetHeight;n>t?i.scrollTop=n-i.clientHeight:e.offsetTop-e.offsetHeight*(x?1.3:0)<i.scrollTop&&(i.scrollTop=e.offsetTop-e.offsetHeight*(x?1.3:0))}}),Ae=useEventCallback(({event:e,diff:t,direction:n="next",reason:o="auto"})=>{if(!ue)return;const i=function(e,t){if(!z.current||-1===e)return-1;let n=e;for(;;){if("next"===t&&n===de.length||"previous"===t&&-1===n)return-1;const e=z.current.querySelector(`[data-option-index="${n}"]`),r=!f&&(!e||e.disabled||"true"===e.getAttribute("aria-disabled"));if(!(e&&!e.hasAttribute("tabindex")||r))return n;n+="next"===t?1:-1}}((()=>{const e=de.length-1;if("reset"===t)return K;if("start"===t)return 0;if("end"===t)return e;const n=q.current+t;return n<0?-1===n&&$?-1:A&&-1!==q.current||Math.abs(t)>1?0:e:n>e?n===e+1&&$?-1:A||Math.abs(t)>1?e:0:n})(),n);if(fe({index:i,reason:o,event:e}),r&&"reset"!==t)if(-1===i)Q.current.value=X;else{const e=U(de[i]);Q.current.value=e;0===e.toLowerCase().indexOf(X.toLowerCase())&&X.length>0&&Q.current.setSelectionRange(X.length,e.length)}}),me=reactExports.useCallback(()=>{if(!ue)return;const e=E?J[0]:J;if(0!==de.length&&null!=e){if(z.current){if(null!=e){const t=de[q.current];if(E&&t&&-1!==findIndex(J,e=>S(t,e)))return;const n=findIndex(de,t=>S(t,e));return void(-1===n?Ae({diff:"reset"}):fe({index:n}))}q.current>=de.length-1?fe({index:de.length-1}):fe({index:q.current})}}else Ae({diff:"reset"})},[de.length,!E&&J,g,Ae,fe,ue,X,E]),ge=useEventCallback(e=>{setRef(z,e),e&&me()});reactExports.useEffect(()=>{me()},[me]);const ye=e=>{ie||(ae(!0),le(!0),I&&I(e))},ve=(e,t)=>{ie&&(ae(!1),B&&B(e,t))},be=(e,t,n,r)=>{if(E){if(J.length===t.length&&J.every((e,n)=>e===t[n]))return}else if(J===t)return;k&&k(e,t,n,r),Z(t)},xe=reactExports.useRef(!1),we=(e,t,n="selectOption",r="options")=>{let o=n,i=t;if(E){i=Array.isArray(J)?J.slice():[];const e=findIndex(i,e=>S(t,e));-1===e?i.push(t):"freeSolo"!==r&&(i.splice(e,1),o="removeOption")}re(e,i),be(e,i,o,{option:t}),p||e&&(e.ctrlKey||e.metaKey)||ve(e,o),(!0===a||"touch"===a&&xe.current||"mouse"===a&&!xe.current)&&Q.current.blur()};const Ce=(e,t)=>{if(!E)return;""===X&&ve(e,"toggleInput");let n=Y;-1===Y?""===X&&"previous"===t&&(n=J.length-1):(n+="next"===t?1:-1,n<0&&(n=0),n===J.length&&(n=-1)),n=function(e,t){if(-1===e)return-1;let n=e;for(;;){if("next"===t&&n===J.length||"previous"===t&&-1===n)return-1;const e=V.querySelector(`[data-tag-index="${n}"]`);if(e&&e.hasAttribute("tabindex")&&!e.disabled&&"true"!==e.getAttribute("aria-disabled"))return n;n+="next"===t?1:-1}}(n,t),G(n),he(n)},$e=e=>{j.current=!0,ee(""),T&&T(e,"","clear"),be(e,E?[]:null,"clear")},_e=e=>t=>{if(e.onKeyDown&&e.onKeyDown(t),!t.defaultMuiPrevented&&(-1!==Y&&-1===["ArrowLeft","ArrowRight"].indexOf(t.key)&&(G(-1),he(-1)),229!==t.which))switch(t.key){case"Home":ue&&w&&(t.preventDefault(),Ae({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":ue&&w&&(t.preventDefault(),Ae({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),Ae({diff:-pageSize,direction:"previous",reason:"keyboard",event:t}),ye(t);break;case"PageDown":t.preventDefault(),Ae({diff:pageSize,direction:"next",reason:"keyboard",event:t}),ye(t);break;case"ArrowDown":t.preventDefault(),Ae({diff:1,direction:"next",reason:"keyboard",event:t}),ye(t);break;case"ArrowUp":t.preventDefault(),Ae({diff:-1,direction:"previous",reason:"keyboard",event:t}),ye(t);break;case"ArrowLeft":Ce(t,"previous");break;case"ArrowRight":Ce(t,"next");break;case"Enter":if(-1!==q.current&&ue){const e=de[q.current],n=!!v&&v(e);if(t.preventDefault(),n)return;we(t,e,"selectOption"),r&&Q.current.setSelectionRange(Q.current.value.length,Q.current.value.length)}else y&&""!==X&&!1===ce&&(E&&t.preventDefault(),we(t,X,"createOption","freeSolo"));break;case"Escape":ue?(t.preventDefault(),t.stopPropagation(),ve(t,"escape")):l&&(""!==X||E&&J.length>0)&&(t.preventDefault(),t.stopPropagation(),$e(t));break;case"Backspace":if(E&&!N&&""===X&&J.length>0){const e=-1===Y?J.length-1:Y,n=J.slice();n.splice(e,1),be(t,n,"removeOption",{option:J[e]})}break;case"Delete":if(E&&!N&&""===X&&J.length>0&&-1!==Y){const e=Y,n=J.slice();n.splice(e,1),be(t,n,"removeOption",{option:J[e]})}}},Se=e=>{ne(!0),M&&!j.current&&ye(e)},Ee=e=>{t(z)?Q.current.focus():(ne(!1),H.current=!0,j.current=!1,i&&-1!==q.current&&ue?we(e,de[q.current],"blur"):i&&y&&""!==X?we(e,X,"blur","freeSolo"):s&&re(e,J),ve(e,"blur"))},ke=e=>{const t=e.target.value;X!==t&&(ee(t),le(!1),T&&T(e,t,"input")),""===t?d||E||be(e,null,"clear"):ye(e)},Be=e=>{fe({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"mouse"})},Pe=()=>{xe.current=!0},Te=e=>{const t=Number(e.currentTarget.getAttribute("data-option-index"));we(e,de[t],"selectOption"),xe.current=!1},Ie=e=>t=>{const n=J.slice();n.splice(e,1),be(t,n,"removeOption",{option:J[e]})},Le=e=>{ie?ve(e,"toggleInput"):ye(e)},Me=e=>{e.target.getAttribute("id")!==R&&e.preventDefault()},De=()=>{Q.current.focus(),F&&H.current&&Q.current.selectionEnd-Q.current.selectionStart===0&&Q.current.select(),H.current=!1},Ne=e=>{""!==X&&ie||Le(e)};let Fe=y&&X.length>0;Fe=Fe||(E?J.length>0:null!==J);let Oe=de;return x&&(Oe=de.reduce((e,t,n)=>{const r=x(t);return e.length>0&&e[e.length-1].group===r?e[e.length-1].options.push(t):e.push({key:n,index:n,group:r,options:[t]}),e},[])),h&&te&&Ee(),{getRootProps:(e={})=>_extends({"aria-owns":pe?`${R}-listbox`:null},e,{onKeyDown:_e(e),onMouseDown:Me,onClick:De}),getInputLabelProps:()=>({id:`${R}-label`,htmlFor:R}),getInputProps:()=>({id:R,value:X,onBlur:Ee,onFocus:Se,onChange:ke,onMouseDown:Ne,"aria-activedescendant":ue?"":null,"aria-autocomplete":r?"both":"list","aria-controls":pe?`${R}-listbox`:void 0,"aria-expanded":pe,autoComplete:"off",ref:Q,autoCapitalize:"none",spellCheck:"false",role:"combobox"}),getClearProps:()=>({tabIndex:-1,onClick:$e}),getPopupIndicatorProps:()=>({tabIndex:-1,onClick:Le}),getTagProps:({index:e})=>_extends({key:e,"data-tag-index":e,tabIndex:-1},!N&&{onDelete:Ie(e)}),getListboxProps:()=>({role:"listbox",id:`${R}-listbox`,"aria-labelledby":`${R}-label`,ref:ge,onMouseDown:e=>{e.preventDefault()}}),getOptionProps:({index:e,option:t})=>{const n=(E?J:[J]).some(e=>null!=e&&S(t,e)),r=!!v&&v(t);return{key:U(t),tabIndex:-1,role:"option",id:`${R}-option-${e}`,onMouseOver:Be,onClick:Te,onTouchStart:Pe,"data-option-index":e,"aria-disabled":r,"aria-selected":n}},id:R,inputValue:X,value:J,dirty:Fe,popupOpen:ue,focused:te||-1!==Y,anchorEl:V,setAnchorEl:W,focusedTag:Y,groupedOptions:Oe}}function useBadge(e){const{badgeContent:t,invisible:n=!1,max:r=99,showZero:o=!1}=e,i=usePreviousProps({badgeContent:t,max:r});let a=n;!1!==n||0!==t||o||(a=!0);const{badgeContent:s,max:l=r}=a?i:e;return{badgeContent:s,invisible:a,max:l,displayValue:s&&Number(s)>l?`${l}+`:s}}function getBadgeUnstyledUtilityClass(e){return generateUtilityClass("MuiBadge",e)}generateUtilityClasses("MuiBadge",["root","badge","invisible"]);const _excluded$1v=["badgeContent","component","children","invisible","max","slotProps","slots","showZero"],useUtilityClasses$1f=e=>{const{invisible:t}=e;return composeClasses({root:["root"],badge:["badge",t&&"invisible"]},getBadgeUnstyledUtilityClass,void 0)},BadgeUnstyled=reactExports.forwardRef(function(e,t){const{component:n,children:r,max:o=99,slotProps:i={},slots:a={},showZero:s=!1}=e,l=_objectWithoutPropertiesLoose(e,_excluded$1v),{badgeContent:c,max:u,displayValue:d,invisible:p}=useBadge(_extends({},e,{max:o})),h=_extends({},e,{badgeContent:c,invisible:p,max:u,showZero:s}),f=useUtilityClasses$1f(h),A=n||a.root||"span",m=useSlotProps({elementType:A,externalSlotProps:i.root,externalForwardedProps:l,additionalProps:{ref:t},ownerState:h,className:f.root}),g=a.badge||"span",y=useSlotProps({elementType:g,externalSlotProps:i.badge,ownerState:h,className:f.badge});return factory$1(A,_extends({},m,{children:[r,factory$1(g,_extends({},y,{children:d}))]}))});function mapEventPropToEvent(e){return e.substring(2).toLowerCase()}function clickedRootScrollbar(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function ClickAwayListener(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:o,touchEvent:i="onTouchEnd"}=e,a=reactExports.useRef(!1),s=reactExports.useRef(null),l=reactExports.useRef(!1),c=reactExports.useRef(!1);reactExports.useEffect(()=>(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=useForkRef(t.ref,s),d=useEventCallback(e=>{const t=c.current;c.current=!1;const r=ownerDocument(s.current);if(!l.current||!s.current||"clientX"in e&&clickedRootScrollbar(e,r))return;if(a.current)return void(a.current=!1);let i;i=e.composedPath?e.composedPath().indexOf(s.current)>-1:!r.documentElement.contains(e.target)||s.current.contains(e.target),i||!n&&t||o(e)}),p=e=>n=>{c.current=!0;const r=t.props[e];r&&r(n)},h={ref:u};return!1!==i&&(h[i]=p(i)),reactExports.useEffect(()=>{if(!1!==i){const e=mapEventPropToEvent(i),t=ownerDocument(s.current),n=()=>{a.current=!0};return t.addEventListener(e,d),t.addEventListener("touchmove",n),()=>{t.removeEventListener(e,d),t.removeEventListener("touchmove",n)}}},[d,i]),!1!==r&&(h[r]=p(r)),reactExports.useEffect(()=>{if(!1!==r){const e=mapEventPropToEvent(r),t=ownerDocument(s.current);return t.addEventListener(e,d),()=>{t.removeEventListener(e,d)}}},[d,r]),factory$1(reactExports.Fragment,{children:reactExports.cloneElement(t,h)})}const candidatesSelector=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function getTabIndex(e){const t=parseInt(e.getAttribute("tabindex"),10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}function isNonTabbableRadio(e){if("INPUT"!==e.tagName||"radio"!==e.type)return!1;if(!e.name)return!1;const t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function isNodeMatchingSelectorFocusable(e){return!(e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||isNonTabbableRadio(e))}function defaultGetTabbable(e){const t=[],n=[];return Array.from(e.querySelectorAll(candidatesSelector)).forEach((e,r)=>{const o=getTabIndex(e);-1!==o&&isNodeMatchingSelectorFocusable(e)&&(0===o?t.push(e):n.push({documentOrder:r,tabIndex:o,node:e}))}),n.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function defaultIsEnabled(){return!0}function FocusTrap$1(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:i=defaultGetTabbable,isEnabled:a=defaultIsEnabled,open:s}=e,l=reactExports.useRef(),c=reactExports.useRef(null),u=reactExports.useRef(null),d=reactExports.useRef(null),p=reactExports.useRef(null),h=reactExports.useRef(!1),f=reactExports.useRef(null),A=useForkRef(t.ref,f),m=reactExports.useRef(null);reactExports.useEffect(()=>{s&&f.current&&(h.current=!n)},[n,s]),reactExports.useEffect(()=>{if(!s||!f.current)return;const e=ownerDocument(f.current);return f.current.contains(e.activeElement)||(f.current.hasAttribute("tabIndex")||f.current.setAttribute("tabIndex",-1),h.current&&f.current.focus()),()=>{o||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[s]),reactExports.useEffect(()=>{if(!s||!f.current)return;const e=ownerDocument(f.current),t=t=>{const{current:n}=f;if(null!==n)if(e.hasFocus()&&!r&&a()&&!l.current){if(!n.contains(e.activeElement)){if(t&&p.current!==t.target||e.activeElement!==p.current)p.current=null;else if(null!==p.current)return;if(!h.current)return;let r=[];if(e.activeElement!==c.current&&e.activeElement!==u.current||(r=i(f.current)),r.length>0){var o,s;const e=Boolean((null==(o=m.current)?void 0:o.shiftKey)&&"Tab"===(null==(s=m.current)?void 0:s.key)),t=r[0],n=r[r.length-1];e?n.focus():t.focus()}else n.focus()}}else l.current=!1},n=t=>{m.current=t,!r&&a()&&"Tab"===t.key&&e.activeElement===f.current&&t.shiftKey&&(l.current=!0,u.current.focus())};e.addEventListener("focusin",t),e.addEventListener("keydown",n,!0);const o=setInterval(()=>{"BODY"===e.activeElement.tagName&&t()},50);return()=>{clearInterval(o),e.removeEventListener("focusin",t),e.removeEventListener("keydown",n,!0)}},[n,r,o,a,s,i]);const g=e=>{null===d.current&&(d.current=e.relatedTarget),h.current=!0};return factory$1(reactExports.Fragment,{children:[factory$1("div",{tabIndex:s?0:-1,onFocus:g,ref:c,"data-testid":"sentinelStart"}),reactExports.cloneElement(t,{ref:A,onFocus:e=>{null===d.current&&(d.current=e.relatedTarget),h.current=!0,p.current=e.target;const n=t.props.onFocus;n&&n(e)}}),factory$1("div",{tabIndex:s?0:-1,onFocus:g,ref:u,"data-testid":"sentinelEnd"})]})}var top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference$1="reference",variationPlacements=basePlacements.reduce(function(e,t){return e.concat([t+"-"+start,t+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(e,t){return e.concat([t,t+"-"+start,t+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName$1(e){return e?(e.nodeName||"").toLowerCase():null}function getWindow$1(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function isElement$3(e){return e instanceof getWindow$1(e).Element||e instanceof Element}function isHTMLElement$1(e){return e instanceof getWindow$1(e).HTMLElement||e instanceof HTMLElement}function isShadowRoot$1(e){return"undefined"!=typeof ShadowRoot&&(e instanceof getWindow$1(e).ShadowRoot||e instanceof ShadowRoot)}function applyStyles(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];isHTMLElement$1(o)&&getNodeName$1(o)&&(Object.assign(o.style,n),Object.keys(r).forEach(function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})}function effect$2(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});isHTMLElement$1(r)&&getNodeName$1(r)&&(Object.assign(r.style,i),Object.keys(o).forEach(function(e){r.removeAttribute(e)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(e){return e.split("-")[0]}var max$4=Math.max,min$3=Math.min,round$5=Math.round;function getUAString(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect$1(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&isHTMLElement$1(e)&&(o=e.offsetWidth>0&&round$5(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&round$5(r.height)/e.offsetHeight||1);var a=(isElement$3(e)?getWindow$1(e):window).visualViewport,s=!isLayoutViewport()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/o,c=(r.top+(s&&a?a.offsetTop:0))/i,u=r.width/o,d=r.height/i;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l,x:l,y:c}}function getLayoutRect(e){var t=getBoundingClientRect$1(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function contains(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&isShadowRoot$1(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function getComputedStyle$3(e){return getWindow$1(e).getComputedStyle(e)}function isTableElement$1(e){return["table","td","th"].indexOf(getNodeName$1(e))>=0}function getDocumentElement$1(e){return((isElement$3(e)?e.ownerDocument:e.document)||window.document).documentElement}function getParentNode$1(e){return"html"===getNodeName$1(e)?e:e.assignedSlot||e.parentNode||(isShadowRoot$1(e)?e.host:null)||getDocumentElement$1(e)}function getTrueOffsetParent$1(e){return isHTMLElement$1(e)&&"fixed"!==getComputedStyle$3(e).position?e.offsetParent:null}function getContainingBlock$1(e){var t=/firefox/i.test(getUAString());if(/Trident/i.test(getUAString())&&isHTMLElement$1(e)&&"fixed"===getComputedStyle$3(e).position)return null;var n=getParentNode$1(e);for(isShadowRoot$1(n)&&(n=n.host);isHTMLElement$1(n)&&["html","body"].indexOf(getNodeName$1(n))<0;){var r=getComputedStyle$3(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}function getOffsetParent$1(e){for(var t=getWindow$1(e),n=getTrueOffsetParent$1(e);n&&isTableElement$1(n)&&"static"===getComputedStyle$3(n).position;)n=getTrueOffsetParent$1(n);return n&&("html"===getNodeName$1(n)||"body"===getNodeName$1(n)&&"static"===getComputedStyle$3(n).position)?t:n||getContainingBlock$1(e)||t}function getMainAxisFromPlacement(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function within(e,t,n){return max$4(e,min$3(t,n))}function withinMaxClamp(e,t,n){var r=within(e,t,n);return r>n?n:r}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(e){return Object.assign({},getFreshSideObject(),e)}function expandToHashMap(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var toPaddingObject=function(e,t){return mergePaddingObject("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:expandToHashMap(e,basePlacements))};function arrow$4(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=getBasePlacement(n.placement),l=getMainAxisFromPlacement(s),c=[left,right].indexOf(s)>=0?"height":"width";if(i&&a){var u=toPaddingObject(o.padding,n),d=getLayoutRect(i),p="y"===l?top:left,h="y"===l?bottom:right,f=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],A=a[l]-n.rects.reference[l],m=getOffsetParent$1(i),g=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,y=f/2-A/2,v=u[p],b=g-d[c]-u[h],x=g/2-d[c]/2+y,w=within(v,x,b),C=l;n.modifiersData[r]=((t={})[C]=w,t.centerOffset=w-x,t)}}function effect$1(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&contains(t.elements.popper,r)&&(t.elements.arrow=r)}const arrow$5={name:"arrow",enabled:!0,phase:"main",fn:arrow$4,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(e){return e.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:round$5(n*o)/o||0,y:round$5(r*o)/o||0}}function mapToStyles(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,p=a.x,h=void 0===p?0:p,f=a.y,A=void 0===f?0:f,m="function"==typeof u?u({x:h,y:A}):{x:h,y:A};h=m.x,A=m.y;var g=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),v=left,b=top,x=window;if(c){var w=getOffsetParent$1(n),C="clientHeight",$="clientWidth";if(w===getWindow$1(n)&&"static"!==getComputedStyle$3(w=getDocumentElement$1(n)).position&&"absolute"===s&&(C="scrollHeight",$="scrollWidth"),o===top||(o===left||o===right)&&i===end)b=bottom,A-=(d&&w===x&&x.visualViewport?x.visualViewport.height:w[C])-r.height,A*=l?1:-1;if(o===left||(o===top||o===bottom)&&i===end)v=right,h-=(d&&w===x&&x.visualViewport?x.visualViewport.width:w[$])-r.width,h*=l?1:-1}var _,S=Object.assign({position:s},c&&unsetSides),E=!0===u?roundOffsetsByDPR({x:h,y:A},getWindow$1(n)):{x:h,y:A};return h=E.x,A=E.y,l?Object.assign({},S,((_={})[b]=y?"0":"",_[v]=g?"0":"",_.transform=(x.devicePixelRatio||1)<=1?"translate("+h+"px, "+A+"px)":"translate3d("+h+"px, "+A+"px, 0)",_)):Object.assign({},S,((t={})[b]=y?A+"px":"",t[v]=g?h+"px":"",t.transform="",t))}function computeStyles(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,l=void 0===s||s,c={placement:getBasePlacement(t.placement),variation:getVariation(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,mapToStyles(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,mapToStyles(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,s=void 0===a||a,l=getWindow$1(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(e){e.addEventListener("scroll",n.update,passive)}),s&&l.addEventListener("resize",n.update,passive),function(){i&&c.forEach(function(e){e.removeEventListener("scroll",n.update,passive)}),s&&l.removeEventListener("resize",n.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement$1(e){return e.replace(/left|right|bottom|top/g,function(e){return hash$1[e]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(e){return e.replace(/start|end/g,function(e){return hash[e]})}function getWindowScroll(e){var t=getWindow$1(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function getWindowScrollBarX$1(e){return getBoundingClientRect$1(getDocumentElement$1(e)).left+getWindowScroll(e).scrollLeft}function getViewportRect$1(e,t){var n=getWindow$1(e),r=getDocumentElement$1(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var c=isLayoutViewport();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+getWindowScrollBarX$1(e),y:l}}function getDocumentRect$1(e){var t,n=getDocumentElement$1(e),r=getWindowScroll(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=max$4(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=max$4(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+getWindowScrollBarX$1(e),l=-r.scrollTop;return"rtl"===getComputedStyle$3(o||n).direction&&(s+=max$4(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}function isScrollParent(e){var t=getComputedStyle$3(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function getScrollParent(e){return["html","body","#document"].indexOf(getNodeName$1(e))>=0?e.ownerDocument.body:isHTMLElement$1(e)&&isScrollParent(e)?e:getScrollParent(getParentNode$1(e))}function listScrollParents(e,t){var n;void 0===t&&(t=[]);var r=getScrollParent(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=getWindow$1(r),a=o?[i].concat(i.visualViewport||[],isScrollParent(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(listScrollParents(getParentNode$1(a)))}function rectToClientRect$1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function getInnerBoundingClientRect$1(e,t){var n=getBoundingClientRect$1(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function getClientRectFromMixedType(e,t,n){return t===viewport?rectToClientRect$1(getViewportRect$1(e,n)):isElement$3(t)?getInnerBoundingClientRect$1(t,n):rectToClientRect$1(getDocumentRect$1(getDocumentElement$1(e)))}function getClippingParents(e){var t=listScrollParents(getParentNode$1(e)),n=["absolute","fixed"].indexOf(getComputedStyle$3(e).position)>=0&&isHTMLElement$1(e)?getOffsetParent$1(e):e;return isElement$3(n)?t.filter(function(e){return isElement$3(e)&&contains(e,n)&&"body"!==getNodeName$1(e)}):[]}function getClippingRect$1(e,t,n,r){var o="clippingParents"===t?getClippingParents(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce(function(t,n){var o=getClientRectFromMixedType(e,n,r);return t.top=max$4(o.top,t.top),t.right=min$3(o.right,t.right),t.bottom=min$3(o.bottom,t.bottom),t.left=max$4(o.left,t.left),t},getClientRectFromMixedType(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function computeOffsets(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?getBasePlacement(o):null,a=o?getVariation(o):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case top:t={x:s,y:n.y-r.height};break;case bottom:t={x:s,y:n.y+n.height};break;case right:t={x:n.x+n.width,y:l};break;case left:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?getMainAxisFromPlacement(i):null;if(null!=c){var u="y"===c?"height":"width";switch(a){case start:t[c]=t[c]-(n[u]/2-r[u]/2);break;case end:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}function detectOverflow$1(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,a=void 0===i?e.strategy:i,s=n.boundary,l=void 0===s?clippingParents:s,c=n.rootBoundary,u=void 0===c?viewport:c,d=n.elementContext,p=void 0===d?popper:d,h=n.altBoundary,f=void 0!==h&&h,A=n.padding,m=void 0===A?0:A,g=mergePaddingObject("number"!=typeof m?m:expandToHashMap(m,basePlacements)),y=p===popper?reference$1:popper,v=e.rects.popper,b=e.elements[f?y:p],x=getClippingRect$1(isElement$3(b)?b:b.contextElement||getDocumentElement$1(e.elements.popper),l,u,a),w=getBoundingClientRect$1(e.elements.reference),C=computeOffsets({reference:w,element:v,placement:o}),$=rectToClientRect$1(Object.assign({},v,C)),_=p===popper?$:w,S={top:x.top-_.top+g.top,bottom:_.bottom-x.bottom+g.bottom,left:x.left-_.left+g.left,right:_.right-x.right+g.right},E=e.modifiersData.offset;if(p===popper&&E){var k=E[o];Object.keys(S).forEach(function(e){var t=[right,bottom].indexOf(e)>=0?1:-1,n=[top,bottom].indexOf(e)>=0?"y":"x";S[e]+=k[n]*t})}return S}function computeAutoPlacement(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?placements:l,u=getVariation(r),d=u?s?variationPlacements:variationPlacements.filter(function(e){return getVariation(e)===u}):basePlacements,p=d.filter(function(e){return c.indexOf(e)>=0});0===p.length&&(p=d);var h=p.reduce(function(t,n){return t[n]=detectOverflow$1(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[getBasePlacement(n)],t},{});return Object.keys(h).sort(function(e,t){return h[e]-h[t]})}function getExpandedFallbackPlacements(e){if(getBasePlacement(e)===auto)return[];var t=getOppositePlacement$1(e);return[getOppositeVariationPlacement(e),t,getOppositeVariationPlacement(t)]}function flip$3(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,A=n.allowedAutoPlacements,m=t.options.placement,g=getBasePlacement(m),y=l||(g===m||!f?[getOppositePlacement$1(m)]:getExpandedFallbackPlacements(m)),v=[m].concat(y).reduce(function(e,n){return e.concat(getBasePlacement(n)===auto?computeAutoPlacement(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:f,allowedAutoPlacements:A}):n)},[]),b=t.rects.reference,x=t.rects.popper,w=new Map,C=!0,$=v[0],_=0;_<v.length;_++){var S=v[_],E=getBasePlacement(S),k=getVariation(S)===start,B=[top,bottom].indexOf(E)>=0,P=B?"width":"height",T=detectOverflow$1(t,{placement:S,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),I=B?k?right:left:k?bottom:top;b[P]>x[P]&&(I=getOppositePlacement$1(I));var L=getOppositePlacement$1(I),M=[];if(i&&M.push(T[E]<=0),s&&M.push(T[I]<=0,T[L]<=0),M.every(function(e){return e})){$=S,C=!1;break}w.set(S,M)}if(C)for(var D=function(e){var t=v.find(function(t){var n=w.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return $=t,"break"},N=f?3:1;N>0;N--){if("break"===D(N))break}t.placement!==$&&(t.modifiersData[r]._skip=!0,t.placement=$,t.reset=!0)}}const flip$4={name:"flip",enabled:!0,phase:"main",fn:flip$3,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function isAnySideFullyClipped(e){return[top,right,bottom,left].some(function(t){return e[t]>=0})}function hide(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=detectOverflow$1(t,{elementContext:"reference"}),s=detectOverflow$1(t,{altBoundary:!0}),l=getSideOffsets(a,r),c=getSideOffsets(s,o,i),u=isAnySideFullyClipped(l),d=isAnySideFullyClipped(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(e,t,n){var r=getBasePlacement(e),o=[left,top].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[left,right].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function offset$3(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=placements.reduce(function(e,n){return e[n]=distanceAndSkiddingToXY(n,t.rects,i),e},{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}const offset$4={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset$3};function popperOffsets(e){var t=e.state,n=e.name;t.modifiersData[n]=computeOffsets({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(e){return"x"===e?"y":"x"}function preventOverflow(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,h=void 0===p||p,f=n.tetherOffset,A=void 0===f?0:f,m=detectOverflow$1(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),g=getBasePlacement(t.placement),y=getVariation(t.placement),v=!y,b=getMainAxisFromPlacement(g),x=getAltAxis(b),w=t.modifiersData.popperOffsets,C=t.rects.reference,$=t.rects.popper,_="function"==typeof A?A(Object.assign({},t.rects,{placement:t.placement})):A,S="number"==typeof _?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),E=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(w){if(i){var B,P="y"===b?top:left,T="y"===b?bottom:right,I="y"===b?"height":"width",L=w[b],M=L+m[P],D=L-m[T],N=h?-$[I]/2:0,F=y===start?C[I]:$[I],O=y===start?-$[I]:-C[I],R=t.elements.arrow,U=h&&R?getLayoutRect(R):{width:0,height:0},j=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:getFreshSideObject(),H=j[P],Q=j[T],z=within(0,C[I],U[I]),V=v?C[I]/2-N-z-H-S.mainAxis:F-z-H-S.mainAxis,W=v?-C[I]/2+N+z+Q+S.mainAxis:O+z+Q+S.mainAxis,Y=t.elements.arrow&&getOffsetParent$1(t.elements.arrow),G=Y?"y"===b?Y.clientTop||0:Y.clientLeft||0:0,K=null!=(B=null==E?void 0:E[b])?B:0,q=L+W-K,J=within(h?min$3(M,L+V-K-G):M,L,h?max$4(D,q):D);w[b]=J,k[b]=J-L}if(s){var Z,X="x"===b?top:left,ee="x"===b?bottom:right,te=w[x],ne="y"===x?"height":"width",re=te+m[X],oe=te-m[ee],ie=-1!==[top,left].indexOf(g),ae=null!=(Z=null==E?void 0:E[x])?Z:0,se=ie?re:te-C[ne]-$[ne]-ae+S.altAxis,le=ie?te+C[ne]+$[ne]-ae-S.altAxis:oe,ce=h&&ie?withinMaxClamp(se,te,le):within(h?se:re,te,h?le:oe);w[x]=ce,k[x]=ce-te}t.modifiersData[r]=k}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function getNodeScroll$1(e){return e!==getWindow$1(e)&&isHTMLElement$1(e)?getHTMLElementScroll(e):getWindowScroll(e)}function isElementScaled(e){var t=e.getBoundingClientRect(),n=round$5(t.width)/e.offsetWidth||1,r=round$5(t.height)/e.offsetHeight||1;return 1!==n||1!==r}function getCompositeRect(e,t,n){void 0===n&&(n=!1);var r=isHTMLElement$1(t),o=isHTMLElement$1(t)&&isElementScaled(t),i=getDocumentElement$1(t),a=getBoundingClientRect$1(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(("body"!==getNodeName$1(t)||isScrollParent(i))&&(s=getNodeScroll$1(t)),isHTMLElement$1(t)?((l=getBoundingClientRect$1(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=getWindowScrollBarX$1(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function order(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}}),r.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){n.has(e.name)||o(e)}),r}function orderModifiers(e){var t=order(e);return modifierPhases.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function debounce$1(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function mergeByName(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var DEFAULT_OPTIONS$1={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function popperGenerator(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?DEFAULT_OPTIONS$1:o;return function(e,t,n){void 0===n&&(n=i);var o={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS$1,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],s=!1,l={state:o,setOptions:function(n){var s="function"==typeof n?n(o.options):n;c(),o.options=Object.assign({},i,o.options,s),o.scrollParents={reference:isElement$3(e)?listScrollParents(e):e.contextElement?listScrollParents(e.contextElement):[],popper:listScrollParents(t)};var u=orderModifiers(mergeByName([].concat(r,o.options.modifiers)));return o.orderedModifiers=u.filter(function(e){return e.enabled}),o.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var s=i({state:o,name:t,instance:l,options:r}),c=function(){};a.push(s||c)}}),l.update()},forceUpdate:function(){if(!s){var e=o.elements,t=e.reference,n=e.popper;if(areValidElements(t,n)){o.rects={reference:getCompositeRect(t,getOffsetParent$1(n),"fixed"===o.options.strategy),popper:getLayoutRect(n)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach(function(e){return o.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<o.orderedModifiers.length;r++)if(!0!==o.reset){var i=o.orderedModifiers[r],a=i.fn,c=i.options,u=void 0===c?{}:c,d=i.name;"function"==typeof a&&(o=a({state:o,options:u,name:d,instance:l})||o)}else o.reset=!1,r=-1}}},update:debounce$1(function(){return new Promise(function(e){l.forceUpdate(),e(o)})}),destroy:function(){c(),s=!0}};if(!areValidElements(e,t))return l;function c(){a.forEach(function(e){return e()}),a=[]}return l.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)}),l}}var defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$4,flip$4,preventOverflow$1,arrow$5,hide$1],createPopper=popperGenerator({defaultModifiers:defaultModifiers}),reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -207,7 +207,7 @@ function round$3(e){return e+.5|0}Translate.install({},t$1,{rawCondition:e=>/[Ё
|
|
|
207
207
|
* https://www.chartjs.org
|
|
208
208
|
* (c) 2023 Chart.js Contributors
|
|
209
209
|
* Released under the MIT License
|
|
210
|
-
*/class Animator{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){const o=t.listeners[r],i=t.duration;o.forEach(r=>r({chart:e,initial:t.initial,numSteps:i,currentStep:Math.min(n-t.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;const o=n.items;let i,a=o.length-1,s=!1;for(;a>=0;--a)i=o[a],i._active?(i._total>n.duration&&(n.duration=i._total),i.tick(e),s=!0):(o[a]=o[o.length-1],o.pop());s&&(r.draw(),this._notify(r,n,e,"progress")),o.length||(n.running=!1,this._notify(r,n,e,"complete"),n.initial=!1),t+=o.length}),this._lastDate=e,0===t&&(this._running=!1)}_getAnims(e){const t=this._charts;let n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const n=t.items;let r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var animator=new Animator;const transparent="transparent",interpolators={boolean:(e,t,n)=>n>.5?t:e,color(e,t,n){const r=color(e||transparent),o=r.valid&&color(t||transparent);return o&&o.valid?o.mix(r,n).hexString():t},number:(e,t,n)=>e+(t-e)*n};class Animation{constructor(e,t,n,r){const o=t[n];r=resolve$3([e.to,r,o,e.from]);const i=resolve$3([e.from,o,r]);this._active=!0,this._fn=e.fn||interpolators[e.type||typeof i],this._easing=effects[e.easing]||effects.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=i,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);const r=this._target[this._prop],o=n-this._start,i=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(i,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=resolve$3([e.to,t,r,e.from]),this._from=resolve$3([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,n=this._duration,r=this._prop,o=this._from,i=this._loop,a=this._to;let s;if(this._active=o!==a&&(i||t<n),!this._active)return this._target[r]=a,void this._notify(!0);t<0?this._target[r]=o:(s=t/n%2,s=i&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(o,a,s))}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){const t=e?"res":"rej",n=this._promises||[];for(let r=0;r<n.length;r++)n[r][t]()}}class Animations{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!isObject$3(e))return;const t=Object.keys(defaults$2.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{const o=e[r];if(!isObject$3(o))return;const i={};for(const e of t)i[e]=o[e];(isArray$4(o.properties)&&o.properties||[r]).forEach(e=>{e!==r&&n.has(e)||n.set(e,i)})})}_animateOptions(e,t){const n=t.options,r=resolveTargetOptions(e,n);if(!r)return[];const o=this._createAnimations(r,n);return n.$shared&&awaitAll(e.options.$animations,n).then(()=>{e.options=n},()=>{}),o}_createAnimations(e,t){const n=this._properties,r=[],o=e.$animations||(e.$animations={}),i=Object.keys(t),a=Date.now();let s;for(s=i.length-1;s>=0;--s){const l=i[s];if("$"===l.charAt(0))continue;if("options"===l){r.push(...this._animateOptions(e,t));continue}const c=t[l];let u=o[l];const d=n.get(l);if(u){if(d&&u.active()){u.update(d,c,a);continue}u.cancel()}d&&d.duration?(o[l]=u=new Animation(d,e,l,c),r.push(u)):e[l]=c}return r}update(e,t){if(0===this._properties.size)return void Object.assign(e,t);const n=this._createAnimations(e,t);return n.length?(animator.add(this._chart,n),!0):void 0}}function awaitAll(e,t){const n=[],r=Object.keys(t);for(let o=0;o<r.length;o++){const t=e[r[o]];t&&t.active()&&n.push(t.wait())}return Promise.all(n)}function resolveTargetOptions(e,t){if(!t)return;let n=e.options;if(n)return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n;e.options=t}function scaleClip(e,t){const n=e&&e.options||{},r=n.reverse,o=void 0===n.min?t:0,i=void 0===n.max?t:0;return{start:r?i:o,end:r?o:i}}function defaultClip(e,t,n){if(!1===n)return!1;const r=scaleClip(e,n),o=scaleClip(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function toClip(e){let t,n,r,o;return isObject$3(e)?(t=e.top,n=e.right,r=e.bottom,o=e.left):t=n=r=o=e,{top:t,right:n,bottom:r,left:o,disabled:!1===e}}function getSortedDatasetIndices(e,t){const n=[],r=e._getSortedDatasetMetas(t);let o,i;for(o=0,i=r.length;o<i;++o)n.push(r[o].index);return n}function applyStack(e,t,n,r={}){const o=e.keys,i="single"===r.mode;let a,s,l,c;if(null!==t){for(a=0,s=o.length;a<s;++a){if(l=+o[a],l===n){if(r.all)continue;break}c=e.values[l],isNumberFinite(c)&&(i||0===t||sign$2(t)===sign$2(c))&&(t+=c)}return t}}function convertObjectDataToArray(e){const t=Object.keys(e),n=new Array(t.length);let r,o,i;for(r=0,o=t.length;r<o;++r)i=t[r],n[r]={x:i,y:e[i]};return n}function isStacked(e,t){const n=e&&e.options.stacked;return n||void 0===n&&void 0!==t.stack}function getStackKey(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function getUserBounds(e){const{min:t,max:n,minDefined:r,maxDefined:o}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}function getOrCreateStack(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function getLastIndexInStack(e,t,n,r){for(const o of t.getMatchingVisibleMetas(r).reverse()){const t=e[o.index];if(n&&t>0||!n&&t<0)return o.index}return null}function updateStacks(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:a,index:s}=r,l=i.axis,c=a.axis,u=getStackKey(i,a,r),d=t.length;let p;for(let h=0;h<d;++h){const e=t[h],{[l]:n,[c]:i}=e;p=(e._stacks||(e._stacks={}))[c]=getOrCreateStack(o,u,n),p[s]=i,p._top=getLastIndexInStack(p,a,!0,r.type),p._bottom=getLastIndexInStack(p,a,!1,r.type);(p._visualValues||(p._visualValues={}))[s]=i}}function getFirstScaleId(e,t){const n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function createDatasetContext(e,t){return createContext(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function createDataContext(e,t,n){return createContext(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function clearStacks(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const e of t){const t=e._stacks;if(!t||void 0===t[r]||void 0===t[r][n])return;delete t[r][n],void 0!==t[r]._visualValues&&void 0!==t[r]._visualValues[n]&&delete t[r]._visualValues[n]}}}const isDirectUpdateMode=e=>"reset"===e||"none"===e,cloneIfNotShared=(e,t)=>t?e:Object.assign({},e),createStack=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:getSortedDatasetIndices(n,!0),values:null};class DatasetController{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=isStacked(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&clearStacks(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>"x"===e?t:"r"===e?r:n,o=t.xAxisID=valueOrDefault(n.xAxisID,getFirstScaleId(e,"x")),i=t.yAxisID=valueOrDefault(n.yAxisID,getFirstScaleId(e,"y")),a=t.rAxisID=valueOrDefault(n.rAxisID,getFirstScaleId(e,"r")),s=t.indexAxis,l=t.iAxisID=r(s,o,i,a),c=t.vAxisID=r(s,i,o,a);t.xScale=this.getScaleForId(o),t.yScale=this.getScaleForId(i),t.rScale=this.getScaleForId(a),t.iScale=this.getScaleForId(l),t.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),e._stacked&&clearStacks(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),n=this._data;if(isObject$3(t))this._data=convertObjectDataToArray(t);else if(n!==t){if(n){unlistenArrayEvents(n,this);const e=this._cachedMeta;clearStacks(e),e._parsed=[]}t&&Object.isExtensible(t)&&listenArrayEvents(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,n=this.getDataset();let r=!1;this._dataCheck();const o=t._stacked;t._stacked=isStacked(t.vScale,t),t.stack!==n.stack&&(r=!0,clearStacks(t),t.stack=n.stack),this._resyncElements(e),(r||o!==t._stacked)&&updateStacks(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:n,_data:r}=this,{iScale:o,_stacked:i}=n,a=o.axis;let s,l,c,u=0===e&&t===r.length||n._sorted,d=e>0&&n._parsed[e-1];if(!1===this._parsing)n._parsed=r,n._sorted=!0,c=r;else{c=isArray$4(r[e])?this.parseArrayData(n,r,e,t):isObject$3(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);const o=()=>null===l[a]||d&&l[a]<d[a];for(s=0;s<t;++s)n._parsed[s+e]=l=c[s],u&&(o()&&(u=!1),d=l);n._sorted=u}i&&updateStacks(this,c)}parsePrimitiveData(e,t,n,r){const{iScale:o,vScale:i}=e,a=o.axis,s=i.axis,l=o.getLabels(),c=o===i,u=new Array(r);let d,p,h;for(d=0,p=r;d<p;++d)h=d+n,u[d]={[a]:c||o.parse(l[h],h),[s]:i.parse(t[h],h)};return u}parseArrayData(e,t,n,r){const{xScale:o,yScale:i}=e,a=new Array(r);let s,l,c,u;for(s=0,l=r;s<l;++s)c=s+n,u=t[c],a[s]={x:o.parse(u[0],c),y:i.parse(u[1],c)};return a}parseObjectData(e,t,n,r){const{xScale:o,yScale:i}=e,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=new Array(r);let c,u,d,p;for(c=0,u=r;c<u;++c)d=c+n,p=t[d],l[c]={x:o.parse(resolveObjectKey(p,a),d),y:i.parse(resolveObjectKey(p,s),d)};return l}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){const r=this.chart,o=this._cachedMeta,i=t[e.axis];return applyStack({keys:getSortedDatasetIndices(r,!0),values:t._stacks[e.axis]._visualValues},i,o.index,{mode:n})}updateRangeFromParsed(e,t,n,r){const o=n[t.axis];let i=null===o?NaN:o;const a=r&&n._stacks[t.axis];r&&a&&(r.values=a,i=applyStack(r,o,this._cachedMeta.index)),e.min=Math.min(e.min,i),e.max=Math.max(e.max,i)}getMinMax(e,t){const n=this._cachedMeta,r=n._parsed,o=n._sorted&&e===n.iScale,i=r.length,a=this._getOtherScale(e),s=createStack(t,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=getUserBounds(a);let d,p;function h(){p=r[d];const t=p[a.axis];return!isNumberFinite(p[e.axis])||c>t||u<t}for(d=0;d<i&&(h()||(this.updateRangeFromParsed(l,e,p,s),!o));++d);if(o)for(d=i-1;d>=0;--d)if(!h()){this.updateRangeFromParsed(l,e,p,s);break}return l}getAllParsedValues(e){const t=this._cachedMeta._parsed,n=[];let r,o,i;for(r=0,o=t.length;r<o;++r)i=t[r][e.axis],isNumberFinite(i)&&n.push(i);return n}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,n=t.iScale,r=t.vScale,o=this.getParsed(e);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:r?""+r.getLabelForValue(o[r.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=toClip(valueOrDefault(this.options.clip,defaultClip(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],o=t.chartArea,i=[],a=this._drawStart||0,s=this._drawCount||r.length-a,l=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(e,o,a,s),c=a;c<a+s;++c){const t=r[c];t.hidden||(t.active&&l?i.push(t):t.draw(e,o))}for(c=0;c<i.length;++c)i[c].draw(e,o)}getStyle(e,t){const n=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){const r=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const t=this._cachedMeta.data[e];o=t.$context||(t.$context=createDataContext(this.getContext(),e,t)),o.parsed=this.getParsed(e),o.raw=r.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=createDatasetContext(this.chart.getContext(),this.index)),o.dataset=r,o.index=o.datasetIndex=this.index;return o.active=!!t,o.mode=n,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",n){const r="active"===t,o=this._cachedDataOpts,i=e+"-"+t,a=o[i],s=this.enableOptionSharing&&defined(n);if(a)return cloneIfNotShared(a,s);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,e),u=r?[`${e}Hover`,"hover",e,""]:[e,""],d=l.getOptionScopes(this.getDataset(),c),p=Object.keys(defaults$2.elements[e]),h=l.resolveNamedOptions(d,p,()=>this.getContext(n,r,t),u);return h.$shared&&(h.$shared=s,o[i]=Object.freeze(cloneIfNotShared(h,s))),h}_resolveAnimations(e,t,n){const r=this.chart,o=this._cachedDataOpts,i=`animation-${t}`,a=o[i];if(a)return a;let s;if(!1!==r.options.animation){const r=this.chart.config,o=r.datasetAnimationScopeKeys(this._type,t),i=r.getOptionScopes(this.getDataset(),o);s=r.createResolver(i,this.getContext(e,n,t))}const l=new Animations(r,s&&s.animations);return s&&s._cacheable&&(o[i]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||isDirectUpdateMode(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,o=this.getSharedOptions(n),i=this.includeOptions(t,o)||o!==r;return this.updateSharedOptions(o,t,n),{sharedOptions:o,includeOptions:i}}updateElement(e,t,n,r){isDirectUpdateMode(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!isDirectUpdateMode(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;const o=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(o)||o})}removeHoverStyle(e,t,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,t,n){this._setStyle(e,n,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,n=this._cachedMeta.data;for(const[a,s,l]of this._syncList)this[a](s,l);this._syncList=[];const r=n.length,o=t.length,i=Math.min(o,r);i&&this.parse(0,i),o>r?this._insertElements(r,o-r,e):o<r&&this._removeElements(o,r-o)}_insertElements(e,t,n=!0){const r=this._cachedMeta,o=r.data,i=e+t;let a;const s=e=>{for(e.length+=t,a=e.length-1;a>=i;a--)e[a]=e[a-t]};for(s(o),a=e;a<i;++a)o[a]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(o,e,t,"reset")}updateElements(e,t,n,r){}_removeElements(e,t){const n=this._cachedMeta;if(this._parsing){const r=n._parsed.splice(e,t);n._stacked&&clearStacks(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function getAllScaleValues(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let t=0,o=n.length;t<o;t++)r=r.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=_arrayUnique(r.sort((e,t)=>e-t))}return e._cache.$bar}function computeMinSampleSize(e){const t=e.iScale,n=getAllScaleValues(t,e.type);let r,o,i,a,s=t._length;const l=()=>{32767!==i&&-32768!==i&&(defined(a)&&(s=Math.min(s,Math.abs(i-a)||s)),a=i)};for(r=0,o=n.length;r<o;++r)i=t.getPixelForValue(n[r]),l();for(a=void 0,r=0,o=t.ticks.length;r<o;++r)i=t.getPixelForTick(r),l();return s}function computeFitCategoryTraits(e,t,n,r){const o=n.barThickness;let i,a;return isNullOrUndef(o)?(i=t.min*n.categoryPercentage,a=n.barPercentage):(i=o*r,a=1),{chunk:i/r,ratio:a,start:t.pixels[e]-i/2}}function computeFlexCategoryTraits(e,t,n,r){const o=t.pixels,i=o[e];let a=e>0?o[e-1]:null,s=e<o.length-1?o[e+1]:null;const l=n.categoryPercentage;null===a&&(a=i-(null===s?t.end-t.start:s-i)),null===s&&(s=i+i-a);const c=i-(i-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/r,ratio:n.barPercentage,start:c}}function parseFloatBar(e,t,n,r){const o=n.parse(e[0],r),i=n.parse(e[1],r),a=Math.min(o,i),s=Math.max(o,i);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:o,end:i,min:a,max:s}}function parseValue(e,t,n,r){return isArray$4(e)?parseFloatBar(e,t,n,r):t[n.axis]=n.parse(e,r),t}function parseArrayOrPrimitive(e,t,n,r){const o=e.iScale,i=e.vScale,a=o.getLabels(),s=o===i,l=[];let c,u,d,p;for(c=n,u=n+r;c<u;++c)p=t[c],d={},d[o.axis]=s||o.parse(a[c],c),l.push(parseValue(p,d,i,c));return l}function isFloatBar(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function barSign(e,t,n){return 0!==e?sign$2(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function borderProps(e){let t,n,r,o,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(o="end",i="start"):(o="start",i="end"),{start:n,end:r,reverse:t,top:o,bottom:i}}function setBorderSkipped(e,t,n,r){let o=t.borderSkipped;const i={};if(!o)return void(e.borderSkipped=i);if(!0===o)return void(e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:s,reverse:l,top:c,bottom:u}=borderProps(e);"middle"===o&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[parseEdge(u,a,s,l)]=!0,o=c)),i[parseEdge(o,a,s,l)]=!0,e.borderSkipped=i}function parseEdge(e,t,n,r){return e=r?startEnd(e=swap(e,t,n),n,t):startEnd(e,t,n)}function swap(e,t,n){return e===t?n:e===n?t:e}function startEnd(e,t,n){return"start"===e?t:"end"===e?n:e}function setInflateAmount(e,{inflateAmount:t},n){e.inflateAmount="auto"===t?1===n?.33:0:t}class BarController extends DatasetController{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(e,t,n,r){return parseArrayOrPrimitive(e,t,n,r)}parseArrayData(e,t,n,r){return parseArrayOrPrimitive(e,t,n,r)}parseObjectData(e,t,n,r){const{iScale:o,vScale:i}=e,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l="x"===o.axis?a:s,c="x"===i.axis?a:s,u=[];let d,p,h,f;for(d=n,p=n+r;d<p;++d)f=t[d],h={},h[o.axis]=o.parse(resolveObjectKey(f,l),d),u.push(parseValue(resolveObjectKey(f,c),h,i,d));return u}updateRangeFromParsed(e,t,n,r){super.updateRangeFromParsed(e,t,n,r);const o=n._custom;o&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:n,vScale:r}=t,o=this.getParsed(e),i=o._custom,a=isFloatBar(i)?"["+i.start+", "+i.end+"]":""+r.getLabelForValue(o[r.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,r){const o="reset"===r,{index:i,_cachedMeta:{vScale:a}}=this,s=a.getBasePixel(),l=a.isHorizontal(),c=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(t,r);for(let p=t;p<t+n;p++){const t=this.getParsed(p),n=o||isNullOrUndef(t[a.axis])?{base:s,head:s}:this._calculateBarValuePixels(p),h=this._calculateBarIndexPixels(p,c),f=(t._stacks||{})[a.axis],A={horizontal:l,base:n.base,enableBorderRadius:!f||isFloatBar(t._custom)||i===f._top||i===f._bottom,x:l?n.head:h.center,y:l?h.center:n.head,height:l?h.size:Math.abs(n.size),width:l?Math.abs(n.size):h.size};d&&(A.options=u||this.resolveDataElementOptions(p,e[p].active?"active":r));const m=A.options||e[p].options;setBorderSkipped(A,m,f,i),setInflateAmount(A,m,c.ratio),this.updateElement(e[p],p,A,r)}}_getStacks(e,t){const{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),o=n.options.stacked,i=[],a=e=>{const n=e.controller.getParsed(t),r=n&&n[e.vScale.axis];if(isNullOrUndef(r)||isNaN(r))return!0};for(const s of r)if((void 0===t||!a(s))&&((!1===o||-1===i.indexOf(s.stack)||void 0===o&&void 0===s.stack)&&i.push(s.stack),s.index===e))break;return i.length||i.push(void 0),i}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,n){const r=this._getStacks(e,n),o=void 0!==t?r.indexOf(t):-1;return-1===o?r.length-1:o}_getRuler(){const e=this.options,t=this._cachedMeta,n=t.iScale,r=[];let o,i;for(o=0,i=t.data.length;o<i;++o)r.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const a=e.barThickness;return{min:a||computeMinSampleSize(t),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:n,index:r},options:{base:o,minBarLength:i}}=this,a=o||0,s=this.getParsed(e),l=s._custom,c=isFloatBar(l);let u,d,p=s[t.axis],h=0,f=n?this.applyStack(t,s,n):p;f!==p&&(h=f-p,f=p),c&&(p=l.barStart,f=l.barEnd-l.barStart,0!==p&&sign$2(p)!==sign$2(l.barEnd)&&(h=0),h+=p);const A=isNullOrUndef(o)||c?h:o;let m=t.getPixelForValue(A);if(u=this.chart.getDataVisibility(e)?t.getPixelForValue(h+f):m,d=u-m,Math.abs(d)<i){d=barSign(d,t,a)*i,p===a&&(m-=d/2);const e=t.getPixelForDecimal(0),o=t.getPixelForDecimal(1),l=Math.min(e,o),h=Math.max(e,o);m=Math.max(Math.min(m,h),l),u=m+d,n&&!c&&(s._stacks[t.axis]._visualValues[r]=t.getValueForPixel(u)-t.getValueForPixel(m))}if(m===t.getPixelForValue(a)){const e=sign$2(d)*t.getLineWidthForValue(a)/2;m+=e,d-=e}return{size:d,base:m,head:u,center:u+d/2}}_calculateBarIndexPixels(e,t){const n=t.scale,r=this.options,o=r.skipNull,i=valueOrDefault(r.maxBarThickness,1/0);let a,s;if(t.grouped){const n=o?this._getStackCount(e):t.stackCount,l="flex"===r.barThickness?computeFlexCategoryTraits(e,t,r,n):computeFitCategoryTraits(e,t,r,n),c=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);a=l.start+l.chunk*c+l.chunk/2,s=Math.min(i,l.chunk*l.ratio)}else a=n.getPixelForValue(this.getParsed(e)[n.axis],e),s=Math.min(i,t.min*t.ratio);return{base:a-s/2,head:a+s/2,center:a,size:s}}draw(){const e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length;let o=0;for(;o<r;++o)null!==this.getParsed(o)[t.axis]&&n[o].draw(this._ctx)}}class LineController extends DatasetController{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:n,data:r=[],_dataset:o}=t,i=this.chart._animationsDisabled;let{start:a,count:s}=_getStartAndCountOfVisiblePoints(t,r,i);this._drawStart=a,this._drawCount=s,_scaleRangesChanged(t)&&(a=0,s=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=r;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!i,options:l},e),this.updateElements(r,a,s,e)}updateElements(e,t,n,r){const o="reset"===r,{iScale:i,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(t,r),d=i.axis,p=a.axis,{spanGaps:h,segment:f}=this.options,A=isNumber$2(h)?h:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||o||"none"===r,g=t+n,y=e.length;let v=t>0&&this.getParsed(t-1);for(let b=0;b<y;++b){const n=e[b],h=m?n:{};if(b<t||b>=g){h.skip=!0;continue}const y=this.getParsed(b),x=isNullOrUndef(y[p]),w=h[d]=i.getPixelForValue(y[d],b),C=h[p]=o||x?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,y,s):y[p],b);h.skip=isNaN(w)||isNaN(C)||x,h.stop=b>0&&Math.abs(y[d]-v[d])>A,f&&(h.parsed=y,h.raw=l.data[b]),u&&(h.options=c||this.resolveDataElementOptions(b,n.active?"active":r)),m||this.updateElement(n,b,h,r),v=y}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;const o=r[0].size(this.resolveDataElementOptions(0)),i=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,o,i)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}function abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class DateAdapterBase{static override(e){Object.assign(DateAdapterBase.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return abstract()}parse(){return abstract()}format(){return abstract()}add(){return abstract()}diff(){return abstract()}startOf(){return abstract()}endOf(){return abstract()}}var adapters={_date:DateAdapterBase};function binarySearch(e,t,n,r){const{controller:o,data:i,_sorted:a}=e,s=o._cachedMeta.iScale;if(s&&t===s.axis&&"r"!==t&&a&&i.length){const e=s._reversePixels?_rlookupByKey:_lookupByKey;if(!r)return e(i,t,n);if(o._sharedOptions){const r=i[0],o="function"==typeof r.getRange&&r.getRange(t);if(o){const r=e(i,t,n-o),a=e(i,t,n+o);return{lo:r.lo,hi:a.hi}}}}return{lo:0,hi:i.length-1}}function evaluateInteractionItems(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),a=n[t];for(let s=0,l=i.length;s<l;++s){const{index:e,data:n}=i[s],{lo:l,hi:c}=binarySearch(i[s],t,a,o);for(let t=l;t<=c;++t){const o=n[t];o.skip||r(o,e,t)}}}function getDistanceMetricForAxis(e){const t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,r){const o=t?Math.abs(e.x-r.x):0,i=n?Math.abs(e.y-r.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(i,2))}}function getIntersectItems(e,t,n,r,o){const i=[];if(!o&&!e.isPointInArea(t))return i;return evaluateInteractionItems(e,n,t,function(n,a,s){(o||_isPointInArea(n,e.chartArea,0))&&n.inRange(t.x,t.y,r)&&i.push({element:n,datasetIndex:a,index:s})},!0),i}function getNearestRadialItems(e,t,n,r){let o=[];return evaluateInteractionItems(e,n,t,function(e,n,i){const{startAngle:a,endAngle:s}=e.getProps(["startAngle","endAngle"],r),{angle:l}=getAngleFromPoint(e,{x:t.x,y:t.y});_angleBetween(l,a,s)&&o.push({element:e,datasetIndex:n,index:i})}),o}function getNearestCartesianItems(e,t,n,r,o,i){let a=[];const s=getDistanceMetricForAxis(n);let l=Number.POSITIVE_INFINITY;return evaluateInteractionItems(e,n,t,function(n,c,u){const d=n.inRange(t.x,t.y,o);if(r&&!d)return;const p=n.getCenterPoint(o);if(!(!!i||e.isPointInArea(p))&&!d)return;const h=s(t,p);h<l?(a=[{element:n,datasetIndex:c,index:u}],l=h):h===l&&a.push({element:n,datasetIndex:c,index:u})}),a}function getNearestItems(e,t,n,r,o,i){return i||e.isPointInArea(t)?"r"!==n||r?getNearestCartesianItems(e,t,n,r,o,i):getNearestRadialItems(e,t,n,o):[]}function getAxisItems(e,t,n,r,o){const i=[],a="x"===n?"inXRange":"inYRange";let s=!1;return evaluateInteractionItems(e,n,t,(e,r,l)=>{e[a](t[n],o)&&(i.push({element:e,datasetIndex:r,index:l}),s=s||e.inRange(t.x,t.y,o))}),r&&!s?[]:i}var Interaction={modes:{index(e,t,n,r){const o=getRelativePosition(t,e),i=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?getIntersectItems(e,o,i,r,a):getNearestItems(e,o,i,!1,r,a),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{const t=s[0].index,n=e.data[t];n&&!n.skip&&l.push({element:n,datasetIndex:e.index,index:t})}),l):[]},dataset(e,t,n,r){const o=getRelativePosition(t,e),i=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?getIntersectItems(e,o,i,r,a):getNearestItems(e,o,i,!1,r,a);if(s.length>0){const t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point:(e,t,n,r)=>getIntersectItems(e,getRelativePosition(t,e),n.axis||"xy",r,n.includeInvisible||!1),nearest(e,t,n,r){const o=getRelativePosition(t,e),i=n.axis||"xy",a=n.includeInvisible||!1;return getNearestItems(e,o,i,n.intersect,r,a)},x:(e,t,n,r)=>getAxisItems(e,getRelativePosition(t,e),"x",n.intersect,r),y:(e,t,n,r)=>getAxisItems(e,getRelativePosition(t,e),"y",n.intersect,r)}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(e,t){return e.filter(e=>e.pos===t)}function filterDynamicPositionByAxis(e,t){return e.filter(e=>-1===STATIC_POSITIONS.indexOf(e.pos)&&e.box.axis===t)}function sortByWeight(e,t){return e.sort((e,n)=>{const r=t?n:e,o=t?e:n;return r.weight===o.weight?r.index-o.index:r.weight-o.weight})}function wrapBoxes(e){const t=[];let n,r,o,i,a,s;for(n=0,r=(e||[]).length;n<r;++n)o=e[n],({position:i,options:{stack:a,stackWeight:s=1}}=o),t.push({index:n,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:a&&i+a,stackWeight:s});return t}function buildStacks(e){const t={};for(const n of e){const{stack:e,pos:r,stackWeight:o}=n;if(!e||!STATIC_POSITIONS.includes(r))continue;const i=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=o}return t}function setLayoutDims(e,t){const n=buildStacks(e),{vBoxMaxWidth:r,hBoxMaxHeight:o}=t;let i,a,s;for(i=0,a=e.length;i<a;++i){s=e[i];const{fullSize:a}=s.box,l=n[s.stack],c=l&&s.stackWeight/l.weight;s.horizontal?(s.width=c?c*r:a&&t.availableWidth,s.height=o):(s.width=r,s.height=c?c*o:a&&t.availableHeight)}return n}function buildLayoutBoxes(e){const t=wrapBoxes(e),n=sortByWeight(t.filter(e=>e.box.fullSize),!0),r=sortByWeight(filterByPosition(t,"left"),!0),o=sortByWeight(filterByPosition(t,"right")),i=sortByWeight(filterByPosition(t,"top"),!0),a=sortByWeight(filterByPosition(t,"bottom")),s=filterDynamicPositionByAxis(t,"x"),l=filterDynamicPositionByAxis(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(a).concat(s),chartArea:filterByPosition(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(a).concat(s)}}function getCombinedMax(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function updateMaxPadding(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 updateDims(e,t,n,r){const{pos:o,box:i}=n,a=e.maxPadding;if(!isObject$3(o)){n.size&&(e[o]-=n.size);const t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?i.height:i.width),n.size=t.size/t.count,e[o]+=n.size}i.getPadding&&updateMaxPadding(a,i.getPadding());const s=Math.max(0,t.outerWidth-getCombinedMax(a,e,"left","right")),l=Math.max(0,t.outerHeight-getCombinedMax(a,e,"top","bottom")),c=s!==e.w,u=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function handleMaxPadding(e){const t=e.maxPadding;function n(n){const r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function getMargins(e,t){const n=t.maxPadding;function r(e){const r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?["left","right"]:["top","bottom"])}function fitBoxes(e,t,n,r){const o=[];let i,a,s,l,c,u;for(i=0,a=e.length,c=0;i<a;++i){s=e[i],l=s.box,l.update(s.width||t.w,s.height||t.h,getMargins(s.horizontal,t));const{same:a,other:d}=updateDims(t,n,s,r);c|=a&&o.length,u=u||d,l.fullSize||o.push(s)}return c&&fitBoxes(o,t,n,r)||u}function setBoxDims(e,t,n,r,o){e.top=n,e.left=t,e.right=t+r,e.bottom=n+o,e.width=r,e.height=o}function placeBoxes(e,t,n,r){const o=n.padding;let{x:i,y:a}=t;for(const s of e){const e=s.box,l=r[s.stack]||{placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){const r=t.w*c,i=l.size||e.height;defined(l.start)&&(a=l.start),e.fullSize?setBoxDims(e,o.left,a,n.outerWidth-o.right-o.left,i):setBoxDims(e,t.left+l.placed,a,r,i),l.start=a,l.placed+=r,a=e.bottom}else{const r=t.h*c,a=l.size||e.width;defined(l.start)&&(i=l.start),e.fullSize?setBoxDims(e,i,o.top,a,n.outerHeight-o.bottom-o.top):setBoxDims(e,i,t.top+l.placed,a,r),l.start=i,l.placed+=r,i=e.right}}t.x=i,t.y=a}var layouts={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(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&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 o=toPadding(e.options.layout.padding),i=Math.max(t-o.width,0),a=Math.max(n-o.height,0),s=buildLayoutBoxes(e.boxes),l=s.vertical,c=s.horizontal;each$1(e.boxes,e=>{"function"==typeof e.beforeLayout&&e.beforeLayout()});const u=l.reduce((e,t)=>t.box.options&&!1===t.box.options.display?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:a,vBoxMaxWidth:i/2/u,hBoxMaxHeight:a/2}),p=Object.assign({},o);updateMaxPadding(p,toPadding(r));const h=Object.assign({maxPadding:p,w:i,h:a,x:o.left,y:o.top},o),f=setLayoutDims(l.concat(c),d);fitBoxes(s.fullSize,h,d,f),fitBoxes(l,h,d,f),fitBoxes(c,h,d,f)&&fitBoxes(l,h,d,f),handleMaxPadding(h),placeBoxes(s.leftAndTop,h,d,f),h.x+=h.w,h.y+=h.h,placeBoxes(s.rightAndBottom,h,d,f),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},each$1(s.chartArea,t=>{const n=t.box;Object.assign(n,e.chartArea),n.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}}class BasicPlatform extends BasePlatform{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const EXPANDO_KEY="$chartjs",EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=e=>null===e||""===e;function initCanvas(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[EXPANDO_KEY]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",isNullOrEmpty(o)){const t=readUsedSize(e,"width");void 0!==t&&(e.width=t)}if(isNullOrEmpty(r))if(""===e.style.height)e.height=e.width/(t||2);else{const t=readUsedSize(e,"height");void 0!==t&&(e.height=t)}return e}const eventListenerOptions=!!supportsEventListenerOptions&&{passive:!0};function addListener(e,t,n){e.addEventListener(t,n,eventListenerOptions)}function removeListener(e,t,n){e.canvas.removeEventListener(t,n,eventListenerOptions)}function fromNativeEvent(e,t){const n=EVENT_TYPES[e.type]||e.type,{x:r,y:o}=getRelativePosition(e,t);return{type:n,chart:t,native:e,x:void 0!==r?r:null,y:void 0!==o?o:null}}function nodeListContains(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function createAttachObserver(e,t,n){const r=e.canvas,o=new MutationObserver(e=>{let t=!1;for(const n of e)t=t||nodeListContains(n.addedNodes,r),t=t&&!nodeListContains(n.removedNodes,r);t&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function createDetachObserver(e,t,n){const r=e.canvas,o=new MutationObserver(e=>{let t=!1;for(const n of e)t=t||nodeListContains(n.removedNodes,r),t=t&&!nodeListContains(n.addedNodes,r);t&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const e=window.devicePixelRatio;e!==oldDevicePixelRatio&&(oldDevicePixelRatio=e,drpListeningCharts.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function listenDevicePixelRatioChanges(e,t){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(e,t)}function unlistenDevicePixelRatioChanges(e){drpListeningCharts.delete(e),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(e,t,n){const r=e.canvas,o=r&&_getParentNode(r);if(!o)return;const i=throttled((e,t)=>{const r=o.clientWidth;n(e,t),r<o.clientWidth&&n()},window),a=new ResizeObserver(e=>{const t=e[0],n=t.contentRect.width,r=t.contentRect.height;0===n&&0===r||i(n,r)});return a.observe(o),listenDevicePixelRatioChanges(e,i),a}function releaseObserver(e,t,n){n&&n.disconnect(),"resize"===t&&unlistenDevicePixelRatioChanges(e)}function createProxyAndListen(e,t,n){const r=e.canvas,o=throttled(t=>{null!==e.ctx&&n(fromNativeEvent(t,e))},e);return addListener(r,t,o),o}class DomPlatform extends BasePlatform{acquireContext(e,t){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(initCanvas(e,t),n):null}releaseContext(e){const t=e.canvas;if(!t[EXPANDO_KEY])return!1;const n=t[EXPANDO_KEY].initial;["height","width"].forEach(e=>{const r=n[e];isNullOrUndef(r)?t.removeAttribute(e):t.setAttribute(e,r)});const r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[EXPANDO_KEY],!0}addEventListener(e,t,n){this.removeEventListener(e,t);const r=e.$proxies||(e.$proxies={}),o={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[t]||createProxyAndListen;r[t]=o(e,t,n)}removeEventListener(e,t){const n=e.$proxies||(e.$proxies={}),r=n[t];if(!r)return;({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[t]||removeListener)(e,t,r),n[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return getMaximumSize(e,t,n,r)}isAttached(e){const t=_getParentNode(e);return!(!t||!t.isConnected)}}function _detectPlatform(e){return!_isDomSupported()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?BasicPlatform:DomPlatform}let Element$2=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}hasValue(){return isNumber$2(this.x)&&isNumber$2(this.y)}getProps(e,t){const n=this.$animations;if(!t||!n)return this;const r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function autoSkip(e,t){const n=e.options.ticks,r=determineMaxTicks(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?getMajorIndices(t):[],a=i.length,s=i[0],l=i[a-1],c=[];if(a>o)return skipMajors(t,c,i,a/o),c;const u=calculateSpacing(i,t,o);if(a>0){let e,n;const r=a>1?Math.round((l-s)/(a-1)):null;for(skip(t,c,u,isNullOrUndef(r)?0:s-r,s),e=0,n=a-1;e<n;e++)skip(t,c,u,i[e],i[e+1]);return skip(t,c,u,l,isNullOrUndef(r)?t.length:l+r),c}return skip(t,c,u),c}function determineMaxTicks(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),o=e._maxLength/n;return Math.floor(Math.min(r,o))}function calculateSpacing(e,t,n){const r=getEvenSpacing(e),o=t.length/n;if(!r)return Math.max(o,1);const i=_factorize(r);for(let a=0,s=i.length-1;a<s;a++){const e=i[a];if(e>o)return e}return Math.max(o,1)}function getMajorIndices(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function skipMajors(e,t,n,r){let o,i=0,a=n[0];for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function skip(e,t,n,r,o){const i=valueOrDefault(r,0),a=Math.min(valueOrDefault(o,e.length),e.length);let s,l,c,u=0;for(n=Math.ceil(n),o&&(s=o-r,n=s/Math.floor(s/n)),c=i;c<0;)u++,c=Math.round(i+u*n);for(l=Math.max(i,0);l<a;l++)l===c&&(t.push(e[l]),u++,c=Math.round(i+u*n))}function getEvenSpacing(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 reverseAlign=e=>"left"===e?"right":"right"===e?"left":e,offsetFromEdge=(e,t,n)=>"top"===t||"left"===t?e[t]+n:e[t]-n,getTicksLimit=(e,t)=>Math.min(t||e,e);function sample(e,t){const n=[],r=e.length/t,o=e.length;let i=0;for(;i<o;i+=r)n.push(e[Math.floor(i)]);return n}function getPixelForGridLine(e,t,n){const r=e.ticks.length,o=Math.min(t,r-1),i=e._startPixel,a=e._endPixel,s=1e-6;let l,c=e.getPixelForTick(o);if(!(n&&(l=1===r?Math.max(c-i,a-c):0===t?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(o-1))/2,c+=o<t?l:-l,c<i-s||c>a+s)))return c}function garbageCollect(e,t){each$1(e,e=>{const n=e.gc,r=n.length/2;let o;if(r>t){for(o=0;o<r;++o)delete e.data[n[o]];n.splice(0,r)}})}function getTickMarkLength(e){return e.drawTicks?e.tickLength:0}function getTitleHeight(e,t){if(!e.display)return 0;const n=toFont(e.font,t),r=toPadding(e.padding);return(isArray$4(e.text)?e.text.length:1)*n.lineHeight+r.height}function createScaleContext(e,t){return createContext(e,{scale:t,type:"scale"})}function createTickContext(e,t,n){return createContext(e,{tick:n,index:t,type:"tick"})}function titleAlign(e,t,n){let r=_toLeftRightCenter(e);return(n&&"right"!==t||!n&&"right"===t)&&(r=reverseAlign(r)),r}function titleArgs(e,t,n,r){const{top:o,left:i,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:u}=l;let d,p,h,f=0;const A=a-o,m=s-i;if(e.isHorizontal()){if(p=_alignStartEnd(r,i,s),isObject$3(n)){const e=Object.keys(n)[0],r=n[e];h=u[e].getPixelForValue(r)+A-t}else h="center"===n?(c.bottom+c.top)/2+A-t:offsetFromEdge(e,n,t);d=s-i}else{if(isObject$3(n)){const e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)-m+t}else p="center"===n?(c.left+c.right)/2-m+t:offsetFromEdge(e,n,t);h=_alignStartEnd(r,a,o),f="left"===n?-HALF_PI:HALF_PI}return{titleX:p,titleY:h,maxWidth:d,rotation:f}}class Scale extends Element$2{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=finiteOrDefault(e,Number.POSITIVE_INFINITY),t=finiteOrDefault(t,Number.NEGATIVE_INFINITY),n=finiteOrDefault(n,Number.POSITIVE_INFINITY),r=finiteOrDefault(r,Number.NEGATIVE_INFINITY),{min:finiteOrDefault(e,n),max:finiteOrDefault(t,r),minDefined:isNumberFinite(e),maxDefined:isNumberFinite(t)}}getMinMax(e){let t,{min:n,max:r,minDefined:o,maxDefined:i}=this.getUserBounds();if(o&&i)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let s=0,l=a.length;s<l;++s)t=a[s].controller.getMinMax(this,e),o||(n=Math.min(n,t.min)),i||(r=Math.max(r,t.max));return n=i&&n>r?r:n,r=o&&n>r?n:r,{min:finiteOrDefault(n,finiteOrDefault(r,n)),max:finiteOrDefault(r,finiteOrDefault(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 e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(e,t,n){const{beginAtZero:r,grace:o,ticks:i}=this.options,a=i.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,o,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=a<this.ticks.length;this._convertTicksToLabels(s?sample(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||"auto"===i.source)&&(this.ticks=autoSkip(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e,t,n=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,n=!n),this._startPixel=e,this._endPixel=t,this._reversePixels=n,this._length=t-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){callback(this.options.afterUpdate,[this])}beforeSetDimensions(){callback(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(){callback(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),callback(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){callback(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let n,r,o;for(n=0,r=e.length;n<r;n++)o=e[n],o.label=callback(t.callback,[o.value,n,e],this)}afterTickToLabelConversion(){callback(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){callback(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,n=getTicksLimit(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,o=t.maxRotation;let i,a,s,l=r;if(!this._isVisible()||!t.display||r>=o||n<=1||!this.isHorizontal())return void(this.labelRotation=r);const c=this._getLabelSizes(),u=c.widest.width,d=c.highest.height,p=_limitValue(this.chart.width-u,0,this.maxWidth);i=e.offset?this.maxWidth/n:p/(n-1),u+6>i&&(i=p/(n-(e.offset?.5:1)),a=this.maxHeight-getTickMarkLength(e.grid)-t.padding-getTitleHeight(e.title,this.chart.options.font),s=Math.sqrt(u*u+d*d),l=toDegrees(Math.min(Math.asin(_limitValue((c.highest.height+6)/i,-1,1)),Math.asin(_limitValue(a/s,-1,1))-Math.asin(_limitValue(d/s,-1,1)))),l=Math.max(r,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:o}}=this,i=this._isVisible(),a=this.isHorizontal();if(i){const i=getTitleHeight(r,t.options.font);if(a?(e.width=this.maxWidth,e.height=getTickMarkLength(o)+i):(e.height=this.maxHeight,e.width=getTickMarkLength(o)+i),n.display&&this.ticks.length){const{first:t,last:r,widest:o,highest:i}=this._getLabelSizes(),s=2*n.padding,l=toRadians(this.labelRotation),c=Math.cos(l),u=Math.sin(l);if(a){const t=n.mirror?0:u*o.width+c*i.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{const t=n.mirror?0:c*o.width+u*i.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,c)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){const{ticks:{align:o,padding:i},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,d=0;s?l?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):"start"===o?d=t.width:"end"===o?u=e.width:"inner"!==o&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-a+i)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-c+i)*this.width/(this.width-c),0)}else{let n=t.height/2,r=e.height/2;"start"===o?(n=0,r=e.height):"end"===o&&(n=t.height,r=0),this.paddingTop=n+i,this.paddingBottom=r+i}}_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(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return"top"===t||"bottom"===t||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let t,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,n=e.length;t<n;t++)isNullOrUndef(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let n=this.ticks;t<n.length&&(n=sample(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){const{ctx:r,_longestTextCache:o}=this,i=[],a=[],s=Math.floor(t/getTicksLimit(t,n));let l,c,u,d,p,h,f,A,m,g,y,v=0,b=0;for(l=0;l<t;l+=s){if(d=e[l].label,p=this._resolveTickFontOptions(l),r.font=h=p.string,f=o[h]=o[h]||{data:{},gc:[]},A=p.lineHeight,m=g=0,isNullOrUndef(d)||isArray$4(d)){if(isArray$4(d))for(c=0,u=d.length;c<u;++c)y=d[c],isNullOrUndef(y)||isArray$4(y)||(m=_measureText(r,f.data,f.gc,m,y),g+=A)}else m=_measureText(r,f.data,f.gc,m,d),g=A;i.push(m),a.push(g),v=Math.max(m,v),b=Math.max(g,b)}garbageCollect(o,t);const x=i.indexOf(v),w=a.indexOf(b),C=e=>({width:i[e]||0,height:a[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(w),widths:i,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const n=t[e];return n.$context||(n.$context=createTickContext(this.getContext(),e,n))}return this.$context||(this.$context=createScaleContext(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=toRadians(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),o=this._getLabelSizes(),i=e.autoSkipPadding||0,a=o?o.widest.width+i:0,s=o?o.highest.height+i:0;return this.isHorizontal()?s*n>a*r?a/n:s/r:s*r<a*n?s/n:a/r}_isVisible(){const e=this.options.display;return"auto"!==e?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,n=this.chart,r=this.options,{grid:o,position:i,border:a}=r,s=o.offset,l=this.isHorizontal(),c=this.ticks.length+(s?1:0),u=getTickMarkLength(o),d=[],p=a.setContext(this.getContext()),h=p.display?p.width:0,f=h/2,A=function(e){return _alignPixel(n,e,h)};let m,g,y,v,b,x,w,C,$,_,S,E;if("top"===i)m=A(this.bottom),x=this.bottom-u,C=m-f,_=A(e.top)+f,E=e.bottom;else if("bottom"===i)m=A(this.top),_=e.top,E=A(e.bottom)-f,x=m+f,C=this.top+u;else if("left"===i)m=A(this.right),b=this.right-u,w=m-f,$=A(e.left)+f,S=e.right;else if("right"===i)m=A(this.left),$=e.left,S=A(e.right)-f,b=m+f,w=this.left+u;else if("x"===t){if("center"===i)m=A((e.top+e.bottom)/2+.5);else if(isObject$3(i)){const e=Object.keys(i)[0],t=i[e];m=A(this.chart.scales[e].getPixelForValue(t))}_=e.top,E=e.bottom,x=m+f,C=x+u}else if("y"===t){if("center"===i)m=A((e.left+e.right)/2);else if(isObject$3(i)){const e=Object.keys(i)[0],t=i[e];m=A(this.chart.scales[e].getPixelForValue(t))}b=m-f,w=b-u,$=e.left,S=e.right}const k=valueOrDefault(r.ticks.maxTicksLimit,c),B=Math.max(1,Math.ceil(c/k));for(g=0;g<c;g+=B){const e=this.getContext(g),t=o.setContext(e),r=a.setContext(e),i=t.lineWidth,c=t.color,u=r.dash||[],p=r.dashOffset,h=t.tickWidth,f=t.tickColor,A=t.tickBorderDash||[],m=t.tickBorderDashOffset;y=getPixelForGridLine(this,g,s),void 0!==y&&(v=_alignPixel(n,y,i),l?b=w=$=S=v:x=C=_=E=v,d.push({tx1:b,ty1:x,tx2:w,ty2:C,x1:$,y1:_,x2:S,y2:E,width:i,color:c,borderDash:u,borderDashOffset:p,tickWidth:h,tickColor:f,tickBorderDash:A,tickBorderDashOffset:m}))}return this._ticksLength=c,this._borderValue=m,d}_computeLabelItems(e){const t=this.axis,n=this.options,{position:r,ticks:o}=n,i=this.isHorizontal(),a=this.ticks,{align:s,crossAlign:l,padding:c,mirror:u}=o,d=getTickMarkLength(n.grid),p=d+c,h=u?-c:p,f=-toRadians(this.labelRotation),A=[];let m,g,y,v,b,x,w,C,$,_,S,E,k="middle";if("top"===r)x=this.bottom-h,w=this._getXAxisLabelAlignment();else if("bottom"===r)x=this.top+h,w=this._getXAxisLabelAlignment();else if("left"===r){const e=this._getYAxisLabelAlignment(d);w=e.textAlign,b=e.x}else if("right"===r){const e=this._getYAxisLabelAlignment(d);w=e.textAlign,b=e.x}else if("x"===t){if("center"===r)x=(e.top+e.bottom)/2+p;else if(isObject$3(r)){const e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)+p}w=this._getXAxisLabelAlignment()}else if("y"===t){if("center"===r)b=(e.left+e.right)/2-p;else if(isObject$3(r)){const e=Object.keys(r)[0],t=r[e];b=this.chart.scales[e].getPixelForValue(t)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===t&&("start"===s?k="top":"end"===s&&(k="bottom"));const B=this._getLabelSizes();for(m=0,g=a.length;m<g;++m){y=a[m],v=y.label;const e=o.setContext(this.getContext(m));C=this.getPixelForTick(m)+o.labelOffset,$=this._resolveTickFontOptions(m),_=$.lineHeight,S=isArray$4(v)?v.length:1;const t=S/2,n=e.color,s=e.textStrokeColor,c=e.textStrokeWidth;let d,p=w;if(i?(b=C,"inner"===w&&(p=m===g-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),E="top"===r?"near"===l||0!==f?-S*_+_/2:"center"===l?-B.highest.height/2-t*_+_:-B.highest.height+_/2:"near"===l||0!==f?_/2:"center"===l?B.highest.height/2-t*_:B.highest.height-S*_,u&&(E*=-1),0===f||e.showLabelBackdrop||(b+=_/2*Math.sin(f))):(x=C,E=(1-S)*_/2),e.showLabelBackdrop){const t=toPadding(e.backdropPadding),n=B.heights[m],r=B.widths[m];let o=E-t.top,i=0-t.left;switch(k){case"middle":o-=n/2;break;case"bottom":o-=n}switch(w){case"center":i-=r/2;break;case"right":i-=r;break;case"inner":m===g-1?i-=r:m>0&&(i-=r/2)}d={left:i,top:o,width:r+t.width,height:n+t.height,color:e.backdropColor}}A.push({label:v,font:$,textOffset:E,options:{rotation:f,color:n,strokeColor:s,strokeWidth:c,textAlign:p,textBaseline:k,translation:[b,x],backdrop:d}})}return A}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-toRadians(this.labelRotation))return"top"===e?"left":"right";let n="center";return"start"===t.align?n="left":"end"===t.align?n="right":"inner"===t.align&&(n="inner"),n}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:n,mirror:r,padding:o}}=this.options,i=e+o,a=this._getLabelSizes().widest.width;let s,l;return"left"===t?r?(l=this.right+o,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l+=a)):(l=this.right-i,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l=this.left)):"right"===t?r?(l=this.left+o,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l-=a)):(l=this.left+i,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l=this.right)):s="right",{textAlign:s,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;return"left"===t||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:n,top:r,width:o,height:i}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,o,i),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const n=this.ticks.findIndex(t=>t.value===e);if(n>=0){return t.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(e){const t=this.options.grid,n=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,i;const a=(e,t,r)=>{r.width&&r.color&&(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(o=0,i=r.length;o<i;++o){const e=r[o];t.drawOnChartArea&&a({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&a({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:n,grid:r}}=this,o=n.setContext(this.getContext()),i=n.display?o.width:0;if(!i)return;const a=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue;let l,c,u,d;this.isHorizontal()?(l=_alignPixel(e,this.left,i)-i/2,c=_alignPixel(e,this.right,a)+a/2,u=d=s):(u=_alignPixel(e,this.top,i)-i/2,d=_alignPixel(e,this.bottom,a)+a/2,l=c=s),t.save(),t.lineWidth=o.width,t.strokeStyle=o.color,t.beginPath(),t.moveTo(l,u),t.lineTo(c,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const t=this.ctx,n=this._computeLabelArea();n&&clipArea(t,n);const r=this.getLabelItems(e);for(const o of r){const e=o.options,n=o.font;renderText$1(t,o.label,0,o.textOffset,n,e)}n&&unclipArea(t)}drawTitle(){const{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;const o=toFont(n.font),i=toPadding(n.padding),a=n.align;let s=o.lineHeight/2;"bottom"===t||"center"===t||isObject$3(t)?(s+=i.bottom,isArray$4(n.text)&&(s+=o.lineHeight*(n.text.length-1))):s+=i.top;const{titleX:l,titleY:c,maxWidth:u,rotation:d}=titleArgs(this,s,t,a);renderText$1(e,n.text,0,0,o,{color:n.color,maxWidth:u,rotation:d,textAlign:titleAlign(a,t,r),textBaseline:"middle",translation:[l,c]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,n=valueOrDefault(e.grid&&e.grid.z,-1),r=valueOrDefault(e.border&&e.border.z,0);return this._isVisible()&&this.draw===Scale.prototype.draw?[{z:n,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:t,draw:e=>{this.drawLabels(e)}}]:[{z:t,draw:e=>{this.draw(e)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",r=[];let o,i;for(o=0,i=t.length;o<i;++o){const i=t[o];i[n]!==this.id||e&&i.type!==e||r.push(i)}return r}_resolveTickFontOptions(e){return toFont(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class TypedRegistry{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let n;isIChartComponent(t)&&(n=this.register(t));const r=this.items,o=e.id,i=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in r||(r[o]=e,registerDefaults(e,i,n),this.override&&defaults$2.override(e.id,e.overrides)),i}get(e){return this.items[e]}unregister(e){const t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in defaults$2[r]&&(delete defaults$2[r][n],this.override&&delete overrides[n])}}function registerDefaults(e,t,n){const r=merge$1(Object.create(null),[n?defaults$2.get(n):{},defaults$2.get(t),e.defaults]);defaults$2.set(t,r),e.defaultRoutes&&routeDefaults(t,e.defaultRoutes),e.descriptors&&defaults$2.describe(t,e.descriptors)}function routeDefaults(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),o=r.pop(),i=[e].concat(r).join("."),a=t[n].split("."),s=a.pop(),l=a.join(".");defaults$2.route(i,o,l,s)})}function isIChartComponent(e){return"id"in e&&"defaults"in e}class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element$2,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,n){[...t].forEach(t=>{const r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):each$1(t,t=>{const r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){const r=_capitalize(e);callback(n["before"+r],[],n),t[e](n),callback(n["after"+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){const r=t.get(e);if(void 0===r)throw new Error('"'+e+'" is not a registered '+n+".");return r}}var registry=new Registry;class PluginService{constructor(){this._init=[]}notify(e,t,n,r){"beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=r?this._descriptors(e).filter(r):this._descriptors(e),i=this._notify(o,e,t,n);return"afterDestroy"===t&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),i}_notify(e,t,n,r){r=r||{};for(const o of e){const e=o.plugin;if(!1===callback(e[n],[t,r,o.options],e)&&r.cancelable)return!1}return!0}invalidate(){isNullOrUndef(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const n=e&&e.config,r=valueOrDefault(n.options&&n.options.plugins,{}),o=allPlugins(n);return!1!==r||t?createDescriptors(e,o,r,t):[]}_notifyStateChanges(e){const t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,"stop"),this._notify(r(n,t),e,"start")}}function allPlugins(e){const t={},n=[],r=Object.keys(registry.plugins.items);for(let i=0;i<r.length;i++)n.push(registry.getPlugin(r[i]));const o=e.plugins||[];for(let i=0;i<o.length;i++){const e=o[i];-1===n.indexOf(e)&&(n.push(e),t[e.id]=!0)}return{plugins:n,localIds:t}}function getOpts(e,t){return t||!1!==e?!0===e?{}:e:null}function createDescriptors(e,{plugins:t,localIds:n},r,o){const i=[],a=e.getContext();for(const s of t){const t=s.id,l=getOpts(r[t],o);null!==l&&i.push({plugin:s,options:pluginOpts(e.config,{plugin:s,local:n[t]},l,a)})}return i}function pluginOpts(e,{plugin:t,local:n},r,o){const i=e.pluginScopeKeys(t),a=e.getOptionScopes(r,i);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function getIndexAxis(e,t){const n=defaults$2.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function getAxisFromDefaultScaleID(e,t){let n=e;return"_index_"===e?n=t:"_value_"===e&&(n="x"===t?"y":"x"),n}function getDefaultScaleIDFromAxis(e,t){return e===t?"_index_":"_value_"}function idMatchesAxis(e){if("x"===e||"y"===e||"r"===e)return e}function axisFromPosition(e){return"top"===e||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0}function determineAxis(e,...t){if(idMatchesAxis(e))return e;for(const n of t){const t=n.axis||axisFromPosition(n.position)||e.length>1&&idMatchesAxis(e[0].toLowerCase());if(t)return t}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function getAxisFromDataset(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function retrieveAxisFromDatasets(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return getAxisFromDataset(e,"x",n[0])||getAxisFromDataset(e,"y",n[0])}return{}}function mergeScaleConfig(e,t){const n=overrides[e.type]||{scales:{}},r=t.scales||{},o=getIndexAxis(e.type,t),i=Object.create(null);return Object.keys(r).forEach(t=>{const a=r[t];if(!isObject$3(a))return console.error(`Invalid scale configuration for scale: ${t}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const s=determineAxis(t,a,retrieveAxisFromDatasets(t,e),defaults$2.scales[a.type]),l=getDefaultScaleIDFromAxis(s,o),c=n.scales||{};i[t]=mergeIf(Object.create(null),[{axis:s},a,c[s],c[l]])}),e.data.datasets.forEach(n=>{const o=n.type||e.type,a=n.indexAxis||getIndexAxis(o,t),s=(overrides[o]||{}).scales||{};Object.keys(s).forEach(e=>{const t=getAxisFromDefaultScaleID(e,a),o=n[t+"AxisID"]||t;i[o]=i[o]||Object.create(null),mergeIf(i[o],[{axis:t},r[o],s[e]])})}),Object.keys(i).forEach(e=>{const t=i[e];mergeIf(t,[defaults$2.scales[t.type],defaults$2.scale])}),i}function initOptions(e){const t=e.options||(e.options={});t.plugins=valueOrDefault(t.plugins,{}),t.scales=mergeScaleConfig(e,t)}function initData(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}function initConfig(e){return(e=e||{}).data=initData(e.data),initOptions(e),e}const keyCache=new Map,keysCached=new Set;function cachedKeys(e,t){let n=keyCache.get(e);return n||(n=t(),keyCache.set(e,n),keysCached.add(n)),n}const addIfFound=(e,t,n)=>{const r=resolveObjectKey(t,n);void 0!==r&&e.add(r)};class Config{constructor(e){this._config=initConfig(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=initData(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),initOptions(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return cachedKeys(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return cachedKeys(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return cachedKeys(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id;return cachedKeys(`${this.type}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const n=this._scopeCache;let r=n.get(e);return r&&!t||(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){const{options:r,type:o}=this,i=this._cachedScopes(e,n),a=i.get(t);if(a)return a;const s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>addIfFound(s,e,t))),t.forEach(e=>addIfFound(s,r,e)),t.forEach(e=>addIfFound(s,overrides[o]||{},e)),t.forEach(e=>addIfFound(s,defaults$2,e)),t.forEach(e=>addIfFound(s,descriptors,e))});const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),keysCached.has(t)&&i.set(t,l),l}chartOptionScopes(){const{options:e,type:t}=this;return[e,overrides[t]||{},defaults$2.datasets[t]||{},{type:t},defaults$2,descriptors]}resolveNamedOptions(e,t,n,r=[""]){const o={$shared:!0},{resolver:i,subPrefixes:a}=getResolver(this._resolverCache,e,r);let s=i;if(needContext(i,t)){o.$shared=!1;s=_attachContext(i,n=isFunction$1(n)?n():n,this.createResolver(e,n,a))}for(const l of t)o[l]=s[l];return o}createResolver(e,t,n=[""],r){const{resolver:o}=getResolver(this._resolverCache,e,n);return isObject$3(t)?_attachContext(o,t,void 0,r):o}}function getResolver(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const o=n.join();let i=r.get(o);if(!i){i={resolver:_createResolver(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes("hover"))},r.set(o,i)}return i}const hasFunction=e=>isObject$3(e)&&Object.getOwnPropertyNames(e).some(t=>isFunction$1(e[t]));function needContext(e,t){const{isScriptable:n,isIndexable:r}=_descriptors(e);for(const o of t){const t=n(o),i=r(o),a=(i||t)&&e[o];if(t&&(isFunction$1(a)||hasFunction(a))||i&&isArray$4(a))return!0}return!1}var version$1="4.4.1";const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(e,t){return"top"===e||"bottom"===e||-1===KNOWN_POSITIONS.indexOf(e)&&"x"===t}function compare2Level(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function onAnimationsComplete(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),callback(n&&n.onComplete,[e],t)}function onAnimationProgress(e){const t=e.chart,n=t.options.animation;callback(n&&n.onProgress,[e],t)}function getCanvas(e){return _isDomSupported()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const instances={},getChart=e=>{const t=getCanvas(e);return Object.values(instances).filter(e=>e.canvas===t).pop()};function moveNumericKeys(e,t,n){const r=Object.keys(e);for(const o of r){const r=+o;if(r>=t){const i=e[o];delete e[o],(n>0||r>t)&&(e[r+n]=i)}}}function determineLastEvent(e,t,n,r){return n&&"mouseout"!==e.type?r?t:e:null}function getSizeForArea(e,t,n){return e.options.clip?e[n]:t[n]}function getDatasetArea(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:getSizeForArea(n,t,"left"),right:getSizeForArea(n,t,"right"),top:getSizeForArea(r,t,"top"),bottom:getSizeForArea(r,t,"bottom")}:t}let Chart$1=class{static defaults=defaults$2;static instances=instances;static overrides=overrides;static registry=registry;static version=version$1;static getChart=getChart;static register(...e){registry.add(...e),invalidatePlugins()}static unregister(...e){registry.remove(...e),invalidatePlugins()}constructor(e,t){const n=this.config=new Config(t),r=getCanvas(e),o=getChart(r);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const i=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||_detectPlatform(r)),this.platform.updateConfig(n);const a=this.platform.acquireContext(r,i.aspectRatio),s=a&&a.canvas,l=s&&s.height,c=s&&s.width;this.id=uid(),this.ctx=a,this.canvas=s,this.width=c,this.height=l,this._options=i,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 PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce(e=>this.update(e),i.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,a&&s?(animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:o}=this;return isNullOrUndef(e)?t&&o?o:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return registry}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(e,t){animator.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const n=this.options,r=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(r,e,t,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,retinaScale(this,a,!0)&&(this.notifyPlugins("resize",{size:i}),callback(n.onResize,[this,i],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){each$1(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){const e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{});let o=[];t&&(o=o.concat(Object.keys(t).map(e=>{const n=t[e],r=determineAxis(e,n),o="r"===r,i="x"===r;return{options:n,dposition:o?"chartArea":i?"bottom":"left",dtype:o?"radialLinear":i?"category":"linear"}}))),each$1(o,t=>{const o=t.options,i=o.id,a=determineAxis(i,o),s=valueOrDefault(o.type,t.dtype);void 0!==o.position&&positionIsHorizontal(o.position,a)===positionIsHorizontal(t.dposition)||(o.position=t.dposition),r[i]=!0;let l=null;if(i in n&&n[i].type===s)l=n[i];else{l=new(registry.getScale(s))({id:i,type:s,ctx:this.ctx,chart:this}),n[l.id]=l}l.init(o,e)}),each$1(r,(e,t)=>{e||delete n[t]}),each$1(n,e=>{layouts.configure(this,e,e.options),layouts.addBox(this,e)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(compare2Level("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{0===t.filter(t=>t===e._dataset).length&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){const r=t[n];let o=this.getDatasetMeta(n);const i=r.type||this.config.type;if(o.type&&o.type!==i&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=i,o.indexAxis=r.indexAxis||getIndexAxis(i,this.options),o.order=r.order||0,o.index=n,o.label=""+r.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const t=registry.getController(i),{datasetElementType:r,dataElementType:a}=defaults$2.datasets[i];Object.assign(t,{dataElementType:registry.getElement(a),datasetElementType:r&®istry.getElement(r)}),o.controller=new t(this,n),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){each$1(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let l=0,c=this.data.datasets.length;l<c;l++){const{controller:e}=this.getDatasetMeta(l),t=!r&&-1===o.indexOf(e);e.buildOrUpdateElements(t),i=Math.max(+e.getMaxOverflow(),i)}i=this._minPadding=n.layout.autoPadding?i:0,this._updateLayout(i),r||each$1(o,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(compare2Level("z","_idx"));const{_active:a,_lastEvent:s}=this;s?this._eventHandler(s,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){each$1(this.scales,e=>{layouts.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),n=new Set(e.events);setsEqual(t,n)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:n,start:r,count:o}of t){moveNumericKeys(e,r,"_removeElements"===n?-o:o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+","+e.splice(1).join(","))),r=n(0);for(let o=1;o<t;o++)if(!setsEqual(r,n(o)))return;return Array.from(r).map(e=>e.split(",")).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;layouts.update(this,this.width,this.height,e);const t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],each$1(this.boxes,e=>{n&&"chartArea"===e.position||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,isFunction$1(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",r)&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(animator.has(this)?this.attached&&!animator.running(this)&&animator.start(this):(this.draw(),onAnimationsComplete({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:e,height:t}=this._resizeBeforeDraw;this._resize(e,t),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,n=[];let r,o;for(r=0,o=t.length;r<o;++r){const o=t[r];e&&!o.visible||n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,n=e._clip,r=!n.disabled,o=getDatasetArea(e,this.chartArea),i={meta:e,index:e.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(r&&clipArea(t,{left:!1===n.left?0:o.left-n.left,right:!1===n.right?this.width:o.right+n.right,top:!1===n.top?0:o.top-n.top,bottom:!1===n.bottom?this.height:o.bottom+n.bottom}),e.controller.draw(),r&&unclipArea(t),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(e){return _isPointInArea(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){const o=Interaction.modes[t];return"function"==typeof o?o(this,e,n,r):[]}getDatasetMeta(e){const t=this.data.datasets[e],n=this._metasets;let r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const n=this.getDatasetMeta(e);return"boolean"==typeof n.hidden?!n.hidden:!t.hidden}setDatasetVisibility(e,t){this.getDatasetMeta(e).hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){const r=n?"show":"hide",o=this.getDatasetMeta(e),i=o.controller._resolveAnimations(void 0,r);defined(t)?(o.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),i.update(o,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),animator.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),clearCanvas(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete instances[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};each$1(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},o=(e,t)=>{this.canvas&&this.resize(e,t)};let i;const a=()=>{r("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",i)};i=()=>{this.attached=!1,r("resize",o),this._stop(),this._resize(0,0),n("attach",a)},t.isAttached(this.canvas)?a():i()}unbindEvents(){each$1(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},each$1(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){const r=n?"set":"remove";let o,i,a,s;for("dataset"===t&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+r+"DatasetHoverStyle"]()),a=0,s=e.length;a<s;++a){i=e[a];const t=i&&this.getDatasetMeta(i.datasetIndex).controller;t&&t[r+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{const n=this.getDatasetMeta(e);if(!n)throw new Error("No dataset found at index "+e);return{datasetIndex:e,element:n.data[t],index:t}});!_elementsEqual(n,t)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return 1===this._plugins._cache.filter(t=>t.plugin.id===e).length}_updateHoverStyles(e,t,n){const r=this.options.hover,o=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),i=o(t,e),a=n?e:o(e,t);i.length&&this.updateHoverStyle(i,r.mode,!1),a.length&&r.mode&&this.updateHoverStyle(a,r.mode,!0)}_eventHandler(e,t){const n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",n,r))return;const o=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,r),(o||n.changed)&&this.render(),this}_handleEvent(e,t,n){const{_active:r=[],options:o}=this,i=t,a=this._getActiveElements(e,r,n,i),s=_isClickEvent(e),l=determineLastEvent(e,this._lastEvent,n,s);n&&(this._lastEvent=null,callback(o.onHover,[e,a,this],this),s&&callback(o.onClick,[e,a,this],this));const c=!_elementsEqual(a,r);return(c||t)&&(this._active=a,this._updateHoverStyles(a,r,t)),this._lastEvent=l,c}_getActiveElements(e,t,n,r){if("mouseout"===e.type)return[];if(!n)return t;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,r)}};function invalidatePlugins(){return each$1(Chart$1.instances,e=>e._plugins.invalidate())}function clipArc(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:a,outerRadius:s,innerRadius:l}=t;let c=o/s;e.beginPath(),e.arc(i,a,s,r-c,n+c),l>o?(c=o/l,e.arc(i,a,l,n+c,r-c,!0)):e.arc(i,a,o,n+HALF_PI,r-HALF_PI),e.closePath(),e.clip()}function toRadiusCorners(e){return _readValueToProps(e,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(e,t,n,r){const o=toRadiusCorners(e.options.borderRadius),i=(n-t)/2,a=Math.min(i,r*t/2),s=e=>{const t=(n-Math.min(i,e))*r/2;return _limitValue(e,0,Math.min(i,t))};return{outerStart:s(o.outerStart),outerEnd:s(o.outerEnd),innerStart:_limitValue(o.innerStart,0,a),innerEnd:_limitValue(o.innerEnd,0,a)}}function rThetaToXY(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function pathArc(e,t,n,r,o,i){const{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),p=u>0?u+r+n+c:0;let h=0;const f=o-l;if(r){const e=((u>0?u-r:0)+(d>0?d-r:0))/2;h=(f-(0!==e?f*e/(e+r):f))/2}const A=(f-Math.max(.001,f*d-n/PI)/d)/2,m=l+A+h,g=o-A-h,{outerStart:y,outerEnd:v,innerStart:b,innerEnd:x}=parseBorderRadius$1(t,p,d,g-m),w=d-y,C=d-v,$=m+y/w,_=g-v/C,S=p+b,E=p+x,k=m+b/S,B=g-x/E;if(e.beginPath(),i){const t=($+_)/2;if(e.arc(a,s,d,$,t),e.arc(a,s,d,t,_),v>0){const t=rThetaToXY(C,_,a,s);e.arc(t.x,t.y,v,_,g+HALF_PI)}const n=rThetaToXY(E,g,a,s);if(e.lineTo(n.x,n.y),x>0){const t=rThetaToXY(E,B,a,s);e.arc(t.x,t.y,x,g+HALF_PI,B+Math.PI)}const r=(g-x/p+(m+b/p))/2;if(e.arc(a,s,p,g-x/p,r,!0),e.arc(a,s,p,r,m+b/p,!0),b>0){const t=rThetaToXY(S,k,a,s);e.arc(t.x,t.y,b,k+Math.PI,m-HALF_PI)}const o=rThetaToXY(w,m,a,s);if(e.lineTo(o.x,o.y),y>0){const t=rThetaToXY(w,$,a,s);e.arc(t.x,t.y,y,m-HALF_PI,$)}}else{e.moveTo(a,s);const t=Math.cos($)*d+a,n=Math.sin($)*d+s;e.lineTo(t,n);const r=Math.cos(_)*d+a,o=Math.sin(_)*d+s;e.lineTo(r,o)}e.closePath()}function drawArc(e,t,n,r,o){const{fullCircles:i,startAngle:a,circumference:s}=t;let l=t.endAngle;if(i){pathArc(e,t,n,r,l,o);for(let t=0;t<i;++t)e.fill();isNaN(s)||(l=a+(s%TAU||TAU))}return pathArc(e,t,n,r,l,o),e.fill(),l}function drawBorder(e,t,n,r,o){const{fullCircles:i,startAngle:a,circumference:s,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:p}=l,h="inner"===l.borderAlign;if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=p,h?(e.lineWidth=2*c,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let f=t.endAngle;if(i){pathArc(e,t,n,r,f,o);for(let t=0;t<i;++t)e.stroke();isNaN(s)||(f=a+(s%TAU||TAU))}h&&clipArc(e,t,f),i||(pathArc(e,t,n,r,f,o),e.stroke())}class ArcElement extends Element$2{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){const r=this.getProps(["x","y"],n),{angle:o,distance:i}=getAngleFromPoint(r,{x:e,y:t}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=(this.options.spacing+this.options.borderWidth)/2,p=valueOrDefault(u,s-a)>=TAU||_angleBetween(o,a,s),h=_isBetween(i,l+d,c+d);return p&&h}getCenterPoint(e){const{x:t,y:n,startAngle:r,endAngle:o,innerRadius:i,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:s,spacing:l}=this.options,c=(r+o)/2,u=(i+a+l+s)/2;return{x:t+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:n}=this,r=(t.offset||0)/4,o=(t.spacing||0)/2,i=t.circular;if(this.pixelMargin="inner"===t.borderAlign?.33:0,this.fullCircles=n>TAU?Math.floor(n/TAU):0,0===n||this.innerRadius<0||this.outerRadius<0)return;e.save();const a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*r,Math.sin(a)*r);const s=r*(1-Math.sin(Math.min(PI,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,drawArc(e,this,s,o,i),drawBorder(e,this,s,o,i),e.restore()}}function setStyle(e,t,n=t){e.lineCap=valueOrDefault(n.borderCapStyle,t.borderCapStyle),e.setLineDash(valueOrDefault(n.borderDash,t.borderDash)),e.lineDashOffset=valueOrDefault(n.borderDashOffset,t.borderDashOffset),e.lineJoin=valueOrDefault(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=valueOrDefault(n.borderWidth,t.borderWidth),e.strokeStyle=valueOrDefault(n.borderColor,t.borderColor)}function lineTo(e,t,n){e.lineTo(n.x,n.y)}function getLineMethod(e){return e.stepped?_steppedLineTo:e.tension||"monotone"===e.cubicInterpolationMode?_bezierCurveTo:lineTo}function pathVars(e,t,n={}){const r=e.length,{start:o=0,end:i=r-1}=n,{start:a,end:s}=t,l=Math.max(o,a),c=Math.min(i,s),u=o<a&&i<a||o>s&&i>s;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function pathSegment(e,t,n,r){const{points:o,options:i}=t,{count:a,start:s,loop:l,ilen:c}=pathVars(o,n,r),u=getLineMethod(i);let d,p,h,{move:f=!0,reverse:A}=r||{};for(d=0;d<=c;++d)p=o[(s+(A?c-d:d))%a],p.skip||(f?(e.moveTo(p.x,p.y),f=!1):u(e,h,p,A,i.stepped),h=p);return l&&(p=o[(s+(A?c:0))%a],u(e,h,p,A,i.stepped)),!!l}function fastPathSegment(e,t,n,r){const o=t.points,{count:i,start:a,ilen:s}=pathVars(o,n,r),{move:l=!0,reverse:c}=r||{};let u,d,p,h,f,A,m=0,g=0;const y=e=>(a+(c?s-e:e))%i,v=()=>{h!==f&&(e.lineTo(m,f),e.lineTo(m,h),e.lineTo(m,A))};for(l&&(d=o[y(0)],e.moveTo(d.x,d.y)),u=0;u<=s;++u){if(d=o[y(u)],d.skip)continue;const t=d.x,n=d.y,r=0|t;r===p?(n<h?h=n:n>f&&(f=n),m=(g*m+t)/++g):(v(),e.lineTo(t,n),p=r,g=0,h=f=n),A=n}v()}function _getSegmentMethod(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!(e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||n)?fastPathSegment:pathSegment}function _getInterpolationMethod(e){return e.stepped?_steppedInterpolation:e.tension||"monotone"===e.cubicInterpolationMode?_bezierInterpolation:_pointInLine}function strokePathWithCache(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),setStyle(e,t.options),e.stroke(o)}function strokePathDirect(e,t,n,r){const{segments:o,options:i}=t,a=_getSegmentMethod(t);for(const s of o)setStyle(e,i,s.style),e.beginPath(),a(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const usePath2D="function"==typeof Path2D;function draw(e,t,n,r){usePath2D&&!t.options.segment?strokePathWithCache(e,t,n,r):strokePathDirect(e,t,n,r)}class LineElement extends Element$2{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e&&"fill"!==e};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const r=n.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){const n=this.options,r=e[t],o=this.points,i=_boundSegments(this,{property:t,start:r,end:r});if(!i.length)return;const a=[],s=_getInterpolationMethod(n);let l,c;for(l=0,c=i.length;l<c;++l){const{start:c,end:u}=i[l],d=o[c],p=o[u];if(d===p){a.push(d);continue}const h=s(d,p,Math.abs((r-d[t])/(p[t]-d[t])),n.stepped);h[t]=e[t],a.push(h)}return 1===a.length?a[0]:a}pathSegment(e,t,n){return _getSegmentMethod(this)(e,this,t,n)}path(e,t,n){const r=this.segments,o=_getSegmentMethod(this);let i=this._loop;t=t||0,n=n||this.points.length-t;for(const a of r)i&=o(e,this,a,{start:t,end:t+n-1});return!!i}draw(e,t,n,r){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),draw(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function inRange$1(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class PointElement extends Element$2{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){const r=this.options,{x:o,y:i}=this.getProps(["x","y"],n);return Math.pow(e-o,2)+Math.pow(t-i,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,t){return inRange$1(this,e,"x",t)}inYRange(e,t){return inRange$1(this,e,"y",t)}getCenterPoint(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}size(e){let t=(e=e||this.options||{}).radius||0;t=Math.max(t,t&&e.hoverRadius||0);return 2*(t+(t&&e.borderWidth||0))}draw(e,t){const n=this.options;this.skip||n.radius<.1||!_isPointInArea(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,drawPoint(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}function getBarBounds(e,t){const{x:n,y:r,base:o,width:i,height:a}=e.getProps(["x","y","base","width","height"],t);let s,l,c,u,d;return e.horizontal?(d=a/2,s=Math.min(n,o),l=Math.max(n,o),c=r-d,u=r+d):(d=i/2,s=n-d,l=n+d,c=Math.min(r,o),u=Math.max(r,o)),{left:s,top:c,right:l,bottom:u}}function skipOrLimit(e,t,n,r){return e?0:_limitValue(t,n,r)}function parseBorderWidth(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=toTRBL(r);return{t:skipOrLimit(o.top,i.top,0,n),r:skipOrLimit(o.right,i.right,0,t),b:skipOrLimit(o.bottom,i.bottom,0,n),l:skipOrLimit(o.left,i.left,0,t)}}function parseBorderRadius(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=toTRBLCorners(o),a=Math.min(t,n),s=e.borderSkipped,l=r||isObject$3(o);return{topLeft:skipOrLimit(!l||s.top||s.left,i.topLeft,0,a),topRight:skipOrLimit(!l||s.top||s.right,i.topRight,0,a),bottomLeft:skipOrLimit(!l||s.bottom||s.left,i.bottomLeft,0,a),bottomRight:skipOrLimit(!l||s.bottom||s.right,i.bottomRight,0,a)}}function boundingRects(e){const t=getBarBounds(e),n=t.right-t.left,r=t.bottom-t.top,o=parseBorderWidth(e,n/2,r/2),i=parseBorderRadius(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:i},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function inRange(e,t,n,r){const o=null===t,i=null===n,a=e&&!(o&&i)&&getBarBounds(e,r);return a&&(o||_isBetween(t,a.left,a.right))&&(i||_isBetween(n,a.top,a.bottom))}function hasRadius(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function addNormalRectPath(e,t){e.rect(t.x,t.y,t.w,t.h)}function inflateRect(e,t,n={}){const r=e.x!==n.x?-t:0,o=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,a=(e.y+e.h!==n.y+n.h?t:0)-o;return{x:e.x+r,y:e.y+o,w:e.w+i,h:e.h+a,radius:e.radius}}class BarElement extends Element$2{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:n,backgroundColor:r}}=this,{inner:o,outer:i}=boundingRects(this),a=hasRadius(i.radius)?addRoundedRectPath:addNormalRectPath;e.save(),i.w===o.w&&i.h===o.h||(e.beginPath(),a(e,inflateRect(i,t,o)),e.clip(),a(e,inflateRect(o,-t,i)),e.fillStyle=n,e.fill("evenodd")),e.beginPath(),a(e,inflateRect(o,t)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,t,n){return inRange(this,e,t,n)}inXRange(e,t){return inRange(this,e,null,t)}inYRange(e,t){return inRange(this,null,e,t)}getCenterPoint(e){const{x:t,y:n,base:r,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(t+r)/2:t,y:o?n:(n+r)/2}}getRange(e){return"x"===e?this.width/2:this.height/2}}const getBoxSize=(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)}},itemsEqual=(e,t)=>null!==e&&null!==t&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Legend extends Element$2{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=callback(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display)return void(this.width=this.height=0);const n=e.labels,r=toFont(n.font),o=r.size,i=this._computeTitleHeight(),{boxWidth:a,itemHeight:s}=getBoxSize(n,o);let l,c;t.font=r.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(i,o,a,s)+10):(c=this.maxHeight,l=this._fitCols(i,r,a,s)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){const{ctx:o,maxWidth:i,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],c=r+a;let u=e;o.textAlign="left",o.textBaseline="middle";let d=-1,p=-c;return this.legendItems.forEach((e,h)=>{const f=n+t/2+o.measureText(e.text).width;(0===h||l[l.length-1]+f+2*a>i)&&(u+=c,l[l.length-(h>0?0:1)]=0,p+=c,d++),s[h]={left:0,top:p,row:d,width:f,height:r},l[l.length-1]+=f+a}),u}_fitCols(e,t,n,r){const{ctx:o,maxHeight:i,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],c=i-e;let u=a,d=0,p=0,h=0,f=0;return this.legendItems.forEach((e,i)=>{const{itemWidth:A,itemHeight:m}=calculateItemSize(n,t,o,e,r);i>0&&p+m+2*a>c&&(u+=d+a,l.push({width:d,height:p}),h+=d+a,f++,d=p=0),s[i]={left:h,top:p,col:f,width:A,height:m},d=Math.max(d,A),p+=m+a}),u+=d,l.push({width:d,height:p}),u}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:o}}=this,i=getRtlAdapter(o,this.left,this.width);if(this.isHorizontal()){let o=0,a=_alignStartEnd(n,this.left+r,this.right-this.lineWidths[o]);for(const s of t)o!==s.row&&(o=s.row,a=_alignStartEnd(n,this.left+r,this.right-this.lineWidths[o])),s.top+=this.top+e+r,s.left=i.leftForLtr(i.x(a),s.width),a+=s.width+r}else{let o=0,a=_alignStartEnd(n,this.top+e+r,this.bottom-this.columnSizes[o].height);for(const s of t)s.col!==o&&(o=s.col,a=_alignStartEnd(n,this.top+e+r,this.bottom-this.columnSizes[o].height)),s.top=a,s.left+=this.left+r,s.left=i.leftForLtr(i.x(s.left),s.width),a+=s.height+r}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const e=this.ctx;clipArea(e,this),this._draw(),unclipArea(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:o,labels:i}=e,a=defaults$2.color,s=getRtlAdapter(e.rtl,this.left,this.width),l=toFont(i.font),{padding:c}=i,u=l.size,d=u/2;let p;this.drawTitle(),r.textAlign=s.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=l.string;const{boxWidth:h,boxHeight:f,itemHeight:A}=getBoxSize(i,u),m=this.isHorizontal(),g=this._computeTitleHeight();p=m?{x:_alignStartEnd(o,this.left+c,this.right-n[0]),y:this.top+c+g,line:0}:{x:this.left+c,y:_alignStartEnd(o,this.top+g+c,this.bottom-t[0].height),line:0},overrideTextDirection(this.ctx,e.textDirection);const y=A+c;this.legendItems.forEach((v,b)=>{r.strokeStyle=v.fontColor,r.fillStyle=v.fontColor;const x=r.measureText(v.text).width,w=s.textAlign(v.textAlign||(v.textAlign=i.textAlign)),C=h+d+x;let $=p.x,_=p.y;s.setWidth(this.width),m?b>0&&$+C+c>this.right&&(_=p.y+=y,p.line++,$=p.x=_alignStartEnd(o,this.left+c,this.right-n[p.line])):b>0&&_+y>this.bottom&&($=p.x=$+t[p.line].width+c,p.line++,_=p.y=_alignStartEnd(o,this.top+g+c,this.bottom-t[p.line].height));if(function(e,t,n){if(isNaN(h)||h<=0||isNaN(f)||f<0)return;r.save();const o=valueOrDefault(n.lineWidth,1);if(r.fillStyle=valueOrDefault(n.fillStyle,a),r.lineCap=valueOrDefault(n.lineCap,"butt"),r.lineDashOffset=valueOrDefault(n.lineDashOffset,0),r.lineJoin=valueOrDefault(n.lineJoin,"miter"),r.lineWidth=o,r.strokeStyle=valueOrDefault(n.strokeStyle,a),r.setLineDash(valueOrDefault(n.lineDash,[])),i.usePointStyle){const a={radius:f*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:o},l=s.xPlus(e,h/2);drawPointLegend(r,a,l,t+d,i.pointStyleWidth&&h)}else{const i=t+Math.max((u-f)/2,0),a=s.leftForLtr(e,h),l=toTRBLCorners(n.borderRadius);r.beginPath(),Object.values(l).some(e=>0!==e)?addRoundedRectPath(r,{x:a,y:i,w:h,h:f,radius:l}):r.rect(a,i,h,f),r.fill(),0!==o&&r.stroke()}r.restore()}(s.x($),_,v),$=_textX(w,$+h+d,m?$+C:this.right,e.rtl),function(e,t,n){renderText$1(r,n.text,e,t+A/2,l,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})}(s.x($),_,v),m)p.x+=C+c;else if("string"!=typeof v.text){const e=l.lineHeight;p.y+=calculateLegendItemHeight(v,e)+c}else p.y+=y}),restoreTextDirection(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,n=toFont(t.font),r=toPadding(t.padding);if(!t.display)return;const o=getRtlAdapter(e.rtl,this.left,this.width),i=this.ctx,a=t.position,s=n.size/2,l=r.top+s;let c,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,u=_alignStartEnd(e.align,u,this.right-d);else{const t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);c=l+_alignStartEnd(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}const p=_alignStartEnd(a,u,u+d);i.textAlign=o.textAlign(_toLeftRightCenter(a)),i.textBaseline="middle",i.strokeStyle=t.color,i.fillStyle=t.color,i.font=n.string,renderText$1(i,t.text,p,c,n)}_computeTitleHeight(){const e=this.options.title,t=toFont(e.font),n=toPadding(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,o;if(_isBetween(e,this.left,this.right)&&_isBetween(t,this.top,this.bottom))for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(r=o[n],_isBetween(e,r.left,r.left+r.width)&&_isBetween(t,r.top,r.top+r.height))return this.legendItems[n];return null}handleEvent(e){const t=this.options;if(!isListened(e.type,t))return;const n=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){const r=this._hoveredItem,o=itemsEqual(r,n);r&&!o&&callback(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!o&&callback(t.onHover,[e,n,this],this)}else n&&callback(t.onClick,[e,n,this],this)}}function calculateItemSize(e,t,n,r,o){return{itemWidth:calculateItemWidth(r,e,t,n),itemHeight:calculateItemHeight(o,r,t.lineHeight)}}function calculateItemWidth(e,t,n,r){let o=e.text;return o&&"string"!=typeof o&&(o=o.reduce((e,t)=>e.length>t.length?e:t)),t+n.size/2+r.measureText(o).width}function calculateItemHeight(e,t,n){let r=e;return"string"!=typeof t.text&&(r=calculateLegendItemHeight(t,n)),r}function calculateLegendItemHeight(e,t){return t*(e.text?e.text.length:0)}function isListened(e,t){return!("mousemove"!==e&&"mouseout"!==e||!t.onHover&&!t.onLeave)||!(!t.onClick||"click"!==e&&"mouseup"!==e)}var plugin_legend={id:"legend",_element:Legend,start(e,t,n){const r=e.legend=new Legend({ctx:e.ctx,options:n,chart:e});layouts.configure(e,r,n),layouts.addBox(e,r)},stop(e){layouts.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;layouts.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,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),t.hidden=!0):(o.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:o,color:i,useBorderRadius:a,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{const l=e.controller.getStyle(n?0:void 0),c=toPadding(l.borderWidth);return{text:t[e.index].label,fillStyle:l.backgroundColor,fontColor:i,hidden:!e.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:o||l.textAlign,borderRadius:a&&(s||l.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Title extends Element$2{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t){const n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=e,this.height=this.bottom=t;const r=isArray$4(n.text)?n.text.length:1;this._padding=toPadding(n.padding);const o=r*toFont(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return"top"===e||"bottom"===e}_drawArgs(e){const{top:t,left:n,bottom:r,right:o,options:i}=this,a=i.align;let s,l,c,u=0;return this.isHorizontal()?(l=_alignStartEnd(a,n,o),c=t+e,s=o-n):("left"===i.position?(l=n+e,c=_alignStartEnd(a,r,t),u=-.5*PI):(l=o-e,c=_alignStartEnd(a,t,r),u=.5*PI),s=r-t),{titleX:l,titleY:c,maxWidth:s,rotation:u}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const n=toFont(t.font),r=n.lineHeight/2+this._padding.top,{titleX:o,titleY:i,maxWidth:a,rotation:s}=this._drawArgs(r);renderText$1(e,t.text,0,0,n,{color:t.color,maxWidth:a,rotation:s,textAlign:_toLeftRightCenter(t.align),textBaseline:"middle",translation:[o,i]})}}function createTitle(e,t){const n=new Title({ctx:e.ctx,options:t,chart:e});layouts.configure(e,n,t),layouts.addBox(e,n),e.titleBlock=n}var plugin_title={id:"title",_element:Title,start(e,t,n){createTitle(e,n)},stop(e){const t=e.titleBlock;layouts.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;layouts.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 positioners={average(e){if(!e.length)return!1;let t,n,r=0,o=0,i=0;for(t=0,n=e.length;t<n;++t){const n=e[t].element;if(n&&n.hasValue()){const e=n.tooltipPosition();r+=e.x,o+=e.y,++i}}return{x:r/i,y:o/i}},nearest(e,t){if(!e.length)return!1;let n,r,o,i=t.x,a=t.y,s=Number.POSITIVE_INFINITY;for(n=0,r=e.length;n<r;++n){const r=e[n].element;if(r&&r.hasValue()){const e=distanceBetweenPoints(t,r.getCenterPoint());e<s&&(s=e,o=r)}}if(o){const e=o.tooltipPosition();i=e.x,a=e.y}return{x:i,y:a}}};function pushOrConcat(e,t){return t&&(isArray$4(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function splitNewlines(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function createTooltipItem(e,t){const{element:n,datasetIndex:r,index:o}=t,i=e.getDatasetMeta(r).controller,{label:a,value:s}=i.getLabelAndValue(o);return{chart:e,label:a,parsed:i.getParsed(o),raw:e.data.datasets[r].data[o],formattedValue:s,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function getTooltipSize(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:a,boxHeight:s}=t,l=toFont(t.bodyFont),c=toFont(t.titleFont),u=toFont(t.footerFont),d=i.length,p=o.length,h=r.length,f=toPadding(t.padding);let A=f.height,m=0,g=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(g+=e.beforeBody.length+e.afterBody.length,d&&(A+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),g){A+=h*(t.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(g-h)*l.lineHeight+(g-1)*t.bodySpacing}p&&(A+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let y=0;const v=function(e){m=Math.max(m,n.measureText(e).width+y)};return n.save(),n.font=c.string,each$1(e.title,v),n.font=l.string,each$1(e.beforeBody.concat(e.afterBody),v),y=t.displayColors?a+2+t.boxPadding:0,each$1(r,e=>{each$1(e.before,v),each$1(e.lines,v),each$1(e.after,v)}),y=0,n.font=u.string,each$1(e.footer,v),n.restore(),m+=f.width,{width:m,height:A}}function determineYAlign(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function doesNotFitWithAlign(e,t,n,r){const{x:o,width:i}=r,a=n.caretSize+n.caretPadding;return"left"===e&&o+i+a>t.width||("right"===e&&o-i-a<0||void 0)}function determineXAlign(e,t,n,r){const{x:o,width:i}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return"center"===r?c=o<=(s+l)/2?"left":"right":o<=i/2?c="left":o>=a-i/2&&(c="right"),doesNotFitWithAlign(c,e,t,n)&&(c="center"),c}function determineAlignment(e,t,n){const r=n.yAlign||t.yAlign||determineYAlign(e,n);return{xAlign:n.xAlign||t.xAlign||determineXAlign(e,t,n,r),yAlign:r}}function alignX(e,t){let{x:n,width:r}=e;return"right"===t?n-=r:"center"===t&&(n-=r/2),n}function alignY(e,t,n){let{y:r,height:o}=e;return"top"===t?r+=n:r-="bottom"===t?o+n:o/2,r}function getBackgroundPoint(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=o+i,{topLeft:u,topRight:d,bottomLeft:p,bottomRight:h}=toTRBLCorners(a);let f=alignX(t,s);const A=alignY(t,l,c);return"center"===l?"left"===s?f+=c:"right"===s&&(f-=c):"left"===s?f-=Math.max(u,p)+o:"right"===s&&(f+=Math.max(d,h)+o),{x:_limitValue(f,0,r.width-t.width),y:_limitValue(A,0,r.height-t.height)}}function getAlignedX(e,t,n){const r=toPadding(n.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-r.right:e.x+r.left}function getBeforeAfterBodyLines(e){return pushOrConcat([],splitNewlines(e))}function createTooltipContext(e,t,n){return createContext(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function overrideCallbacks(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const defaultCallbacks={beforeTitle:noop$5,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:noop$5,beforeBody:noop$5,beforeLabel:noop$5,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return isNullOrUndef(n)||(t+=n),t},labelColor(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:noop$5,afterBody:noop$5,beforeFooter:noop$5,footer:noop$5,afterFooter:noop$5};function invokeCallbackWithFallback(e,t,n,r){const o=e[t].call(n,r);return void 0===o?defaultCallbacks[t].call(n,r):o}let Tooltip$1=class extends Element$2{static positioners=positioners;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,o=new Animations(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:n}=t,r=invokeCallbackWithFallback(n,"beforeTitle",this,e),o=invokeCallbackWithFallback(n,"title",this,e),i=invokeCallbackWithFallback(n,"afterTitle",this,e);let a=[];return a=pushOrConcat(a,splitNewlines(r)),a=pushOrConcat(a,splitNewlines(o)),a=pushOrConcat(a,splitNewlines(i)),a}getBeforeBody(e,t){return getBeforeAfterBodyLines(invokeCallbackWithFallback(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:n}=t,r=[];return each$1(e,e=>{const t={before:[],lines:[],after:[]},o=overrideCallbacks(n,e);pushOrConcat(t.before,splitNewlines(invokeCallbackWithFallback(o,"beforeLabel",this,e))),pushOrConcat(t.lines,invokeCallbackWithFallback(o,"label",this,e)),pushOrConcat(t.after,splitNewlines(invokeCallbackWithFallback(o,"afterLabel",this,e))),r.push(t)}),r}getAfterBody(e,t){return getBeforeAfterBodyLines(invokeCallbackWithFallback(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:n}=t,r=invokeCallbackWithFallback(n,"beforeFooter",this,e),o=invokeCallbackWithFallback(n,"footer",this,e),i=invokeCallbackWithFallback(n,"afterFooter",this,e);let a=[];return a=pushOrConcat(a,splitNewlines(r)),a=pushOrConcat(a,splitNewlines(o)),a=pushOrConcat(a,splitNewlines(i)),a}_createItems(e){const t=this._active,n=this.chart.data,r=[],o=[],i=[];let a,s,l=[];for(a=0,s=t.length;a<s;++a)l.push(createTooltipItem(this.chart,t[a]));return e.filter&&(l=l.filter((t,r,o)=>e.filter(t,r,o,n))),e.itemSort&&(l=l.sort((t,r)=>e.itemSort(t,r,n))),each$1(l,t=>{const n=overrideCallbacks(e.callbacks,t);r.push(invokeCallbackWithFallback(n,"labelColor",this,t)),o.push(invokeCallbackWithFallback(n,"labelPointStyle",this,t)),i.push(invokeCallbackWithFallback(n,"labelTextColor",this,t))}),this.labelColors=r,this.labelPointStyles=o,this.labelTextColors=i,this.dataPoints=l,l}update(e,t){const n=this.options.setContext(this.getContext()),r=this._active;let o,i=[];if(r.length){const e=positioners[n.position].call(this,r,this._eventPosition);i=this._createItems(n),this.title=this.getTitle(i,n),this.beforeBody=this.getBeforeBody(i,n),this.body=this.getBody(i,n),this.afterBody=this.getAfterBody(i,n),this.footer=this.getFooter(i,n);const t=this._size=getTooltipSize(this,n),a=Object.assign({},e,t),s=determineAlignment(this.chart,n,a),l=getBackgroundPoint(n,a,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,o={opacity:1,x:l.x,y:l.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}else 0!==this.opacity&&(o={opacity:0});this._tooltipItems=i,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){const o=this.getCaretPosition(e,n,r);t.lineTo(o.x1,o.y1),t.lineTo(o.x2,o.y2),t.lineTo(o.x3,o.y3)}getCaretPosition(e,t,n){const{xAlign:r,yAlign:o}=this,{caretSize:i,cornerRadius:a}=n,{topLeft:s,topRight:l,bottomLeft:c,bottomRight:u}=toTRBLCorners(a),{x:d,y:p}=e,{width:h,height:f}=t;let A,m,g,y,v,b;return"center"===o?(v=p+f/2,"left"===r?(A=d,m=A-i,y=v+i,b=v-i):(A=d+h,m=A+i,y=v-i,b=v+i),g=A):(m="left"===r?d+Math.max(s,c)+i:"right"===r?d+h-Math.max(l,u)-i:this.caretX,"top"===o?(y=p,v=y-i,A=m-i,g=m+i):(y=p+f,v=y+i,A=m+i,g=m-i),b=y),{x1:A,x2:m,x3:g,y1:y,y2:v,y3:b}}drawTitle(e,t,n){const r=this.title,o=r.length;let i,a,s;if(o){const l=getRtlAdapter(n.rtl,this.x,this.width);for(e.x=getAlignedX(this,n.titleAlign,n),t.textAlign=l.textAlign(n.titleAlign),t.textBaseline="middle",i=toFont(n.titleFont),a=n.titleSpacing,t.fillStyle=n.titleColor,t.font=i.string,s=0;s<o;++s)t.fillText(r[s],l.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+a,s+1===o&&(e.y+=n.titleMarginBottom-a)}}_drawColorBox(e,t,n,r,o){const i=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:s,boxWidth:l}=o,c=toFont(o.bodyFont),u=getAlignedX(this,"left",o),d=r.x(u),p=s<c.lineHeight?(c.lineHeight-s)/2:0,h=t.y+p;if(o.usePointStyle){const t={radius:Math.min(l,s)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},n=r.leftForLtr(d,l)+l/2,c=h+s/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,drawPoint(e,t,n,c),e.strokeStyle=i.borderColor,e.fillStyle=i.backgroundColor,drawPoint(e,t,n,c)}else{e.lineWidth=isObject$3(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,e.strokeStyle=i.borderColor,e.setLineDash(i.borderDash||[]),e.lineDashOffset=i.borderDashOffset||0;const t=r.leftForLtr(d,l),n=r.leftForLtr(r.xPlus(d,1),l-2),a=toTRBLCorners(i.borderRadius);Object.values(a).some(e=>0!==e)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,addRoundedRectPath(e,{x:t,y:h,w:l,h:s,radius:a}),e.fill(),e.stroke(),e.fillStyle=i.backgroundColor,e.beginPath(),addRoundedRectPath(e,{x:n,y:h+1,w:l-2,h:s-2,radius:a}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(t,h,l,s),e.strokeRect(t,h,l,s),e.fillStyle=i.backgroundColor,e.fillRect(n,h+1,l-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){const{body:r}=this,{bodySpacing:o,bodyAlign:i,displayColors:a,boxHeight:s,boxWidth:l,boxPadding:c}=n,u=toFont(n.bodyFont);let d=u.lineHeight,p=0;const h=getRtlAdapter(n.rtl,this.x,this.width),f=function(n){t.fillText(n,h.x(e.x+p),e.y+d/2),e.y+=d+o},A=h.textAlign(i);let m,g,y,v,b,x,w;for(t.textAlign=i,t.textBaseline="middle",t.font=u.string,e.x=getAlignedX(this,A,n),t.fillStyle=n.bodyColor,each$1(this.beforeBody,f),p=a&&"right"!==A?"center"===i?l/2+c:l+2+c:0,v=0,x=r.length;v<x;++v){for(m=r[v],g=this.labelTextColors[v],t.fillStyle=g,each$1(m.before,f),y=m.lines,a&&y.length&&(this._drawColorBox(t,e,v,h,n),d=Math.max(u.lineHeight,s)),b=0,w=y.length;b<w;++b)f(y[b]),d=u.lineHeight;each$1(m.after,f)}p=0,d=u.lineHeight,each$1(this.afterBody,f),e.y-=o}drawFooter(e,t,n){const r=this.footer,o=r.length;let i,a;if(o){const s=getRtlAdapter(n.rtl,this.x,this.width);for(e.x=getAlignedX(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline="middle",i=toFont(n.footerFont),t.fillStyle=n.footerColor,t.font=i.string,a=0;a<o;++a)t.fillText(r[a],s.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){const{xAlign:o,yAlign:i}=this,{x:a,y:s}=e,{width:l,height:c}=n,{topLeft:u,topRight:d,bottomLeft:p,bottomRight:h}=toTRBLCorners(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(a+u,s),"top"===i&&this.drawCaret(e,t,n,r),t.lineTo(a+l-d,s),t.quadraticCurveTo(a+l,s,a+l,s+d),"center"===i&&"right"===o&&this.drawCaret(e,t,n,r),t.lineTo(a+l,s+c-h),t.quadraticCurveTo(a+l,s+c,a+l-h,s+c),"bottom"===i&&this.drawCaret(e,t,n,r),t.lineTo(a+p,s+c),t.quadraticCurveTo(a,s+c,a,s+c-p),"center"===i&&"left"===o&&this.drawCaret(e,t,n,r),t.lineTo(a,s+u),t.quadraticCurveTo(a,s,a+u,s),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,n=this.$animations,r=n&&n.x,o=n&&n.y;if(r||o){const n=positioners[e.position].call(this,this._active,this._eventPosition);if(!n)return;const i=this._size=getTooltipSize(this,e),a=Object.assign({},n,this._size),s=determineAlignment(t,e,a),l=getBackgroundPoint(e,a,s,t);r._to===l.x&&o._to===l.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=i.width,this.height=i.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(t);const r={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const i=toPadding(t.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&a&&(e.save(),e.globalAlpha=n,this.drawBackground(o,e,r,t),overrideTextDirection(e,t.textDirection),o.y+=i.top,this.drawTitle(o,e,t),this.drawBody(o,e,t),this.drawFooter(o,e,t),restoreTextDirection(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const n=this._active,r=e.map(({datasetIndex:e,index:t})=>{const n=this.chart.getDatasetMeta(e);if(!n)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:n.data[t],index:t}}),o=!_elementsEqual(n,r),i=this._positionChanged(r,t);(o||i)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,o=this._active||[],i=this._getActiveElements(e,o,t,n),a=this._positionChanged(i,e),s=t||!_elementsEqual(i,o)||a;return s&&(this._active=i,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){const o=this.options;if("mouseout"===e.type)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&void 0!==this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index));const i=this.chart.getElementsAtEventForMode(e,o.mode,o,n);return o.reverse&&i.reverse(),i}_positionChanged(e,t){const{caretX:n,caretY:r,options:o}=this,i=positioners[o.position].call(this,e,t);return!1!==i&&(n!==i.x||r!==i.y)}};var plugin_tooltip={id:"tooltip",_element:Tooltip$1,positioners:positioners,afterInit(e,t,n){n&&(e.tooltip=new Tooltip$1({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(!1===e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0}))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:defaultCallbacks},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>"filter"!==e&&"itemSort"!==e&&"external"!==e,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=(e,t,n,r)=>("string"==typeof t?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function findOrAddLabel(e,t,n,r){const o=e.indexOf(t);if(-1===o)return addIfString(e,t,n,r);return o!==e.lastIndexOf(t)?n:o}const validIndex=(e,t)=>null===e?null:_limitValue(Math.round(e),0,t);function _getLabelForValue(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class CategoryScale extends Scale{static id="category";static defaults={ticks:{callback:_getLabelForValue}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const e=this.getLabels();for(const{index:n,label:r}of t)e[n]===r&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(isNullOrUndef(e))return null;const n=this.getLabels();return t=isFinite(t)&&n[t]===e?t:findOrAddLabel(n,e,valueOrDefault(t,e),this._addedLabels),validIndex(t,n.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:n,max:r}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(n=0),t||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){const e=this.min,t=this.max,n=this.options.offset,r=[];let o=this.getLabels();o=0===e&&t===o.length-1?o:o.slice(e,t+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let i=e;i<=t;i++)r.push({value:i});return r}getLabelForValue(e){return _getLabelForValue.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return"number"!=typeof e&&(e=this.parse(e)),null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function generateTicks$1(e,t){const n=[],{bounds:r,step:o,min:i,max:a,precision:s,count:l,maxTicks:c,maxDigits:u,includeBounds:d}=e,p=o||1,h=c-1,{min:f,max:A}=t,m=!isNullOrUndef(i),g=!isNullOrUndef(a),y=!isNullOrUndef(l),v=(A-f)/(u+1);let b,x,w,C,$=niceNum((A-f)/h/p)*p;if($<1e-14&&!m&&!g)return[{value:f},{value:A}];C=Math.ceil(A/$)-Math.floor(f/$),C>h&&($=niceNum(C*$/h/p)*p),isNullOrUndef(s)||(b=Math.pow(10,s),$=Math.ceil($*b)/b),"ticks"===r?(x=Math.floor(f/$)*$,w=Math.ceil(A/$)*$):(x=f,w=A),m&&g&&o&&almostWhole((a-i)/o,$/1e3)?(C=Math.round(Math.min((a-i)/$,c)),$=(a-i)/C,x=i,w=a):y?(x=m?i:x,w=g?a:w,C=l-1,$=(w-x)/C):(C=(w-x)/$,C=almostEquals(C,Math.round(C),$/1e3)?Math.round(C):Math.ceil(C));const _=Math.max(_decimalPlaces($),_decimalPlaces(x));b=Math.pow(10,isNullOrUndef(s)?_:s),x=Math.round(x*b)/b,w=Math.round(w*b)/b;let S=0;for(m&&(d&&x!==i?(n.push({value:i}),x<i&&S++,almostEquals(Math.round((x+S*$)*b)/b,i,relativeLabelSize(i,v,e))&&S++):x<i&&S++);S<C;++S){const e=Math.round((x+S*$)*b)/b;if(g&&e>a)break;n.push({value:e})}return g&&d&&w!==a?n.length&&almostEquals(n[n.length-1].value,a,relativeLabelSize(a,v,e))?n[n.length-1].value=a:n.push({value:a}):g&&w!==a||n.push({value:w}),n}function relativeLabelSize(e,t,{horizontal:n,minRotation:r}){const o=toRadians(r),i=(n?Math.sin(o):Math.cos(o))||.001,a=.75*t*(""+e).length;return Math.min(t/i,a)}class LinearScaleBase extends Scale{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return isNullOrUndef(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this;const i=e=>r=t?r:e,a=e=>o=n?o:e;if(e){const e=sign$2(r),t=sign$2(o);e<0&&t<0?a(0):e>0&&t>0&&i(0)}if(r===o){let t=0===o?1:Math.abs(.05*o);a(o+t),e||i(r-t)}this.min=r,this.max=o}getTickLimit(){const e=this.options.ticks;let t,{maxTicksLimit:n,stepSize:r}=e;return r?(t=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,t>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3)):(t=this.computeTickLimit(),n=n||11),n&&(t=Math.min(n,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let n=this.getTickLimit();n=Math.max(2,n);const r=generateTicks$1({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&_setMinAndMaxByKey(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const e=this.ticks;let t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){const r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return formatNumber(e,this.chart.options.locale,this.options.ticks.format)}}class LinearScale extends LinearScaleBase{static id="linear";static defaults={ticks:{callback:Ticks.formatters.numeric}};determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=isNumberFinite(e)?e:0,this.max=isNumberFinite(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,n=toRadians(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/r))}getPixelForValue(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const INTERVALS={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}},UNITS=Object.keys(INTERVALS);function sorter(e,t){return e-t}function parse$a(e,t){if(isNullOrUndef(t))return null;const n=e._adapter,{parser:r,round:o,isoWeekday:i}=e._parseOpts;let a=t;return"function"==typeof r&&(a=r(a)),isNumberFinite(a)||(a="string"==typeof r?n.parse(a,r):n.parse(a)),null===a?null:(o&&(a="week"!==o||!isNumber$2(i)&&!0!==i?n.startOf(a,o):n.startOf(a,"isoWeek",i)),+a)}function determineUnitForAutoTicks(e,t,n,r){const o=UNITS.length;for(let i=UNITS.indexOf(e);i<o-1;++i){const e=INTERVALS[UNITS[i]],o=e.steps?e.steps:Number.MAX_SAFE_INTEGER;if(e.common&&Math.ceil((n-t)/(o*e.size))<=r)return UNITS[i]}return UNITS[o-1]}function determineUnitForFormatting(e,t,n,r,o){for(let i=UNITS.length-1;i>=UNITS.indexOf(n);i--){const n=UNITS[i];if(INTERVALS[n].common&&e._adapter.diff(o,r,n)>=t-1)return n}return UNITS[n?UNITS.indexOf(n):0]}function determineMajorUnit(e){for(let t=UNITS.indexOf(e)+1,n=UNITS.length;t<n;++t)if(INTERVALS[UNITS[t]].common)return UNITS[t]}function addTick(e,t,n){if(n){if(n.length){const{lo:r,hi:o}=_lookup(n,t);e[n[r]>=t?n[r]:n[o]]=!0}}else e[t]=!0}function setMajorTicks(e,t,n,r){const o=e._adapter,i=+o.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=i;s<=a;s=+o.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function ticksFromTimestamps(e,t,n){const r=[],o={},i=t.length;let a,s;for(a=0;a<i;++a)s=t[a],o[s]=a,r.push({value:s,major:!1});return 0!==i&&n?setMajorTicks(e,r,o,n):r}class TimeScale extends Scale{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){const n=e.time||(e.time={}),r=this._adapter=new adapters._date(e.adapters.date);r.init(t),mergeIf(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return void 0===e?null:parse$a(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,n=e.time.unit||"day";let{min:r,max:o,minDefined:i,maxDefined:a}=this.getUserBounds();function s(e){i||isNaN(e.min)||(r=Math.min(r,e.min)),a||isNaN(e.max)||(o=Math.max(o,e.max))}i&&a||(s(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||s(this.getMinMax(!1))),r=isNumberFinite(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),o=isNumberFinite(o)&&!isNaN(o)?o:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,o-1),this.max=Math.max(r+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){const e=this.options,t=e.time,n=e.ticks,r="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const o=this.min,i=_filterBetween(r,o,this.max);return this._unit=t.unit||(n.autoSkip?determineUnitForAutoTicks(t.minUnit,this.min,this.max,this._getLabelCapacity(o)):determineUnitForFormatting(this,i.length,t.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?determineMajorUnit(this._unit):void 0,this.initOffsets(r),e.reverse&&i.reverse(),ticksFromTimestamps(this,i,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t,n,r=0,o=0;this.options.offset&&e.length&&(t=this.getDecimalForValue(e[0]),r=1===e.length?1-t:(this.getDecimalForValue(e[1])-t)/2,n=this.getDecimalForValue(e[e.length-1]),o=1===e.length?n:(n-this.getDecimalForValue(e[e.length-2]))/2);const i=e.length<3?.5:.25;r=_limitValue(r,0,i),o=_limitValue(o,0,i),this._offsets={start:r,end:o,factor:1/(r+1+o)}}_generate(){const e=this._adapter,t=this.min,n=this.max,r=this.options,o=r.time,i=o.unit||determineUnitForAutoTicks(o.minUnit,t,n,this._getLabelCapacity(t)),a=valueOrDefault(r.ticks.stepSize,1),s="week"===i&&o.isoWeekday,l=isNumber$2(s)||!0===s,c={};let u,d,p=t;if(l&&(p=+e.startOf(p,"isoWeek",s)),p=+e.startOf(p,l?"day":i),e.diff(n,t,i)>1e5*a)throw new Error(t+" and "+n+" are too far apart with stepSize of "+a+" "+i);const h="data"===r.ticks.source&&this.getDataTimestamps();for(u=p,d=0;u<n;u=+e.add(u,a,i),d++)addTick(c,u,h);return u!==n&&"ticks"!==r.bounds&&1!==d||addTick(c,u,h),Object.keys(c).sort(sorter).map(e=>+e)}getLabelForValue(e){const t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){const n=this.options.time.displayFormats,r=this._unit,o=t||n[r];return this._adapter.format(e,o)}_tickFormatFunction(e,t,n,r){const o=this.options,i=o.ticks.callback;if(i)return callback(i,[e,t,n],this);const a=o.time.displayFormats,s=this._unit,l=this._majorUnit,c=s&&a[s],u=l&&a[l],d=n[t],p=l&&u&&d&&d.major;return this._adapter.format(e,r||(p?u:c))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return null===e?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,n=this.ctx.measureText(e).width,r=toRadians(this.isHorizontal()?t.maxRotation:t.minRotation),o=Math.cos(r),i=Math.sin(r),a=this._resolveTickFontOptions(0).size;return{w:n*o+a*i,h:n*i+a*o}}_getLabelCapacity(e){const t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,o=this._tickFormatFunction(e,0,ticksFromTimestamps(this,[e],this._majorUnit),r),i=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return a>0?a:1}getDataTimestamps(){let e,t,n=this._cache.data||[];if(n.length)return n;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,t=r.length;e<t;++e)n=n.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const e=this._cache.labels||[];let t,n;if(e.length)return e;const r=this.getLabels();for(t=0,n=r.length;t<n;++t)e.push(parse$a(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return _arrayUnique(e.sort(sorter))}}function interpolate(e,t,n){let r,o,i,a,s=0,l=e.length-1;n?(t>=e[s].pos&&t<=e[l].pos&&({lo:s,hi:l}=_lookupByKey(e,"pos",t)),({pos:r,time:i}=e[s]),({pos:o,time:a}=e[l])):(t>=e[s].time&&t<=e[l].time&&({lo:s,hi:l}=_lookupByKey(e,"time",t)),({time:r,pos:i}=e[s]),({time:o,pos:a}=e[l]));const c=o-r;return c?i+(a-i)*(t-r)/c:i}class TimeSeriesScale extends TimeScale{static id="timeseries";static defaults=TimeScale.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=interpolate(t,this.min),this._tableRange=interpolate(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:n}=this,r=[],o=[];let i,a,s,l,c;for(i=0,a=e.length;i<a;++i)l=e[i],l>=t&&l<=n&&r.push(l);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(i=0,a=r.length;i<a;++i)c=r[i+1],s=r[i-1],l=r[i],Math.round((c+s)/2)!==l&&o.push({time:l,pos:i/(a-1)});return o}_generate(){const e=this.min,t=this.max;let n=super.getDataTimestamps();return n.includes(e)&&n.length||n.splice(0,0,e),n.includes(t)&&1!==n.length||n.push(t),n.sort((e,t)=>e-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(interpolate(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return interpolate(this._table,n*this._tableRange+this._minPos,!0)}}var isToday$1={exports:{}};isToday$1.exports=function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}};var isTodayExports=isToday$1.exports;const isToday=getDefaultExportFromCjs$1(isTodayExports);var localeData$1={exports:{}};localeData$1.exports=function(e,t,n){var r=t.prototype,o=function(e){return e&&(e.indexOf?e:e.s)},i=function(e,t,n,r,i){var a=e.name?e:e.$locale(),s=o(a[t]),l=o(a[n]),c=s||l.map(function(e){return e.slice(0,r)});if(!i)return c;var u=a.weekStart;return c.map(function(e,t){return c[(t+(u||0))%7]})},a=function(){return n.Ls[n.locale()]},s=function(e,t){return e.formats[t]||e.formats[t.toUpperCase()].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,n){return t||n.slice(1)})},l=function(){var e=this;return{months:function(t){return t?t.format("MMMM"):i(e,"months")},monthsShort:function(t){return t?t.format("MMM"):i(e,"monthsShort","months",3)},firstDayOfWeek:function(){return e.$locale().weekStart||0},weekdays:function(t){return t?t.format("dddd"):i(e,"weekdays")},weekdaysMin:function(t){return t?t.format("dd"):i(e,"weekdaysMin","weekdays",2)},weekdaysShort:function(t){return t?t.format("ddd"):i(e,"weekdaysShort","weekdays",3)},longDateFormat:function(t){return s(e.$locale(),t)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return l.bind(this)()},n.localeData=function(){var e=a();return{firstDayOfWeek:function(){return e.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(t){return s(e,t)},meridiem:e.meridiem,ordinal:e.ordinal}},n.months=function(){return i(a(),"months")},n.monthsShort=function(){return i(a(),"monthsShort","months",3)},n.weekdays=function(e){return i(a(),"weekdays",null,null,e)},n.weekdaysShort=function(e){return i(a(),"weekdaysShort","weekdays",3,e)},n.weekdaysMin=function(e){return i(a(),"weekdaysMin","weekdays",2,e)}};var localeDataExports=localeData$1.exports;const localeData=getDefaultExportFromCjs$1(localeDataExports);var ru={exports:{}},dayjs_min={exports:{}},hasRequiredDayjs_min;function requireDayjs_min(){return hasRequiredDayjs_min||(hasRequiredDayjs_min=1,dayjs_min.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",o="second",i="minute",a="hour",s="day",l="week",c="month",u="quarter",d="year",p="date",h="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,A=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(o,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),o=t.clone().add(r,c),i=n-o<0,a=t.clone().add(r+(i?-1:1),c);return+(-(r+(n-o)/(i?o-a:a-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:d,w:l,d:s,D:p,h:a,m:i,s:o,ms:r,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",b={};b[v]=m;var x="$isDayjsObject",w=function(e){return e instanceof S||!(!e||!e[x])},C=function e(t,n,r){var o;if(!t)return v;if("string"==typeof t){var i=t.toLowerCase();b[i]&&(o=i),n&&(b[i]=n,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var s=t.name;b[s]=t,o=s}return!r&&o&&(v=o),o||!r&&v},$=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new S(n)},_=y;_.l=C,_.i=w,_.w=function(e,t){return $(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function m(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var g=m.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(_.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(f);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return _},g.isValid=function(){return!(this.$d.toString()===h)},g.isSame=function(e,t){var n=$(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return $(e)<this.startOf(t)},g.isBefore=function(e,t){return this.endOf(t)<$(e)},g.$g=function(e,t,n){return _.u(e)?this[t]:this.set(n,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,t){var n=this,r=!!_.u(t)||t,u=_.p(e),h=function(e,t){var o=_.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?o:o.endOf(s)},f=function(e,t){return _.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},A=this.$W,m=this.$M,g=this.$D,y="set"+(this.$u?"UTC":"");switch(u){case d:return r?h(1,0):h(31,11);case c:return r?h(1,m):h(0,m+1);case l:var v=this.$locale().weekStart||0,b=(A<v?A+7:A)-v;return h(r?g-b:g+(6-b),m);case s:case p:return f(y+"Hours",0);case a:return f(y+"Minutes",1);case i:return f(y+"Seconds",2);case o:return f(y+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,t){var n,l=_.p(e),u="set"+(this.$u?"UTC":""),h=(n={},n[s]=u+"Date",n[p]=u+"Date",n[c]=u+"Month",n[d]=u+"FullYear",n[a]=u+"Hours",n[i]=u+"Minutes",n[o]=u+"Seconds",n[r]=u+"Milliseconds",n)[l],f=l===s?this.$D+(t-this.$W):t;if(l===c||l===d){var A=this.clone().set(p,1);A.$d[h](f),A.init(),this.$d=A.set(p,Math.min(this.$D,A.daysInMonth())).$d}else h&&this.$d[h](f);return this.init(),this},g.set=function(e,t){return this.clone().$set(e,t)},g.get=function(e){return this[_.p(e)]()},g.add=function(r,u){var p,h=this;r=Number(r);var f=_.p(u),A=function(e){var t=$(h);return _.w(t.date(t.date()+Math.round(e*r)),h)};if(f===c)return this.set(c,this.$M+r);if(f===d)return this.set(d,this.$y+r);if(f===s)return A(1);if(f===l)return A(7);var m=(p={},p[i]=t,p[a]=n,p[o]=e,p)[f]||1,g=this.$d.getTime()+r*m;return _.w(g,this)},g.subtract=function(e,t){return this.add(-1*e,t)},g.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var r=e||"YYYY-MM-DDTHH:mm:ssZ",o=_.z(this),i=this.$H,a=this.$m,s=this.$M,l=n.weekdays,c=n.months,u=n.meridiem,d=function(e,n,o,i){return e&&(e[n]||e(t,r))||o[n].slice(0,i)},p=function(e){return _.s(i%12||12,e,"0")},f=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(A,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return _.s(t.$y,4,"0");case"M":return s+1;case"MM":return _.s(s+1,2,"0");case"MMM":return d(n.monthsShort,s,c,3);case"MMMM":return d(c,s);case"D":return t.$D;case"DD":return _.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,l,2);case"ddd":return d(n.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(i);case"HH":return _.s(i,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return f(i,a,!0);case"A":return f(i,a,!1);case"m":return String(a);case"mm":return _.s(a,2,"0");case"s":return String(t.$s);case"ss":return _.s(t.$s,2,"0");case"SSS":return _.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")})},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(r,p,h){var f,A=this,m=_.p(p),g=$(r),y=(g.utcOffset()-this.utcOffset())*t,v=this-g,b=function(){return _.m(A,g)};switch(m){case d:f=b()/12;break;case c:f=b();break;case u:f=b()/3;break;case l:f=(v-y)/6048e5;break;case s:f=(v-y)/864e5;break;case a:f=v/n;break;case i:f=v/t;break;case o:f=v/e;break;default:f=v}return h?f:_.a(f)},g.daysInMonth=function(){return this.endOf(c).$D},g.$locale=function(){return b[this.$L]},g.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},g.clone=function(){return _.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},m}(),E=S.prototype;return $.prototype=E,[["$ms",r],["$s",o],["$m",i],["$H",a],["$W",s],["$M",c],["$y",d],["$D",p]].forEach(function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),$.extend=function(e,t){return e.$i||(e(t,S,$),e.$i=!0),$},$.locale=C,$.isDayjs=w,$.unix=function(e){return $(1e3*e)},$.en=b[v],$.Ls=b,$.p={},$}()),dayjs_min.exports}ru.exports=function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e),r="января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),o="январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),i="янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),a="янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"),s=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function l(e,t,n){var r,o;return"m"===n?t?"минута":"минуту":e+" "+(r=+e,o={mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}var c=function(e,t){return s.test(t)?r[e.month()]:o[e.month()]};c.s=o,c.f=r;var u=function(e,t){return s.test(t)?i[e.month()]:a[e.month()]};u.s=a,u.f=i;var d={name:"ru",weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),months:c,monthsShort:u,weekStart:1,yearStart:4,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:l,mm:l,h:"час",hh:l,d:"день",dd:l,M:"месяц",MM:l,y:"год",yy:l},ordinal:function(e){return e},meridiem:function(e){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"}};return n.default.locale(d,null,!0),d}(requireDayjs_min());var ruExports=ru.exports;const ruLocale=getDefaultExportFromCjs$1(ruExports);var utc={exports:{}};utc.exports=function(){var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,o,i){var a=o.prototype;i.utc=function(e){return new o({date:e,utc:!0,args:arguments})},a.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=a.utcOffset;a.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&null===(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var o=(""+r[0]).match(n)||["-",0,0],i=o[0],a=60*+o[1]+ +o[2];return 0===a?0:"+"===i?a:-a}(r)))return this;var a=Math.abs(r)<=16?60*r:r;if(0===a)return this.utc(o);var s=this.clone();if(o)return s.$offset=a,s.$u=!1,s;var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(a+l,e)).$offset=a,s.$x.$localOffset=l,s};var u=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var p=a.diff;a.diff=function(e,t,n){if(e&&this.$u===e.$u)return p.call(this,e,t,n);var r=this.local(),o=i(e).local();return p.call(r,o,t,n)}}}();var utcExports=utc.exports;const utcPlugin=getDefaultExportFromCjs$1(utcExports);Chart$1.register(CategoryScale,LinearScale,BarElement,BarController,LineElement,LineController,PointElement,plugin_title,plugin_tooltip,plugin_legend),dayjs.extend(localeData),dayjs.extend(utcPlugin),dayjs.extend(isToday),dayjs.locale(ruLocale);var dayjs_minExports=requireDayjs_min();const J$2=getDefaultExportFromCjs$1(dayjs_minExports);var uzLatn={exports:{}};uzLatn.exports=function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e),r={name:"uz-latn",weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),weekStart:1,weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},relativeTime:{future:"Yaqin %s ichida",past:"%s oldin",s:"soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"}};return n.default.locale(r,null,!0),r}(requireDayjs_min());var uzLatnExports=uzLatn.exports;const uzLocale=getDefaultExportFromCjs$1(uzLatnExports);var define_process_env_default$3={};const CC_ENABLE_MOCK=!!define_process_env_default$3.CC_ENABLE_MOCK||!1,CC_LIST_BUFFER_SIZE=parseInt(define_process_env_default$3.CC_LIST_BUFFER_SIZE)||25,CC_FORCE_BROWSER_HISTORY=!!define_process_env_default$3.CC_FORCE_BROWSER_HISTORY||!1,CC_FULLSCREEN_SIZE_REQUEST=({height:e,width:t})=>({height:e-50,width:t-50,sx:{maxHeight:"720px",maxWidth:"1280px"}}),CC_DAYJS_LOCALE=define_process_env_default$3.CC_DAYJS_LOCALE||"RU",CC_SERVICE_NAME="backtest-kit",CC_USER_ID=Gr(),CC_CLIENT_ID="ui";function fallbackCopyTextToClipboard(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{const e=document.execCommand("copy")?"successful":"unsuccessful";console.log(`Fallback: Copying text command was ${e}`)}catch(n){console.error("Fallback: Oops, unable to copy",n)}document.body.removeChild(t)}J$2.extend(localeData),J$2.extend(utcPlugin),J$2.extend(isToday),"RU"===CC_DAYJS_LOCALE?J$2.locale(ruLocale):"UZ"===CC_DAYJS_LOCALE?J$2.locale(uzLocale):J$2.locale(ruLocale),ak.override(e=>{const t=document.createElement("a");t.href=e,t.target="_blank",t.click()}),oS.override(async e=>{try{if("copyToClipboard"in navigator)return void(await navigator.copyToClipboard(e));await navigator.clipboard.writeText(e)}catch{fallbackCopyTextToClipboard(e)}}),rp.override(async()=>{if("caches"in window)for(const e of await window.caches.keys())await caches.delete(e);CC_FORCE_BROWSER_HISTORY?window.location.href="/":window.location.reload(!0)});const{makeStyles:makeStyles}=createMakeAndWithStyles({useTheme:useTheme}),useStyles$x=makeStyles()({root:{position:"relative",width:48,maxWidth:48}}),MobileCheckboxBodyCell=e=>{const{classes:t}=useStyles$x();return factory$1(TableCell,{className:t.root,padding:"checkbox",children:factory$1(_h.CheckboxCell,{...e})})},COMPONENT_MIN_HEIGHT=70,CONTENT_CELL="react_declarative_listMobileCell",useStyles$w=makeStyles()({root:{position:"relative"},noGutters:{paddingLeft:"0 !important",paddingRight:"0 !important"},container:{minHeight:"100%",width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",flexWrap:"wrap"},content:{position:"relative",overflow:"clip",overflowWrap:"break-word",fontWeight:"bold",flex:1},shrinkWidth:{width:48,maxWidth:48}}),MobileCommonCell=({className:e,colSpan:t,withLabel:n,fullWidth:r,disableGutters:o,...i})=>{const{classes:a}=useStyles$w(),{column:s}=i,l=reactExports.useMemo(()=>{const{minHeight:e}=s;return e||(s.type===Mm.Component?COMPONENT_MIN_HEIGHT:void 0)},[]),c=reactExports.useMemo(()=>Math.max(r-35,0),[r]),{headerName:u=s.field||"Unknown"}=s;return factory$1(TableCell,{className:clsx$2(a.root,e,{[a.noGutters]:o,[a.shrinkWidth]:s.type===Mm.Action}),colSpan:t,children:factory$1(Box$1,{className:a.container,children:[n&&factory$1(Typography,{variant:"body1",children:`${tM.bullet} ${u}`}),factory$1(Box$1,{className:clsx$2(a.content,CONTENT_CELL),style:{minHeight:l,maxWidth:c},children:factory$1(_h.CommonCell,{...i,fullWidth:r})})]})})},useStyles$v=makeStyles()(e=>({root:{"&:nth-of-type(2n)":{background:alpha$2(e.palette.getContrastText(e.palette.background.paper),.04)},"& > .MuiTableCell-root":{borderBottom:`1px solid ${e.palette.divider}`},overflow:"clip"},row:{"& .MuiTableCell-root":{padding:"6px",overflow:"clip"},marginBottom:16},noBorder:{"& .MuiTableCell-root":{borderBottom:"0 !important"}},disabled:{pointerEvents:"none",opacity:.5},hideIfEmpty:{[`&:has(.${CONTENT_CELL} > :empty)`]:{display:"none"},[`&:has(.${CONTENT_CELL}:empty)`]:{display:"none"}}})),MobileBodyRow=({row:e,mode:t,disabled:n,columns:r,fullWidth:o})=>{const i=Bp(e.id),[a,s]=reactExports.useState(!1),{classes:l}=useStyles$v(),c=fm(),u=Zm(),{selection:d,setSelection:p}=pm(),{onRowClick:h,onRowAction:f,rowColor:A=()=>"inherit"}=c,m=e=>{s(e)},g=t=>{f&&f(t,e,u)},[y,v,b]=reactExports.useMemo(()=>{const i=(r,i,a,s)=>(i,u)=>factory$1(MobileCommonCell,{column:i,disabled:n,row:e,className:clsx$2({[l.hideIfEmpty]:i.type!==Mm.Component&&c.withHideIfEmpty}),idx:u,mode:t,colSpan:r,fullWidth:o,onAction:g,withLabel:a,disableGutters:s,onMenuToggle:m}),a=r.filter(({type:e})=>e!==Mm.Action),[s=null]=r.filter(({type:e})=>e===Mm.Action).map(i(1,0,!1,!0)),u=a.slice(0,1).map(i(1,0,!0,!0)).pop(),d=a.filter(({primary:e})=>e).map(i(1,0,!0,!0)).pop();return[d||u,s,(d?a:a.slice(1)).map(i(s?3:2,0,!0,!1))]},[o]),x=reactExports.useMemo(()=>Math.max(o-35,0),[o]);return factory$1(TableRow,{ref:i,"data-testId":e.id,className:l.root,selected:d.has(e.id),sx:{maxWidth:x},onClick:()=>{a||(c.withSelectOnRowClick&&c.selectionMode!==gi$1.None?(c.selectionMode===gi$1.Single?d.has(e.id)&&1===d.size?d.delete(e.id):(d.clear(),d.add(e.id)):d.has(e.id)?d.delete(e.id):d.add(e.id),p(d)):h&&h(e,u))},children:factory$1(TableCell,{padding:"none",sx:{background:A(e),maxWidth:x},children:factory$1(Table,{className:clsx$2(l.row,{[l.disabled]:n}),children:factory$1(TableBody,{children:[factory$1(TableRow,{children:[factory$1(MobileCheckboxBodyCell,{disabled:n,row:e}),y,v]}),b.map((e,t)=>factory$1(TableRow,{className:clsx$2(t===b.length-1&&l.noBorder),children:e},t))]})})})})};function keys(e){return Object.keys(e)}function isObject$2(e){return e&&"object"==typeof e&&!Array.isArray(e)}function deepMerge(e,t){const n={...e},r=t;return isObject$2(e)&&isObject$2(t)&&Object.keys(t).forEach(t=>{isObject$2(r[t])?n[t]=t in e?deepMerge(n[t],r[t]):r[t]:n[t]=r[t]}),n}function camelToKebabCase(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function getTransformedScaledValue(e){var t;return"string"==typeof e&&e.includes("var(--mantine-scale)")?null==(t=e.match(/^calc\((.*?)\)$/))?void 0:t[1].split("*")[0].trim():e}function px(e){const t=getTransformedScaledValue(e);return"number"==typeof t?t:"string"==typeof t?t.includes("calc")||t.includes("var")?t:t.includes("px")?Number(t.replace("px","")):t.includes("rem")?16*Number(t.replace("rem","")):t.includes("em")?16*Number(t.replace("em","")):Number(t):NaN}function scaleRem(e){return"0rem"===e?"0rem":`calc(${e} * var(--mantine-scale))`}function createConverter(e,{shouldScale:t=!1}={}){return function n(r){if(0===r||"0"===r)return`0${e}`;if("number"==typeof r){const n=`${r/16}${e}`;return t?scaleRem(n):n}if("string"==typeof r){if(""===r)return r;if(r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(e=>n(e)).join(",");if(r.includes(" "))return r.split(" ").map(e=>n(e)).join(" ");if(r.includes(e))return t?scaleRem(r):r;const o=r.replace("px","");if(!Number.isNaN(Number(o))){const n=`${Number(o)/16}${e}`;return t?scaleRem(n):n}}return r}}const rem=createConverter("rem",{shouldScale:!0}),em=createConverter("em");function filterProps(e){return Object.keys(e).reduce((t,n)=>(void 0!==e[n]&&(t[n]=e[n]),t),{})}function isNumberLike(e){return"number"==typeof e||"string"==typeof e&&(!!(e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&""!==e.trim())||/[0-9]/.test(e.trim().replace("-","")[0]))}function isElement$2(e){return!Array.isArray(e)&&null!==e&&("object"==typeof e&&e.type!==reactExports.Fragment)}function createSafeContext(e){const t=reactExports.createContext(null);return[({children:e,value:n})=>factory$1(t.Provider,{value:n,children:e}),()=>{const n=reactExports.useContext(t);if(null===n)throw new Error(e);return n}]}function createOptionalContext(e=null){const t=reactExports.createContext(e);return[({children:e,value:n})=>factory$1(t.Provider,{value:n,children:e}),()=>reactExports.useContext(t)]}const elevations={app:100,modal:200,popover:300,overlay:400,max:9999};function getDefaultZIndex(e){return elevations[e]}const noop$4=()=>{};function closeOnEscape(e,t={active:!0}){return"function"==typeof e&&t.active?n=>{var r;"Escape"===n.key&&(e(n),null==(r=t.onTrigger)||r.call(t))}:t.onKeyDown||noop$4}function getSize(e,t="size",n=!0){if(void 0!==e)return isNumberLike(e)?n?rem(e):e:`var(--${t}-${e})`}function getSpacing(e){return getSize(e,"mantine-spacing")}function getRadius(e){return void 0===e?"var(--mantine-radius-default)":getSize(e,"mantine-radius")}function getFontSize(e){return getSize(e,"mantine-font-size")}function getShadow(e){if(e)return getSize(e,"mantine-shadow",!1)}function clamp$2(e,t,n){return void 0===t&&void 0===n?e:void 0!==t&&void 0===n?Math.max(e,t):void 0===t&&void 0!==n?Math.min(e,n):Math.min(Math.max(e,t),n)}function randomId(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function useCallbackRef(e){const t=reactExports.useRef(e);return reactExports.useEffect(()=>{t.current=e}),reactExports.useMemo(()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)},[])}function useDebouncedCallback(e,t){const n=useCallbackRef(e),r=reactExports.useRef(0);return reactExports.useEffect(()=>()=>window.clearTimeout(r.current),[]),reactExports.useCallback((...e)=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>n(...e),t)},[n,t])}const DEFAULT_EVENTS=["mousedown","touchstart"];function useClickOutside(e,t,n){const r=reactExports.useRef();return reactExports.useEffect(()=>{const o=t=>{const{target:o}=t??{};if(Array.isArray(n)){const r=(null==o?void 0:o.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(o)&&"HTML"!==o.tagName;n.every(e=>!!e&&!t.composedPath().includes(e))&&!r&&e()}else r.current&&!r.current.contains(o)&&e()};return(t||DEFAULT_EVENTS).forEach(e=>document.addEventListener(e,o)),()=>{(t||DEFAULT_EVENTS).forEach(e=>document.removeEventListener(e,o))}},[r,e,n]),r}function attachMediaListener(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch(e2){return e.addListener(t),()=>e.removeListener(t)}}function getInitialValue(e,t){return"undefined"!=typeof window&&"matchMedia"in window&&window.matchMedia(e).matches}function useMediaQuery(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=reactExports.useState(n?t:getInitialValue(e)),i=reactExports.useRef();return reactExports.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),attachMediaListener(i.current,e=>o(e.matches))},[e]),r}const useIsomorphicEffect="undefined"!=typeof document?reactExports.useLayoutEffect:reactExports.useEffect;function useDidUpdate(e,t){const n=reactExports.useRef(!1);reactExports.useEffect(()=>()=>{n.current=!1},[]),reactExports.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function useFocusReturn({opened:e,shouldReturnFocus:t=!0}){const n=reactExports.useRef(),r=()=>{var e;n.current&&"focus"in n.current&&"function"==typeof n.current.focus&&(null==(e=n.current)||e.focus({preventScroll:!0}))};return useDidUpdate(()=>{let o=-1;const i=e=>{"Tab"===e.key&&window.clearTimeout(o)};return document.addEventListener("keydown",i),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",i)}},[e,t]),r}function createAriaHider(e,t="body > :not(script)"){const n=randomId(),r=Array.from(document.querySelectorAll(t)).map(t=>{var r;if((null==(r=null==t?void 0:t.shadowRoot)?void 0:r.contains(e))||t.contains(e))return;const o=t.getAttribute("aria-hidden"),i=t.getAttribute("data-hidden"),a=t.getAttribute("data-focus-id");return t.setAttribute("data-focus-id",n),null===o||"false"===o?t.setAttribute("aria-hidden","true"):i||a||t.setAttribute("data-hidden",o),{node:t,ariaHidden:i||null}});return()=>{r.forEach(e=>{e&&n===e.node.getAttribute("data-focus-id")&&(null===e.ariaHidden?e.node.removeAttribute("aria-hidden"):e.node.setAttribute("aria-hidden",e.ariaHidden),e.node.removeAttribute("data-focus-id"),e.node.removeAttribute("data-hidden"))})}}const TABBABLE_NODES=/input|select|textarea|button|object/,FOCUS_SELECTOR="a, input, select, textarea, button, object, [tabindex]";function hidden(e){return"none"===e.style.display}function visible(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||"hidden"===e.getAttribute("type"))return!1;let t=e;for(;t&&t!==document.body&&11!==t.nodeType;){if(hidden(t))return!1;t=t.parentNode}return!0}function getElementTabIndex(e){let t=e.getAttribute("tabindex");return null===t&&(t=void 0),parseInt(t,10)}function focusable(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(getElementTabIndex(e));return(TABBABLE_NODES.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&visible(e)}function tabbable(e){const t=getElementTabIndex(e);return(Number.isNaN(t)||t>=0)&&focusable(e)}function findTabbableDescendants(e){return Array.from(e.querySelectorAll(FOCUS_SELECTOR)).filter(tabbable)}function scopeTab(e,t){const n=findTabbableDescendants(e);if(!n.length)return void t.preventDefault();const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let i=r===o.activeElement||e===o.activeElement;const a=o.activeElement;if("INPUT"===a.tagName&&"radio"===a.getAttribute("type")){i=n.filter(e=>"radio"===e.getAttribute("type")&&e.getAttribute("name")===a.getAttribute("name")).includes(r)}if(!i)return;t.preventDefault();const s=n[t.shiftKey?n.length-1:0];s&&s.focus()}function useFocusTrap(e=!0){const t=reactExports.useRef(),n=reactExports.useRef(null),r=e=>{let t=e.querySelector("[data-autofocus]");if(!t){const n=Array.from(e.querySelectorAll(FOCUS_SELECTOR));t=n.find(tabbable)||n.find(focusable)||null,!t&&focusable(e)&&(t=e)}t&&t.focus({preventScroll:!0})},o=reactExports.useCallback(o=>{e&&(null!==o?(n.current=createAriaHider(o),t.current!==o&&(o?(setTimeout(()=>{o.getRootNode()&&r(o)}),t.current=o):t.current=null)):n.current&&(n.current(),n.current=null))},[e]);return reactExports.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const o=e=>{"Tab"===e.key&&t.current&&scopeTab(t.current,e)};return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o),n.current&&n.current()}},[e]),o}const __useId=React["useId".toString()]||(()=>{});function useReactId$1(){const e=__useId();return e?`mantine-${e.replace(/:/g,"")}`:""}function useId$1(e){const t=useReactId$1(),[n,r]=reactExports.useState(t);return useIsomorphicEffect(()=>{r(randomId())},[]),"string"==typeof e?e:"undefined"==typeof window?t:n}function assignRef(e,t){"function"==typeof e?e(t):"object"==typeof e&&null!==e&&"current"in e&&(e.current=t)}function mergeRefs(...e){return t=>{e.forEach(e=>assignRef(e,t))}}function useMergedRef(...e){return reactExports.useCallback(mergeRefs(...e),e)}function useMove(e,t,n="ltr"){const r=reactExports.useRef(null),o=reactExports.useRef(!1),i=reactExports.useRef(!1),a=reactExports.useRef(0),[s,l]=reactExports.useState(!1);return reactExports.useEffect(()=>{o.current=!0},[]),reactExports.useEffect(()=>{var s,c;const u=({x:t,y:i})=>{cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{if(o.current&&r.current){r.current.style.userSelect="none";const o=r.current.getBoundingClientRect();if(o.width&&o.height){const r=clamp$2((t-o.left)/o.width,0,1);e({x:"ltr"===n?r:1-r,y:clamp$2((i-o.top)/o.height,0,1)})}}})},d=()=>{!i.current&&o.current&&(i.current=!0,"function"==typeof(null==t?void 0:t.onScrubStart)&&t.onScrubStart(),l(!0),document.addEventListener("mousemove",f),document.addEventListener("mouseup",p),document.addEventListener("touchmove",m),document.addEventListener("touchend",p))},p=()=>{i.current&&o.current&&(i.current=!1,l(!1),document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",p),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",p),setTimeout(()=>{"function"==typeof(null==t?void 0:t.onScrubEnd)&&t.onScrubEnd()},0))},h=e=>{d(),e.preventDefault(),f(e)},f=e=>u({x:e.clientX,y:e.clientY}),A=e=>{e.cancelable&&e.preventDefault(),d(),m(e)},m=e=>{e.cancelable&&e.preventDefault(),u({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY})};return null==(s=r.current)||s.addEventListener("mousedown",h),null==(c=r.current)||c.addEventListener("touchstart",A,{passive:!1}),()=>{r.current&&(r.current.removeEventListener("mousedown",h),r.current.removeEventListener("touchstart",A))}},[n,e]),{ref:r,active:s}}function useUncontrolled({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,i]=reactExports.useState(void 0!==t?t:n);return void 0!==e?[e,r,!0]:[o,(e,...t)=>{i(e),null==r||r(e,...t)},!1]}function useReducedMotion(e,t){return useMediaQuery("(prefers-reduced-motion: reduce)",e,t)}function usePrevious(e){const t=reactExports.useRef();return reactExports.useEffect(()=>{t.current=e},[e]),t.current}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var browser={exports:{}},process=browser.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(e2){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(e2){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e2){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e2){cachedClearTimeout=defaultClearTimeout}}();var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop$3(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop$3,process.addListener=noop$3,process.once=noop$3,process.off=noop$3,process.removeListener=noop$3,process.removeAllListeners=noop$3,process.emit=noop$3,process.prependListener=noop$3,process.prependOnceListener=noop$3,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var browserExports=browser.exports;const process$1=getDefaultExportFromCjs(browserExports);var define_process_env_default$2={};function getEnv(){return void 0!==process$1&&define_process_env_default$2?"production":"development"}function createVarsResolver(e){return e}const EMPTY_CLASS_NAMES={};function mergeClassNames(e){const t={};return e.forEach(e=>{Object.entries(e).forEach(([e,n])=>{t[e]?t[e]=clsx$2(t[e],n):t[e]=n})}),t}function resolveClassNames({theme:e,classNames:t,props:n,stylesCtx:r}){return mergeClassNames((Array.isArray(t)?t:[t]).map(t=>"function"==typeof t?t(e,n,r):t||EMPTY_CLASS_NAMES))}function resolveStyles({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((t,o)=>"function"==typeof o?{...t,...o(e,n,r)}:{...t,...o},{})}const MantineContext=reactExports.createContext(null);function useMantineContext(){const e=reactExports.useContext(MantineContext);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function useMantineCssVariablesResolver(){return useMantineContext().cssVariablesResolver}function useMantineClassNamesPrefix(){return useMantineContext().classNamesPrefix}function useMantineStyleNonce(){return useMantineContext().getStyleNonce}function useMantineWithStaticClasses(){return useMantineContext().withStaticClasses}function useMantineIsHeadless(){return useMantineContext().headless}function useMantineSxTransform(){var e;return null==(e=useMantineContext().stylesTransform)?void 0:e.sx}function useMantineStylesTransform(){var e;return null==(e=useMantineContext().stylesTransform)?void 0:e.styles}function isHexColor(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function hexToRgba(e){let t=e.replace("#","");if(3===t.length){const e=t.split("");t=[e[0],e[0],e[1],e[1],e[2],e[2]].join("")}if(8===t.length){const e=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:e}}const n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:255&n,a:1}}function rgbStringToRgba(e){const[t,n,r,o]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:o||1}}function hslStringToRgba(e){const t=e.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);if(!t)return{r:0,g:0,b:0,a:1};const n=parseInt(t[1],10),r=parseInt(t[2],10)/100,o=parseInt(t[3],10)/100,i=t[5]?parseFloat(t[5]):void 0,a=(1-Math.abs(2*o-1))*r,s=n/60,l=a*(1-Math.abs(s%2-1)),c=o-a/2;let u,d,p;return s>=0&&s<1?(u=a,d=l,p=0):s>=1&&s<2?(u=l,d=a,p=0):s>=2&&s<3?(u=0,d=a,p=l):s>=3&&s<4?(u=0,d=l,p=a):s>=4&&s<5?(u=l,d=0,p=a):(u=a,d=0,p=l),{r:Math.round(255*(u+c)),g:Math.round(255*(d+c)),b:Math.round(255*(p+c)),a:i||1}}function toRgba(e){return isHexColor(e)?hexToRgba(e):e.startsWith("rgb")?rgbStringToRgba(e):e.startsWith("hsl")?hslStringToRgba(e):{r:0,g:0,b:0,a:1}}function darken(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${100*t}%)`;const{r:n,g:r,b:o,a:i}=toRgba(e),a=1-t,s=e=>Math.round(e*a);return`rgba(${s(n)}, ${s(r)}, ${s(o)}, ${i})`}function getPrimaryShade(e,t){return"number"==typeof e.primaryShade?e.primaryShade:"dark"===t?e.primaryShade.dark:e.primaryShade.light}function gammaCorrect(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function getLightnessFromOklch(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function luminance(e){if(e.startsWith("oklch("))return(getLightnessFromOklch(e)||0)/100;const{r:t,g:n,b:r}=toRgba(e),o=n/255,i=r/255;return.2126*gammaCorrect(t/255)+.7152*gammaCorrect(o)+.0722*gammaCorrect(i)}function isLightColor$1(e,t=.179){return!e.startsWith("var(")&&luminance(e)>t}function parseThemeColor({color:e,theme:t,colorScheme:n}){if("string"!=typeof e)throw new Error("[@mantine/core] Failed to parse color. Expected color to be a string, instead got "+typeof e);if("bright"===e)return{color:e,value:"dark"===n?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:isLightColor$1("dark"===n?t.white:t.black,t.luminanceThreshold),variable:"--mantine-color-bright"};if("dimmed"===e)return{color:e,value:"dark"===n?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:isLightColor$1("dark"===n?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:"--mantine-color-dimmed"};if("white"===e||"black"===e)return{color:e,value:"white"===e?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:isLightColor$1("white"===e?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),i=o?Number(o):void 0,a=r in t.colors;if(a){const e=void 0!==i?t.colors[r][i]:t.colors[r][getPrimaryShade(t,n||"light")];return{color:r,value:e,shade:i,isThemeColor:a,isLight:isLightColor$1(e,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${i}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:a,isLight:isLightColor$1(e,t.luminanceThreshold),shade:i,variable:void 0}}function getThemeColor(e,t){const n=parseThemeColor({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function getGradient(e,t){const n={from:(null==e?void 0:e.from)||t.defaultGradient.from,to:(null==e?void 0:e.to)||t.defaultGradient.to,deg:(null==e?void 0:e.deg)||t.defaultGradient.deg||0},r=getThemeColor(n.from,t),o=getThemeColor(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function rgba(e,t){if("string"!=typeof e||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){return`color-mix(in srgb, ${e}, transparent ${100*(1-t)}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:o}=toRgba(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const alpha=rgba,defaultVariantColorsResolver=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const i=parseThemeColor({color:e,theme:t}),a="boolean"==typeof o?o:t.autoContrast;if("filled"===n){const t=a&&i.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return i.isThemeColor?void 0===i.shade?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:t,border:`${rem(1)} solid transparent`}:{background:`var(--mantine-color-${i.color}-${i.shade})`,hover:`var(--mantine-color-${i.color}-${9===i.shade?8:i.shade+1})`,color:t,border:`${rem(1)} solid transparent`}:{background:e,hover:darken(e,.1),color:t,border:`${rem(1)} solid transparent`}}if("light"===n){if(i.isThemeColor){if(void 0===i.shade)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${rem(1)} solid transparent`};const n=t.colors[i.color][i.shade];return{background:rgba(n,.1),hover:rgba(n,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${rem(1)} solid transparent`}}return{background:rgba(e,.1),hover:rgba(e,.12),color:e,border:`${rem(1)} solid transparent`}}if("outline"===n)return i.isThemeColor?void 0===i.shade?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${rem(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:rgba(t.colors[i.color][i.shade],.05),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${rem(1)} solid var(--mantine-color-${i.color}-${i.shade})`}:{background:"transparent",hover:rgba(e,.05),color:e,border:`${rem(1)} solid ${e}`};if("subtle"===n){if(i.isThemeColor){if(void 0===i.shade)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${rem(1)} solid transparent`};return{background:"transparent",hover:rgba(t.colors[i.color][i.shade],.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${rem(1)} solid transparent`}}return{background:"transparent",hover:rgba(e,.12),color:e,border:`${rem(1)} solid transparent`}}return"transparent"===n?i.isThemeColor?void 0===i.shade?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${rem(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${rem(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${rem(1)} solid transparent`}:"white"===n?i.isThemeColor?void 0===i.shade?{background:"var(--mantine-color-white)",hover:darken(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${rem(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:darken(t.white,.01),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${rem(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:darken(t.white,.01),color:e,border:`${rem(1)} solid transparent`}:"gradient"===n?{background:getGradient(r,t),hover:getGradient(r,t),color:"var(--mantine-color-white)",border:"none"}:"default"===n?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${rem(1)} solid var(--mantine-color-default-border)`}:{}},DEFAULT_COLORS={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},DEFAULT_FONT_FAMILY="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",DEFAULT_THEME={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:DEFAULT_COLORS,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:defaultVariantColorsResolver,autoContrast:!1,luminanceThreshold:.3,fontFamily:DEFAULT_FONT_FAMILY,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:DEFAULT_FONT_FAMILY,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:rem(34),lineHeight:"1.3"},h2:{fontSize:rem(26),lineHeight:"1.35"},h3:{fontSize:rem(22),lineHeight:"1.4"},h4:{fontSize:rem(18),lineHeight:"1.45"},h5:{fontSize:rem(16),lineHeight:"1.5"},h6:{fontSize:rem(14),lineHeight:"1.5"}}},fontSizes:{xs:rem(12),sm:rem(14),md:rem(16),lg:rem(18),xl:rem(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:rem(2),sm:rem(4),md:rem(8),lg:rem(16),xl:rem(32)},spacing:{xs:rem(10),sm:rem(12),md:rem(16),lg:rem(20),xl:rem(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), 0 ${rem(1)} ${rem(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${rem(10)} ${rem(15)} ${rem(-5)}, rgba(0, 0, 0, 0.04) 0 ${rem(7)} ${rem(7)} ${rem(-5)}`,md:`0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${rem(20)} ${rem(25)} ${rem(-5)}, rgba(0, 0, 0, 0.04) 0 ${rem(10)} ${rem(10)} ${rem(-5)}`,lg:`0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${rem(28)} ${rem(23)} ${rem(-7)}, rgba(0, 0, 0, 0.04) 0 ${rem(12)} ${rem(12)} ${rem(-7)}`,xl:`0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${rem(36)} ${rem(28)} ${rem(-7)}, rgba(0, 0, 0, 0.04) 0 ${rem(17)} ${rem(17)} ${rem(-7)}`},other:{},components:{}};function isMantineColorScheme(e){return"auto"===e||"dark"===e||"light"===e}function localStorageColorSchemeManager({key:e="mantine-color-scheme-value"}={}){let t;return{get:t=>{if("undefined"==typeof window)return t;try{const n=window.localStorage.getItem(e);return isMantineColorScheme(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(n){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",n)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&isMantineColorScheme(t.newValue)&&n(t.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const INVALID_PRIMARY_COLOR_ERROR="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",INVALID_PRIMARY_SHADE_ERROR="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function isValidPrimaryShade(e){return!(e<0||e>9)&&parseInt(e.toString(),10)===e}function validateMantineTheme(e){if(!(e.primaryColor in e.colors))throw new Error(INVALID_PRIMARY_COLOR_ERROR);if(!("object"!=typeof e.primaryShade||isValidPrimaryShade(e.primaryShade.dark)&&isValidPrimaryShade(e.primaryShade.light)))throw new Error(INVALID_PRIMARY_SHADE_ERROR);if("number"==typeof e.primaryShade&&!isValidPrimaryShade(e.primaryShade))throw new Error(INVALID_PRIMARY_SHADE_ERROR)}function mergeMantineTheme(e,t){var n;if(!t)return validateMantineTheme(e),e;const r=deepMerge(e,t);return t.fontFamily&&!(null==(n=t.headings)?void 0:n.fontFamily)&&(r.headings.fontFamily=t.fontFamily),validateMantineTheme(r),r}const MantineThemeContext=reactExports.createContext(null),useSafeMantineTheme=()=>reactExports.useContext(MantineThemeContext)||DEFAULT_THEME;function useMantineTheme(){const e=reactExports.useContext(MantineThemeContext);if(!e)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function MantineThemeProvider({theme:e,children:t,inherit:n=!0}){const r=useSafeMantineTheme(),o=reactExports.useMemo(()=>mergeMantineTheme(n?r:DEFAULT_THEME,e),[e,r,n]);return factory$1(MantineThemeContext.Provider,{value:o,children:t})}function MantineClasses(){const e=useMantineTheme(),t=useMantineStyleNonce(),n=keys(e.breakpoints).reduce((t,n)=>{const r=e.breakpoints[n].includes("px"),o=px(e.breakpoints[n]);return`${t}@media (max-width: ${r?o-.1+"px":em(o-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${o}px`:em(o)}) {.mantine-hidden-from-${n} {display: none !important;}}`},"");return factory$1("style",{"data-mantine-styles":"classes",nonce:null==t?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function cssVariablesObjectToString(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join("")}function wrapWithSelector(e,t){return(Array.isArray(e)?e:[e]).reduce((e,t)=>`${t}{${e}}`,t)}function convertCssVariables(e,t){const n=cssVariablesObjectToString(e.variables),r=n?wrapWithSelector(t,n):"",o=cssVariablesObjectToString(e.dark),i=cssVariablesObjectToString(e.light);return`${r}${o?wrapWithSelector(":host"===t?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,o):""}${i?wrapWithSelector(":host"===t?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,i):""}`}function getContrastColor({color:e,theme:t,autoContrast:n}){if(!("boolean"==typeof n?n:t.autoContrast))return"var(--mantine-color-white)";return parseThemeColor({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function getPrimaryContrastColor(e,t){return getContrastColor({color:e.colors[e.primaryColor][getPrimaryShade(e,t)],theme:e,autoContrast:null})}function getCSSColorVariables({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if("light"===n){const n=getPrimaryShade(e,"light"),i={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${9===n?8:n+1})`,[`--mantine-color-${r}-light`]:alpha(e.colors[t][n],.1),[`--mantine-color-${r}-light-hover`]:alpha(e.colors[t][n],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline-hover`]:alpha(e.colors[t][n],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...i}:i}const i=getPrimaryShade(e,"dark"),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${i})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${9===i?8:i+1})`,[`--mantine-color-${r}-light`]:alpha(e.colors[t][Math.max(0,i-2)],.15),[`--mantine-color-${r}-light-hover`]:alpha(e.colors[t][Math.max(0,i-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(i-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(i-4,0)})`,[`--mantine-color-${r}-outline-hover`]:alpha(e.colors[t][Math.max(i-4,0)],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...a}:a}function isVirtualColor(e){return!!e&&"object"==typeof e&&"mantine-virtual-color"in e}function assignSizeVariables(e,t,n){keys(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}MantineThemeProvider.displayName="@mantine/core/MantineThemeProvider";const defaultCssVariablesResolver=e=>{const t=getPrimaryShade(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:rem(e.defaultRadius),r={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-color-scheme":"light dark","--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-primary-color-contrast":getPrimaryContrastColor(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)"},dark:{"--mantine-primary-color-contrast":getPrimaryContrastColor(e,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)"}};assignSizeVariables(r.variables,e.breakpoints,"breakpoint"),assignSizeVariables(r.variables,e.spacing,"spacing"),assignSizeVariables(r.variables,e.fontSizes,"font-size"),assignSizeVariables(r.variables,e.lineHeights,"line-height"),assignSizeVariables(r.variables,e.shadows,"shadow"),assignSizeVariables(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((t,n)=>{r.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}),keys(e.colors).forEach(t=>{const n=e.colors[t];if(isVirtualColor(n))return Object.assign(r.light,getCSSColorVariables({theme:e,name:n.name,color:n.light,colorScheme:"light",withColorValues:!0})),void Object.assign(r.dark,getCSSColorVariables({theme:e,name:n.name,color:n.dark,colorScheme:"dark",withColorValues:!0}));n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,getCSSColorVariables({theme:e,color:t,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,getCSSColorVariables({theme:e,color:t,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return keys(o).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=o[t].fontSize,r.variables[`--mantine-${t}-line-height`]=o[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=o[t].fontWeight||e.headings.fontWeight}),r};function getMergedVariables({theme:e,generator:t}){const n=defaultCssVariablesResolver(e),r=null==t?void 0:t(e);return r?deepMerge(n,r):n}const defaultCssVariables=defaultCssVariablesResolver(DEFAULT_THEME);function removeDefaultVariables(e){const t={variables:{},light:{},dark:{}};return keys(e.variables).forEach(n=>{defaultCssVariables.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),keys(e.light).forEach(n=>{defaultCssVariables.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),keys(e.dark).forEach(n=>{defaultCssVariables.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function getColorSchemeCssVariables(e){return`\n ${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }\n ${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }\n`}function MantineCssVariables({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=useMantineTheme(),r=useMantineStyleNonce(),o=getMergedVariables({theme:n,generator:useMantineCssVariablesResolver()}),i=":root"===e&&t,a=convertCssVariables(i?removeDefaultVariables(o):o,e);return a?factory$1("style",{"data-mantine-styles":!0,nonce:null==r?void 0:r(),dangerouslySetInnerHTML:{__html:`${a}${i?"":getColorSchemeCssVariables(e)}`}}):null}function suppressNextjsWarning(){const e=console.error;console.error=(...t)=>{t.length>1&&"string"==typeof t[0]&&t[0].toLowerCase().includes("extra attributes from the server")&&"string"==typeof t[1]&&t[1].toLowerCase().includes("data-mantine-color-scheme")||e(...t)}}function setColorSchemeAttribute(e,t){var n;const r="auto"!==e?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";null==(n=t())||n.setAttribute("data-mantine-color-scheme",r)}function useProviderColorScheme({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=reactExports.useRef(),[i,a]=reactExports.useState(()=>e.get(t)),s=r||i,l=reactExports.useCallback(t=>{r||(setColorSchemeAttribute(t,n),a(t),e.set(t))},[e.set,s,r]),c=reactExports.useCallback(()=>{a(t),setColorSchemeAttribute(t,n),e.clear()},[e.clear,t]);return reactExports.useEffect(()=>(e.subscribe(l),e.unsubscribe),[e.subscribe,e.unsubscribe]),useIsomorphicEffect(()=>{setColorSchemeAttribute(e.get(t),n)},[]),reactExports.useEffect(()=>{var e;if(r)return setColorSchemeAttribute(r,n),()=>{};void 0===r&&setColorSchemeAttribute(i,n),o.current=window.matchMedia("(prefers-color-scheme: dark)");const t=e=>{"auto"===i&&setColorSchemeAttribute(e.matches?"dark":"light",n)};return null==(e=o.current)||e.addEventListener("change",t),()=>{var e;return null==(e=o.current)?void 0:e.removeEventListener("change",t)}},[i,r]),{colorScheme:s,setColorScheme:l,clearColorScheme:c}}function useRespectReduceMotion({respectReducedMotion:e,getRootElement:t}){useIsomorphicEffect(()=>{var n;e&&(null==(n=t())||n.setAttribute("data-respect-reduced-motion","true"))},[e])}function MantineProvider({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:i=!0,withCssVariables:a=!0,cssVariablesSelector:s=":root",classNamesPrefix:l="mantine",colorSchemeManager:c=localStorageColorSchemeManager(),defaultColorScheme:u="light",getRootElement:d=()=>document.documentElement,cssVariablesResolver:p,forceColorScheme:h,stylesTransform:f}){const{colorScheme:A,setColorScheme:m,clearColorScheme:g}=useProviderColorScheme({defaultColorScheme:u,forceColorScheme:h,manager:c,getRootElement:d});return useRespectReduceMotion({respectReducedMotion:(null==e?void 0:e.respectReducedMotion)||!1,getRootElement:d}),factory$1(MantineContext.Provider,{value:{colorScheme:A,setColorScheme:m,clearColorScheme:g,getRootElement:d,classNamesPrefix:l,getStyleNonce:n,cssVariablesResolver:p,cssVariablesSelector:s,withStaticClasses:r,stylesTransform:f},children:factory$1(MantineThemeProvider,{theme:e,children:[a&&factory$1(MantineCssVariables,{cssVariablesSelector:s,deduplicateCssVariables:i}),o&&factory$1(MantineClasses,{}),t]})})}function useResolvedStylesApi({classNames:e,styles:t,props:n,stylesCtx:r}){const o=useMantineTheme();return{resolvedClassNames:resolveClassNames({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:resolveStyles({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}MantineCssVariables.displayName="@mantine/CssVariables",suppressNextjsWarning(),MantineProvider.displayName="@mantine/core/MantineProvider";const FOCUS_CLASS_NAMES={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function getGlobalClassNames({theme:e,options:t,unstyled:n}){return clsx$2((null==t?void 0:t.focusable)&&!n&&(e.focusClassName||FOCUS_CLASS_NAMES[e.focusRing]),(null==t?void 0:t.active)&&!n&&e.activeClassName)}function getOptionsClassNames({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return resolveClassNames({theme:o,classNames:null==n?void 0:n.classNames,props:(null==n?void 0:n.props)||r,stylesCtx:t})[e]}function getResolvedClassNames({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return resolveClassNames({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function getRootClassName({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function getSelectorClassName({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function getStaticClassNames({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return!1===r?[]:e.map(e=>`${t}-${e}-${n}`)}function getThemeClassNames({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(e=>{var i,a;return null==(a=resolveClassNames({theme:t,classNames:null==(i=t.components[e])?void 0:i.classNames,props:r,stylesCtx:o}))?void 0:a[n]})}function getVariantClassName({options:e,classes:t,selector:n,unstyled:r}){return(null==e?void 0:e.variant)&&!r?t[`${n}--${e.variant}`]:void 0}function getClassName({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:i,classes:a,unstyled:s,className:l,rootSelector:c,props:u,stylesCtx:d,withStaticClasses:p,headless:h,transformedStyles:f}){return clsx$2(getGlobalClassNames({theme:e,options:t,unstyled:s||h}),getThemeClassNames({theme:e,themeName:n,selector:r,props:u,stylesCtx:d}),getVariantClassName({options:t,classes:a,selector:r,unstyled:s}),getResolvedClassNames({selector:r,stylesCtx:d,theme:e,classNames:i,props:u}),getResolvedClassNames({selector:r,stylesCtx:d,theme:e,classNames:f,props:u}),getOptionsClassNames({selector:r,stylesCtx:d,options:t,props:u,theme:e}),getRootClassName({rootSelector:c,selector:r,className:l}),getSelectorClassName({selector:r,classes:a,unstyled:s||h}),p&&!h&&getStaticClassNames({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:null==t?void 0:t.withStaticClass}),null==t?void 0:t.className)}function getThemeStyles({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(t=>{var i;return resolveStyles({theme:e,styles:null==(i=e.components[t])?void 0:i.styles,props:n,stylesCtx:r})[o]}).reduce((e,t)=>({...e,...t}),{})}function resolveStyle({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...resolveStyle({style:n,theme:t})}),{}):"function"==typeof e?e(t):null==e?{}:e}function mergeVars(e){return e.reduce((e,t)=>(t&&Object.keys(t).forEach(n=>{e[n]={...e[n],...filterProps(t[n])}}),e),{})}function resolveVars({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:i,themeName:a,headless:s}){var l;return null==(l=mergeVars([s?{}:null==t?void 0:t(n,r,o),...a.map(e=>{var t,i,a;return null==(a=null==(i=null==(t=n.components)?void 0:t[e])?void 0:i.vars)?void 0:a.call(i,n,r,o)}),null==e?void 0:e(n,r,o)]))?void 0:l[i]}function getStyle({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:i,rootSelector:a,styles:s,style:l,vars:c,varsResolver:u,headless:d,withStylesTransform:p}){return{...!p&&getThemeStyles({theme:e,themeName:t,props:o,stylesCtx:i,selector:n}),...!p&&resolveStyles({theme:e,styles:s,props:o,stylesCtx:i})[n],...!p&&resolveStyles({theme:e,styles:null==r?void 0:r.styles,props:(null==r?void 0:r.props)||o,stylesCtx:i})[n],...resolveVars({theme:e,props:o,stylesCtx:i,vars:c,varsResolver:u,selector:n,themeName:t,headless:d}),...a===n?resolveStyle({style:l,theme:e}):null,...resolveStyle({style:null==r?void 0:r.style,theme:e})}}function useStylesTransform({props:e,stylesCtx:t,themeName:n}){var r;const o=useMantineTheme(),i=null==(r=useMantineStylesTransform())?void 0:r();return{getTransformedStyles:r=>{if(!i)return[];return[...r.map(n=>i(n,{props:e,theme:o,ctx:t})),...n.map(n=>{var r;return i(null==(r=o.components[n])?void 0:r.styles,{props:e,theme:o,ctx:t})})].filter(Boolean)},withStylesTransform:!!i}}function useStyles$u({name:e,classes:t,props:n,stylesCtx:r,className:o,style:i,rootSelector:a="root",unstyled:s,classNames:l,styles:c,vars:u,varsResolver:d}){const p=useMantineTheme(),h=useMantineClassNamesPrefix(),f=useMantineWithStaticClasses(),A=useMantineIsHeadless(),m=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:g,getTransformedStyles:y}=useStylesTransform({props:n,stylesCtx:r,themeName:m});return(e,v)=>({className:getClassName({theme:p,options:v,themeName:m,selector:e,classNamesPrefix:h,classNames:l,classes:t,unstyled:s,className:o,rootSelector:a,props:n,stylesCtx:r,withStaticClasses:f,headless:A,transformedStyles:y([null==v?void 0:v.styles,c])}),style:getStyle({theme:p,themeName:m,selector:e,options:v,props:n,stylesCtx:r,rootSelector:a,styles:c,style:i,vars:u,varsResolver:d,headless:A,withStylesTransform:g})})}function getAutoContrastValue(e,t){return"boolean"==typeof e?e:t.autoContrast}function useProps(e,t,n){var r;const o=useMantineTheme(),i=null==(r=o.components[e])?void 0:r.defaultProps;return{...t,..."function"==typeof i?i(o):i,...filterProps(n)}}function createTheme(e){return e}function cssObjectToString(e){return keys(e).reduce((t,n)=>void 0!==e[n]?`${t}${camelToKebabCase(n)}:${e[n]};`:t,"").trim()}function stylesToString({selector:e,styles:t,media:n,container:r}){const o=t?cssObjectToString(t):"",i=Array.isArray(n)?n.map(t=>`@media${t.query}{${e}{${cssObjectToString(t.styles)}}}`):[],a=Array.isArray(r)?r.map(t=>`@container ${t.query}{${e}{${cssObjectToString(t.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${i.join("")}${a.join("")}`.trim()}function InlineStyles(e){const t=useMantineStyleNonce();return factory$1("style",{"data-mantine-styles":"inline",nonce:null==t?void 0:t(),dangerouslySetInnerHTML:{__html:stylesToString(e)}})}function extractStyleProps(e){const{m:t,mx:n,my:r,mt:o,mb:i,ml:a,mr:s,me:l,ms:c,p:u,px:d,py:p,pt:h,pb:f,pl:A,pr:m,pe:g,ps:y,bd:v,bg:b,c:x,opacity:w,ff:C,fz:$,fw:_,lts:S,ta:E,lh:k,fs:B,tt:P,td:T,w:I,miw:L,maw:M,h:D,mih:N,mah:F,bgsz:O,bgp:R,bgr:U,bga:j,pos:H,top:Q,left:z,bottom:V,right:W,inset:Y,display:G,flex:K,hiddenFrom:q,visibleFrom:J,lightHidden:Z,darkHidden:X,sx:ee,...te}=e;return{styleProps:filterProps({m:t,mx:n,my:r,mt:o,mb:i,ml:a,mr:s,me:l,ms:c,p:u,px:d,py:p,pt:h,pb:f,pl:A,pr:m,pe:g,ps:y,bd:v,bg:b,c:x,opacity:w,ff:C,fz:$,fw:_,lts:S,ta:E,lh:k,fs:B,tt:P,td:T,w:I,miw:L,maw:M,h:D,mih:N,mah:F,bgsz:O,bgp:R,bgr:U,bga:j,pos:H,top:Q,left:z,bottom:V,right:W,inset:Y,display:G,flex:K,hiddenFrom:q,visibleFrom:J,lightHidden:Z,darkHidden:X,sx:ee}),rest:te}}const STYlE_PROPS_DATA={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function colorResolver(e,t){const n=parseThemeColor({color:e,theme:t});return"dimmed"===n.color?"var(--mantine-color-dimmed)":"bright"===n.color?"var(--mantine-color-bright)":n.variable?`var(${n.variable})`:n.color}function textColorResolver(e,t){const n=parseThemeColor({color:e,theme:t});return n.isThemeColor&&void 0===n.shade?`var(--mantine-color-${n.color}-text)`:colorResolver(e,t)}function borderResolver(e,t){if("number"==typeof e)return rem(e);if("string"==typeof e){const[n,r,...o]=e.split(" ").filter(e=>""!==e.trim());let i=`${rem(n)}`;return r&&(i+=` ${r}`),o.length>0&&(i+=` ${colorResolver(o.join(" "),t)}`),i.trim()}return e}const values={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function fontFamilyResolver(e){return"string"==typeof e&&e in values?values[e]:e}const headings$1=["h1","h2","h3","h4","h5","h6"];function fontSizeResolver(e,t){return"string"==typeof e&&e in t.fontSizes?`var(--mantine-font-size-${e})`:"string"==typeof e&&headings$1.includes(e)?`var(--mantine-${e}-font-size)`:"number"==typeof e||"string"==typeof e?rem(e):e}function identityResolver(e){return e}const headings=["h1","h2","h3","h4","h5","h6"];function lineHeightResolver(e,t){return"string"==typeof e&&e in t.lineHeights?`var(--mantine-line-height-${e})`:"string"==typeof e&&headings.includes(e)?`var(--mantine-${e}-line-height)`:e}function sizeResolver(e){return"number"==typeof e?rem(e):e}function spacingResolver(e,t){if("number"==typeof e)return rem(e);if("string"==typeof e){const n=e.replace("-","");if(!(n in t.spacing))return rem(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const resolvers={color:colorResolver,textColor:textColorResolver,fontSize:fontSizeResolver,spacing:spacingResolver,identity:identityResolver,size:sizeResolver,lineHeight:lineHeightResolver,fontFamily:fontFamilyResolver,border:borderResolver};function replaceMediaQuery(e){return e.replace("(min-width: ","").replace("em)","")}function sortMediaQueries({media:e,...t}){const n=Object.keys(e).sort((e,t)=>Number(replaceMediaQuery(e))-Number(replaceMediaQuery(t))).map(t=>({query:t,styles:e[t]}));return{...t,media:n}}function hasResponsiveStyles(e){if("object"!=typeof e||null===e)return!1;const t=Object.keys(e);return 1!==t.length||"base"!==t[0]}function getBaseValue(e){return"object"==typeof e&&null!==e?"base"in e?e.base:void 0:e}function getBreakpointKeys(e){return"object"==typeof e&&null!==e?keys(e).filter(e=>"base"!==e):[]}function getBreakpointValue(e,t){return"object"==typeof e&&null!==e&&t in e?e[t]:e}function parseStyleProps({styleProps:e,data:t,theme:n}){return sortMediaQueries(keys(e).reduce((r,o)=>{if("hiddenFrom"===o||"visibleFrom"===o||"sx"===o)return r;const i=t[o],a=Array.isArray(i.property)?i.property:[i.property],s=getBaseValue(e[o]);if(!hasResponsiveStyles(e[o]))return a.forEach(e=>{r.inlineStyles[e]=resolvers[i.type](s,n)}),r;r.hasResponsiveStyles=!0;const l=getBreakpointKeys(e[o]);return a.forEach(t=>{s&&(r.styles[t]=resolvers[i.type](s,n)),l.forEach(a=>{const s=`(min-width: ${n.breakpoints[a]})`;r.media[s]={...r.media[s],[t]:resolvers[i.type](getBreakpointValue(e[o],a),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function useRandomClassName(){return`__m__-${reactExports.useId().replace(/:/g,"")}`}function createPolymorphicComponent(e){return e}function transformModKey(e){return e.startsWith("data-")?e:`data-${e}`}function getMod(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return void 0===r||""===r||!1===r||null===r||(t[transformModKey(n)]=e[n]),t},{})}function getBoxMod(e){return e?"string"==typeof e?{[transformModKey(e)]:!0}:Array.isArray(e)?[...e].reduce((e,t)=>({...e,...getBoxMod(t)}),{}):getMod(e):null}function mergeStyles(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...mergeStyles(n,t)}),{}):"function"==typeof e?e(t):null==e?{}:e}function getBoxStyle({theme:e,style:t,vars:n,styleProps:r}){return{...mergeStyles(t,e),...mergeStyles(n,e),...r}}const _Box=reactExports.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:i,size:a,hiddenFrom:s,visibleFrom:l,lightHidden:c,darkHidden:u,renderRoot:d,__size:p,...h},f)=>{var A;const m=useMantineTheme(),g=e||"div",{styleProps:y,rest:v}=extractStyleProps(h),b=useMantineSxTransform(),x=null==(A=null==b?void 0:b())?void 0:A(y.sx),w=useRandomClassName(),C=parseStyleProps({styleProps:y,theme:m,data:STYlE_PROPS_DATA}),$={ref:f,style:getBoxStyle({theme:m,style:t,vars:n,styleProps:C.inlineStyles}),className:clsx$2(r,x,{[w]:C.hasResponsiveStyles,"mantine-light-hidden":c,"mantine-dark-hidden":u,[`mantine-hidden-from-${s}`]:s,[`mantine-visible-from-${l}`]:l}),"data-variant":o,"data-size":isNumberLike(a)?void 0:a||void 0,size:p,...getBoxMod(i),...v};return factory$1(Fragment,{children:[C.hasResponsiveStyles&&factory$1(InlineStyles,{selector:`.${w}`,styles:C.styles,media:C.media}),"function"==typeof d?d($):factory$1(g,{...$})]})});_Box.displayName="@mantine/core/Box";const Box=createPolymorphicComponent(_Box);function identity(e){return e}function factory(e){const t=reactExports.forwardRef(e);return t.extend=identity,t.withProps=e=>{const n=reactExports.forwardRef((n,r)=>factory$1(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t}function polymorphicFactory(e){const t=reactExports.forwardRef(e);return t.withProps=e=>{const n=reactExports.forwardRef((n,r)=>factory$1(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t.extend=identity,t}const DirectionContext=reactExports.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function useDirection(){return reactExports.useContext(DirectionContext)}const[ScrollAreaProvider,useScrollAreaContext]=createSafeContext("ScrollArea.Root component was not found in tree");function useResizeObserver(e,t){const n=useCallbackRef(t);useIsomorphicEffect(()=>{let t=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}const Corner=reactExports.forwardRef((e,t)=>{const{style:n,...r}=e,o=useScrollAreaContext(),[i,a]=reactExports.useState(0),[s,l]=reactExports.useState(0),c=Boolean(i&&s);return useResizeObserver(o.scrollbarX,()=>{var e;const t=(null==(e=o.scrollbarX)?void 0:e.offsetHeight)||0;o.onCornerHeightChange(t),l(t)}),useResizeObserver(o.scrollbarY,()=>{var e;const t=(null==(e=o.scrollbarY)?void 0:e.offsetWidth)||0;o.onCornerWidthChange(t),a(t)}),c?factory$1("div",{...r,ref:t,style:{...n,width:i,height:s}}):null}),ScrollAreaCorner=reactExports.forwardRef((e,t)=>{const n=useScrollAreaContext(),r=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&r?factory$1(Corner,{...e,ref:t}):null}),defaultProps$$={scrollHideDelay:1e3,type:"hover"},ScrollAreaRoot=reactExports.forwardRef((e,t)=>{const n=useProps("ScrollAreaRoot",defaultProps$$,e),{type:r,scrollHideDelay:o,scrollbars:i,...a}=n,[s,l]=reactExports.useState(null),[c,u]=reactExports.useState(null),[d,p]=reactExports.useState(null),[h,f]=reactExports.useState(null),[A,m]=reactExports.useState(null),[g,y]=reactExports.useState(0),[v,b]=reactExports.useState(0),[x,w]=reactExports.useState(!1),[C,$]=reactExports.useState(!1),_=useMergedRef(t,e=>l(e));return factory$1(ScrollAreaProvider,{value:{type:r,scrollHideDelay:o,scrollArea:s,viewport:c,onViewportChange:u,content:d,onContentChange:p,scrollbarX:h,onScrollbarXChange:f,scrollbarXEnabled:x,onScrollbarXEnabledChange:w,scrollbarY:A,onScrollbarYChange:m,scrollbarYEnabled:C,onScrollbarYEnabledChange:$,onCornerWidthChange:y,onCornerHeightChange:b},children:factory$1(Box,{...a,ref:_,__vars:{"--sa-corner-width":"xy"!==i?"0px":`${g}px`,"--sa-corner-height":"xy"!==i?"0px":`${v}px`}})})});function getThumbRatio(e,t){const n=e/t;return Number.isNaN(n)?0:n}function getThumbSize(e){const t=getThumbRatio(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function linearScale(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function clamp$1(e,[t,n]){return Math.min(n,Math.max(t,e))}function getThumbOffsetFromScroll(e,t,n="ltr"){const r=getThumbSize(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,s=i-r,l=clamp$1(e,"ltr"===n?[0,a]:[-1*a,0]);return linearScale([0,a],[0,s])(l)}function getScrollPositionFromPointer(e,t,n,r="ltr"){const o=getThumbSize(n),i=t||o/2,a=o-i,s=n.scrollbar.paddingStart+i,l=n.scrollbar.size-n.scrollbar.paddingEnd-a,c=n.content-n.viewport;return linearScale([s,l],"ltr"===r?[0,c]:[-1*c,0])(e)}function isScrollingWithinScrollbarBounds(e,t){return e>0&&e<t}function toInt(e){return e?parseInt(e,10):0}function composeEventHandlers(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{null==e||e(r),!1!==n&&r.defaultPrevented||null==t||t(r)}}ScrollAreaRoot.displayName="@mantine/core/ScrollAreaRoot";const[ScrollbarProvider,useScrollbarContext]=createSafeContext("ScrollAreaScrollbar was not found in tree"),Scrollbar=reactExports.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:s,onDragScroll:l,onWheelScroll:c,onResize:u,...d}=e,p=useScrollAreaContext(),[h,f]=reactExports.useState(null),A=useMergedRef(t,e=>f(e)),m=reactExports.useRef(null),g=reactExports.useRef(""),{viewport:y}=p,v=n.content-n.viewport,b=useCallbackRef(c),x=useCallbackRef(s),w=useDebouncedCallback(u,10),C=e=>{if(m.current){const t=e.clientX-m.current.left,n=e.clientY-m.current.top;l({x:t,y:n})}};return reactExports.useEffect(()=>{const e=e=>{const t=e.target;(null==h?void 0:h.contains(t))&&b(e,v)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[y,h,v,b]),reactExports.useEffect(x,[n,x]),useResizeObserver(h,w),useResizeObserver(p.content,w),factory$1(ScrollbarProvider,{value:{scrollbar:h,hasThumb:r,onThumbChange:useCallbackRef(o),onThumbPointerUp:useCallbackRef(i),onThumbPositionChange:x,onThumbPointerDown:useCallbackRef(a)},children:factory$1("div",{...d,ref:A,"data-mantine-scrollbar":!0,style:{position:"absolute",...d.style},onPointerDown:composeEventHandlers(e.onPointerDown,e=>{e.preventDefault();if(0===e.button){e.target.setPointerCapture(e.pointerId),m.current=h.getBoundingClientRect(),g.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",C(e)}}),onPointerMove:composeEventHandlers(e.onPointerMove,C),onPointerUp:composeEventHandlers(e.onPointerUp,e=>{e.preventDefault();const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=g.current,m.current=null})})})}),ScrollAreaScrollbarX=reactExports.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,a=useScrollAreaContext(),[s,l]=reactExports.useState(),c=reactExports.useRef(null),u=useMergedRef(t,c,a.onScrollbarXChange);return reactExports.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),factory$1(Scrollbar,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{...o,"--sa-thumb-width":`${getThumbSize(n)}px`},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){const r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),isScrollingWithinScrollbarBounds(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&s&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:toInt(s.paddingLeft),paddingEnd:toInt(s.paddingRight)}})}})}),ScrollAreaScrollbarY=reactExports.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,a=useScrollAreaContext(),[s,l]=reactExports.useState(),c=reactExports.useRef(null),u=useMergedRef(t,c,a.onScrollbarYChange);return reactExports.useEffect(()=>{c.current&&l(window.getComputedStyle(c.current))},[]),factory$1(Scrollbar,{...i,"data-orientation":"vertical",ref:u,sizes:n,style:{"--sa-thumb-height":`${getThumbSize(n)}px`,...o},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){const r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),isScrollingWithinScrollbarBounds(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&s&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:toInt(s.paddingTop),paddingEnd:toInt(s.paddingBottom)}})}})}),ScrollAreaScrollbarVisible=reactExports.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=useDirection(),i=useScrollAreaContext(),a=reactExports.useRef(null),s=reactExports.useRef(0),[l,c]=reactExports.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=getThumbRatio(l.viewport,l.content),d={...r,sizes:l,onSizesChange:c,hasThumb:Boolean(u>0&&u<1),onThumbChange:e=>{a.current=e},onThumbPointerUp:()=>{s.current=0},onThumbPointerDown:e=>{s.current=e}},p=(e,t)=>getScrollPositionFromPointer(e,s.current,l,t);return"horizontal"===n?factory$1(ScrollAreaScrollbarX,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const e=getThumbOffsetFromScroll(i.viewport.scrollLeft,l,o);a.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=p(e,o))}}):"vertical"===n?factory$1(ScrollAreaScrollbarY,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const e=getThumbOffsetFromScroll(i.viewport.scrollTop,l);0===l.scrollbar.size?a.current.style.opacity="0":a.current.style.opacity="1",a.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=p(e))}}):null}),ScrollAreaScrollbarAuto=reactExports.forwardRef((e,t)=>{const n=useScrollAreaContext(),{forceMount:r,...o}=e,[i,a]=reactExports.useState(!1),s="horizontal"===e.orientation,l=useDebouncedCallback(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;a(s?e:t)}},10);return useResizeObserver(n.viewport,l),useResizeObserver(n.content,l),r||i?factory$1(ScrollAreaScrollbarVisible,{"data-state":i?"visible":"hidden",...o,ref:t}):null}),ScrollAreaScrollbarHover=reactExports.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=useScrollAreaContext(),[i,a]=reactExports.useState(!1);return reactExports.useEffect(()=>{const{scrollArea:e}=o;let t=0;if(e){const n=()=>{window.clearTimeout(t),a(!0)},r=()=>{t=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[o.scrollArea,o.scrollHideDelay]),n||i?factory$1(ScrollAreaScrollbarAuto,{"data-state":i?"visible":"hidden",...r,ref:t}):null}),ScrollAreaScrollbarScroll=reactExports.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=useScrollAreaContext(),i="horizontal"===e.orientation,[a,s]=reactExports.useState("hidden"),l=useDebouncedCallback(()=>s("idle"),100);return reactExports.useEffect(()=>{if("idle"===a){const e=window.setTimeout(()=>s("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(e)}},[a,o.scrollHideDelay]),reactExports.useEffect(()=>{const{viewport:e}=o,t=i?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(s("scrolling"),l()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[o.viewport,i,l]),n||"hidden"!==a?factory$1(ScrollAreaScrollbarVisible,{"data-state":"hidden"===a?"hidden":"visible",...r,ref:t,onPointerEnter:composeEventHandlers(e.onPointerEnter,()=>s("interacting")),onPointerLeave:composeEventHandlers(e.onPointerLeave,()=>s("idle"))}):null}),ScrollAreaScrollbar=reactExports.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=useScrollAreaContext(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,s="horizontal"===e.orientation;return reactExports.useEffect(()=>(s?i(!0):a(!0),()=>{s?i(!1):a(!1)}),[s,i,a]),"hover"===o.type?factory$1(ScrollAreaScrollbarHover,{...r,ref:t,forceMount:n}):"scroll"===o.type?factory$1(ScrollAreaScrollbarScroll,{...r,ref:t,forceMount:n}):"auto"===o.type?factory$1(ScrollAreaScrollbarAuto,{...r,ref:t,forceMount:n}):"always"===o.type?factory$1(ScrollAreaScrollbarVisible,{...r,ref:t}):null});function addUnlinkedScrollListener(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,s=n.top!==i.top;(a||s)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)}const Thumb$1=reactExports.forwardRef((e,t)=>{const{style:n,...r}=e,o=useScrollAreaContext(),i=useScrollbarContext(),{onThumbPositionChange:a}=i,s=useMergedRef(t,e=>i.onThumbChange(e)),l=reactExports.useRef(),c=useDebouncedCallback(()=>{l.current&&(l.current(),l.current=void 0)},100);return reactExports.useEffect(()=>{const{viewport:e}=o;if(e){const t=()=>{if(c(),!l.current){const t=addUnlinkedScrollListener(e,a);l.current=t,a()}};return a(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,c,a]),factory$1("div",{"data-state":i.hasThumb?"visible":"hidden",...r,ref:s,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:composeEventHandlers(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;i.onThumbPointerDown({x:n,y:r})}),onPointerUp:composeEventHandlers(e.onPointerUp,i.onThumbPointerUp)})}),ScrollAreaThumb=reactExports.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=useScrollbarContext();return n||o.hasThumb?factory$1(Thumb$1,{ref:t,...r}):null}),ScrollAreaViewport=reactExports.forwardRef(({children:e,style:t,...n},r)=>{const o=useScrollAreaContext(),i=useMergedRef(r,o.onViewportChange);return factory$1(Box,{...n,ref:i,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t},children:factory$1("div",{style:{minWidth:"100%",display:"table"},ref:o.onContentChange,children:e})})});ScrollAreaViewport.displayName="@mantine/core/ScrollAreaViewport";var classes$p={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const defaultProps$_={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},varsResolver$n=createVarsResolver((e,{scrollbarSize:t})=>({root:{"--scrollarea-scrollbar-size":rem(t)}})),ScrollArea=factory((e,t)=>{const n=useProps("ScrollArea",defaultProps$_,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,scrollbarSize:l,vars:c,type:u,scrollHideDelay:d,viewportProps:p,viewportRef:h,onScrollPositionChange:f,children:A,offsetScrollbars:m,scrollbars:g,onBottomReached:y,onTopReached:v,...b}=n,[x,w]=reactExports.useState(!1),C=useStyles$u({name:"ScrollArea",props:n,classes:classes$p,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:c,varsResolver:varsResolver$n});return factory$1(ScrollAreaRoot,{type:"never"===u?"always":u,scrollHideDelay:d,ref:t,scrollbars:g,...C("root"),...b,children:[factory$1(ScrollAreaViewport,{...p,...C("viewport",{style:null==p?void 0:p.style}),ref:h,"data-offset-scrollbars":!0===m?"xy":m||void 0,"data-scrollbars":g||void 0,onScroll:e=>{var t;null==(t=null==p?void 0:p.onScroll)||t.call(p,e),null==f||f({x:e.currentTarget.scrollLeft,y:e.currentTarget.scrollTop});const{scrollTop:n,scrollHeight:r,clientHeight:o}=e.currentTarget;n-(r-o)===0&&(null==y||y()),0===n&&(null==v||v())},children:A}),("xy"===g||"x"===g)&&factory$1(ScrollAreaScrollbar,{...C("scrollbar"),orientation:"horizontal","data-hidden":"never"===u||void 0,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:factory$1(ScrollAreaThumb,{...C("thumb")})}),("xy"===g||"y"===g)&&factory$1(ScrollAreaScrollbar,{...C("scrollbar"),orientation:"vertical","data-hidden":"never"===u||void 0,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:factory$1(ScrollAreaThumb,{...C("thumb")})}),factory$1(ScrollAreaCorner,{...C("corner"),"data-hovered":x||void 0,"data-hidden":"never"===u||void 0})]})});ScrollArea.displayName="@mantine/core/ScrollArea";const ScrollAreaAutosize=factory((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:i,scrollHideDelay:a,type:s,dir:l,offsetScrollbars:c,viewportRef:u,onScrollPositionChange:d,unstyled:p,variant:h,viewportProps:f,scrollbars:A,style:m,vars:g,onBottomReached:y,...v}=useProps("ScrollAreaAutosize",defaultProps$_,e);return factory$1(Box,{...v,ref:t,style:[{display:"flex",overflow:"auto"},m],children:factory$1(Box,{style:{display:"flex",flexDirection:"column",flex:1},children:factory$1(ScrollArea,{classNames:r,styles:o,scrollHideDelay:a,scrollbarSize:i,type:s,dir:l,offsetScrollbars:c,viewportRef:u,onScrollPositionChange:d,unstyled:p,variant:h,viewportProps:f,vars:g,scrollbars:A,onBottomReached:y,children:n})})})});ScrollArea.classes=classes$p,ScrollAreaAutosize.displayName="@mantine/core/ScrollAreaAutosize",ScrollAreaAutosize.classes=classes$p,ScrollArea.Autosize=ScrollAreaAutosize;var classes$o={root:"m_87cf2631"};const defaultProps$Z={__staticSelector:"UnstyledButton"},UnstyledButton=polymorphicFactory((e,t)=>{const n=useProps("UnstyledButton",defaultProps$Z,e),{className:r,component:o="button",__staticSelector:i,unstyled:a,classNames:s,styles:l,style:c,...u}=n,d=useStyles$u({name:i,props:n,classes:classes$o,className:r,style:c,classNames:s,styles:l,unstyled:a});return factory$1(Box,{...d("root",{focusable:!0}),component:o,ref:t,type:"button"===o?"button":void 0,...u})});UnstyledButton.classes=classes$o,UnstyledButton.displayName="@mantine/core/UnstyledButton";var classes$n={root:"m_515a97f8"};const defaultProps$Y={},VisuallyHidden=factory((e,t)=>{const n=useProps("VisuallyHidden",defaultProps$Y,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,...c}=n,u=useStyles$u({name:"VisuallyHidden",classes:classes$n,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s});return factory$1(Box,{component:"span",ref:t,...u("root"),...c})});function hasWindow(){return"undefined"!=typeof window}function getNodeName(e){return isNode(e)?(e.nodeName||"").toLowerCase():"#document"}function getWindow(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function getDocumentElement(e){var t;return null==(t=(isNode(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function isNode(e){return!!hasWindow()&&(e instanceof Node||e instanceof getWindow(e).Node)}function isElement$1(e){return!!hasWindow()&&(e instanceof Element||e instanceof getWindow(e).Element)}function isHTMLElement(e){return!!hasWindow()&&(e instanceof HTMLElement||e instanceof getWindow(e).HTMLElement)}function isShadowRoot(e){return!(!hasWindow()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof getWindow(e).ShadowRoot)}VisuallyHidden.classes=classes$n,VisuallyHidden.displayName="@mantine/core/VisuallyHidden";const invalidOverflowDisplayValues=new Set(["inline","contents"]);function isOverflowElement(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=getComputedStyle$1(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!invalidOverflowDisplayValues.has(o)}const tableElements=new Set(["table","td","th"]);function isTableElement(e){return tableElements.has(getNodeName(e))}const topLayerSelectors=[":popover-open",":modal"];function isTopLayer(e){return topLayerSelectors.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const transformProperties=["transform","translate","scale","rotate","perspective"],willChangeValues=["transform","translate","scale","rotate","perspective","filter"],containValues=["paint","layout","strict","content"];function isContainingBlock(e){const t=isWebKit(),n=isElement$1(e)?getComputedStyle$1(e):e;return transformProperties.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||willChangeValues.some(e=>(n.willChange||"").includes(e))||containValues.some(e=>(n.contain||"").includes(e))}function getContainingBlock(e){let t=getParentNode(e);for(;isHTMLElement(t)&&!isLastTraversableNode(t);){if(isContainingBlock(t))return t;if(isTopLayer(t))return null;t=getParentNode(t)}return null}function isWebKit(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const lastTraversableNodeNames=new Set(["html","body","#document"]);function isLastTraversableNode(e){return lastTraversableNodeNames.has(getNodeName(e))}function getComputedStyle$1(e){return getWindow(e).getComputedStyle(e)}function getNodeScroll(e){return isElement$1(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function getParentNode(e){if("html"===getNodeName(e))return e;const t=e.assignedSlot||e.parentNode||isShadowRoot(e)&&e.host||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getNearestOverflowAncestor(e){const t=getParentNode(e);return isLastTraversableNode(t)?e.ownerDocument?e.ownerDocument.body:e.body:isHTMLElement(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=getNearestOverflowAncestor(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=getWindow(o);if(i){const e=getFrameElement(a);return t.concat(a,a.visualViewport||[],isOverflowElement(o)?o:[],e&&n?getOverflowAncestors(e):[])}return t.concat(o,getOverflowAncestors(o,[],n))}function getFrameElement(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const min$2=Math.min,max$3=Math.max,round$2=Math.round,floor$3=Math.floor,createCoords=e=>({x:e,y:e}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp(e,t,n){return max$3(e,min$2(t,n))}function evaluate(e,t){return"function"==typeof e?e(t):e}function getSide(e){return e.split("-")[0]}function getAlignment(e){return e.split("-")[1]}function getOppositeAxis(e){return"x"===e?"y":"x"}function getAxisLength(e){return"y"===e?"height":"width"}const yAxisSides=new Set(["top","bottom"]);function getSideAxis(e){return yAxisSides.has(getSide(e))?"y":"x"}function getAlignmentAxis(e){return getOppositeAxis(getSideAxis(e))}function getAlignmentSides(e,t,n){void 0===n&&(n=!1);const r=getAlignment(e),o=getAlignmentAxis(e),i=getAxisLength(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=getOppositePlacement(a)),[a,getOppositePlacement(a)]}function getExpandedPlacements(e){const t=getOppositePlacement(e);return[getOppositeAlignmentPlacement(e),t,getOppositeAlignmentPlacement(t)]}function getOppositeAlignmentPlacement(e){return e.replace(/start|end/g,e=>oppositeAlignmentMap[e])}const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(e,t,n){switch(e){case"top":case"bottom":return n?t?rlPlacement:lrPlacement:t?lrPlacement:rlPlacement;case"left":case"right":return t?tbPlacement:btPlacement;default:return[]}}function getOppositeAxisPlacements(e,t,n,r){const o=getAlignment(e);let i=getSideList(getSide(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(getOppositeAlignmentPlacement)))),i}function getOppositePlacement(e){return e.replace(/left|right|bottom|top/g,e=>oppositeSideMap[e])}function expandPaddingObject(e){return{top:0,right:0,bottom:0,left:0,...e}}function getPaddingObject(e){return"number"!=typeof e?expandPaddingObject(e):{top:e,right:e,bottom:e,left:e}}function rectToClientRect(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function computeCoordsFromPlacement(e,t,n){let{reference:r,floating:o}=e;const i=getSideAxis(t),a=getAlignmentAxis(t),s=getAxisLength(a),l=getSide(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(getAlignment(t)){case"start":h[a]-=p*(n&&c?-1:1);break;case"end":h[a]+=p*(n&&c?-1:1)}return h}async function detectOverflow(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=evaluate(t,e),f=getPaddingObject(h),A=s[p?"floating"===d?"reference":"floating":d],m=rectToClientRect(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(A)))||n?A:A.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),g="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),v=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=rectToClientRect(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:y,strategy:l}):g);return{top:(m.top-b.top+f.top)/v.y,bottom:(b.bottom-m.bottom+f.bottom)/v.y,left:(m.left-b.left+f.left)/v.x,right:(b.right-m.right+f.right)/v.x}}const computePosition$1=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=computeCoordsFromPlacement(c,r,l),p=r,h={},f=0;for(let m=0;m<s.length;m++){var A;const{name:n,fn:i}=s[m],{x:g,y:y,data:v,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:{...a,detectOverflow:null!=(A=a.detectOverflow)?A:detectOverflow},elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,h={...h,[n]:{...h[n],...v}},b&&f<=50&&(f++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=computeCoordsFromPlacement(c,p,l))),m=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}},arrow$3=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=evaluate(e,t)||{};if(null==c)return{};const d=getPaddingObject(u),p={x:n,y:r},h=getAlignmentAxis(o),f=getAxisLength(h),A=await a.getDimensions(c),m="y"===h,g=m?"top":"left",y=m?"bottom":"right",v=m?"clientHeight":"clientWidth",b=i.reference[f]+i.reference[h]-p[h]-i.floating[f],x=p[h]-i.reference[h],w=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let C=w?w[v]:0;C&&await(null==a.isElement?void 0:a.isElement(w))||(C=s.floating[v]||i.floating[f]);const $=b/2-x/2,_=C/2-A[f]/2-1,S=min$2(d[g],_),E=min$2(d[y],_),k=S,B=C-A[f]-E,P=C/2-A[f]/2+$,T=clamp(k,P,B),I=!l.arrow&&null!=getAlignment(o)&&P!==T&&i.reference[f]/2-(P<k?S:E)-A[f]/2<0,L=I?P<k?P-k:P-B:0;return{[h]:p[h]+L,data:{[h]:T,centerOffset:P-T-L,...I&&{alignmentOffset:L}},reset:I}}}),flip$2=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:A=!0,...m}=evaluate(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=getSide(o),y=getSideAxis(s),v=getSide(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=p||(v||!A?[getOppositePlacement(s)]:getExpandedPlacements(s)),w="none"!==f;!p&&w&&x.push(...getOppositeAxisPlacements(s,A,f,b));const C=[s,...x],$=await l.detectOverflow(t,m),_=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&_.push($[g]),d){const e=getAlignmentSides(o,a,b);_.push($[e[0]],$[e[1]])}if(S=[...S,{placement:o,overflows:_}],!_.every(e=>e<=0)){var E,k;const e=((null==(E=i.flip)?void 0:E.index)||0)+1,t=C[e];if(t){if(!("alignment"===d&&y!==getSideAxis(t))||S.every(e=>getSideAxis(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:S},reset:{placement:t}}}let n=null==(k=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:k.placement;if(!n)switch(h){case"bestFit":{var B;const e=null==(B=S.filter(e=>{if(w){const t=getSideAxis(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:B[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}};function getBoundingRect(e){const t=min$2(...e.map(e=>e.left)),n=min$2(...e.map(e=>e.top));return{x:t,y:n,width:max$3(...e.map(e=>e.right))-t,height:max$3(...e.map(e=>e.bottom))-n}}function getRectsByLine(e){const t=e.slice().sort((e,t)=>e.y-t.y),n=[];let r=null;for(let o=0;o<t.length;o++){const e=t[o];!r||e.y-r.y>r.height/2?n.push([e]):n[n.length-1].push(e),r=e}return n.map(e=>rectToClientRect(getBoundingRect(e)))}const inline$4=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:a}=t,{padding:s=2,x:l,y:c}=evaluate(e,t),u=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(r.reference))||[]),d=getRectsByLine(u),p=rectToClientRect(getBoundingRect(u)),h=getPaddingObject(s);const f=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===d.length&&d[0].left>d[1].right&&null!=l&&null!=c)return d.find(e=>l>e.left-h.left&&l<e.right+h.right&&c>e.top-h.top&&c<e.bottom+h.bottom)||p;if(d.length>=2){if("y"===getSideAxis(n)){const e=d[0],t=d[d.length-1],r="top"===getSide(n),o=e.top,i=t.bottom,a=r?e.left:t.left,s=r?e.right:t.right;return{top:o,bottom:i,left:a,right:s,width:s-a,height:i-o,x:a,y:o}}const e="left"===getSide(n),t=max$3(...d.map(e=>e.right)),r=min$2(...d.map(e=>e.left)),o=d.filter(n=>e?n.left===r:n.right===t),i=o[0].top,a=o[o.length-1].bottom;return{top:i,bottom:a,left:r,right:t,width:t-r,height:a-i,x:r,y:i}}return p}},floating:r.floating,strategy:a});return o.reference.x!==f.reference.x||o.reference.y!==f.reference.y||o.reference.width!==f.reference.width||o.reference.height!==f.reference.height?{reset:{rects:f}}:{}}}},originSides=new Set(["left","top"]);async function convertValueToCoords(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=getSide(n),s=getAlignment(n),l="y"===getSideAxis(n),c=originSides.has(a)?-1:1,u=i&&l?-1:1,d=evaluate(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}const offset$2=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await convertValueToCoords(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},shift$2=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=evaluate(e,t),u={x:n,y:r},d=await i.detectOverflow(t,c),p=getSideAxis(getSide(o)),h=getOppositeAxis(p);let f=u[h],A=u[p];if(a){const e="y"===h?"bottom":"right";f=clamp(f+d["y"===h?"top":"left"],f,f-d[e])}if(s){const e="y"===p?"bottom":"right";A=clamp(A+d["y"===p?"top":"left"],A,A-d[e])}const m=l.fn({...t,[h]:f,[p]:A});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:a,[p]:s}}}}}},limitShift$2=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=evaluate(e,t),u={x:n,y:r},d=getSideAxis(o),p=getOppositeAxis(d);let h=u[p],f=u[d];const A=evaluate(s,t),m="number"==typeof A?{mainAxis:A,crossAxis:0}:{mainAxis:0,crossAxis:0,...A};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+m.mainAxis,n=i.reference[p]+i.reference[e]-m.mainAxis;h<t?h=t:h>n&&(h=n)}if(c){var g,y;const e="y"===p?"width":"height",t=originSides.has(getSide(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(g=a.offset)?void 0:g[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[d])||0)-(t?m.crossAxis:0);f<n?f=n:f>r&&(f=r)}return{[p]:h,[d]:f}}}},size$2=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=evaluate(e,t),u=await a.detectOverflow(t,c),d=getSide(o),p=getAlignment(o),h="y"===getSideAxis(o),{width:f,height:A}=i.floating;let m,g;"top"===d||"bottom"===d?(m=d,g=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(g=d,m="end"===p?"top":"bottom");const y=A-u.top-u.bottom,v=f-u.left-u.right,b=min$2(A-u[m],y),x=min$2(f-u[g],v),w=!t.middlewareData.shift;let C=b,$=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&($=v),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(C=y),w&&!p){const e=max$3(u.left,0),t=max$3(u.right,0),n=max$3(u.top,0),r=max$3(u.bottom,0);h?$=f-2*(0!==e||0!==t?e+t:max$3(u.left,u.right)):C=A-2*(0!==n||0!==r?n+r:max$3(u.top,u.bottom))}await l({...t,availableWidth:$,availableHeight:C});const _=await a.getDimensions(s.floating);return f!==_.width||A!==_.height?{reset:{rects:!0}}:{}}}};function getCssDimensions(e){const t=getComputedStyle$1(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=isHTMLElement(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=round$2(n)!==i||round$2(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function unwrapElement(e){return isElement$1(e)?e:e.contextElement}function getScale(e){const t=unwrapElement(e);if(!isHTMLElement(t))return createCoords(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=getCssDimensions(t);let a=(i?round$2(n.width):n.width)/r,s=(i?round$2(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const noOffsets=createCoords(0);function getVisualOffsets(e){const t=getWindow(e);return isWebKit()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:noOffsets}function shouldAddVisualOffsets(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==getWindow(e))&&t}function getBoundingClientRect(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=unwrapElement(e);let a=createCoords(1);t&&(r?isElement$1(r)&&(a=getScale(r)):a=getScale(e));const s=shouldAddVisualOffsets(i,n,r)?getVisualOffsets(i):createCoords(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=getWindow(i),t=r&&isElement$1(r)?getWindow(r):r;let n=e,o=getFrameElement(n);for(;o&&r&&t!==n;){const e=getScale(o),t=o.getBoundingClientRect(),r=getComputedStyle$1(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=getWindow(o),o=getFrameElement(n)}}return rectToClientRect({width:u,height:d,x:l,y:c})}function getWindowScrollBarX(e,t){const n=getNodeScroll(e).scrollLeft;return t?t.left+n:getBoundingClientRect(getDocumentElement(e)).left+n}function getHTMLOffset(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-getWindowScrollBarX(e,n),y:n.top+t.scrollTop}}function convertOffsetParentRelativeRectToViewportRelativeRect(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=getDocumentElement(r),s=!!t&&isTopLayer(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=createCoords(1);const u=createCoords(0),d=isHTMLElement(r);if((d||!d&&!i)&&(("body"!==getNodeName(r)||isOverflowElement(a))&&(l=getNodeScroll(r)),isHTMLElement(r))){const e=getBoundingClientRect(r);c=getScale(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?createCoords(0):getHTMLOffset(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function getClientRects(e){return Array.from(e.getClientRects())}function getDocumentRect(e){const t=getDocumentElement(e),n=getNodeScroll(e),r=e.ownerDocument.body,o=max$3(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=max$3(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+getWindowScrollBarX(e);const s=-n.scrollTop;return"rtl"===getComputedStyle$1(r).direction&&(a+=max$3(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}const SCROLLBAR_MAX=25;function getViewportRect(e,t){const n=getWindow(e),r=getDocumentElement(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=isWebKit();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=getWindowScrollBarX(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=SCROLLBAR_MAX&&(i-=a)}else c<=SCROLLBAR_MAX&&(i+=c);return{width:i,height:a,x:s,y:l}}const absoluteOrFixed=new Set(["absolute","fixed"]);function getInnerBoundingClientRect(e,t){const n=getBoundingClientRect(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=isHTMLElement(e)?getScale(e):createCoords(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}function getClientRectFromClippingAncestor(e,t,n){let r;if("viewport"===t)r=getViewportRect(e,n);else if("document"===t)r=getDocumentRect(getDocumentElement(e));else if(isElement$1(t))r=getInnerBoundingClientRect(t,n);else{const n=getVisualOffsets(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return rectToClientRect(r)}function hasFixedPositionAncestor(e,t){const n=getParentNode(e);return!(n===t||!isElement$1(n)||isLastTraversableNode(n))&&("fixed"===getComputedStyle$1(n).position||hasFixedPositionAncestor(n,t))}function getClippingElementAncestors(e,t){const n=t.get(e);if(n)return n;let r=getOverflowAncestors(e,[],!1).filter(e=>isElement$1(e)&&"body"!==getNodeName(e)),o=null;const i="fixed"===getComputedStyle$1(e).position;let a=i?getParentNode(e):e;for(;isElement$1(a)&&!isLastTraversableNode(a);){const t=getComputedStyle$1(a),n=isContainingBlock(a);n||"fixed"!==t.position||(o=null);(i?!n&&!o:!n&&"static"===t.position&&!!o&&absoluteOrFixed.has(o.position)||isOverflowElement(a)&&!n&&hasFixedPositionAncestor(e,a))?r=r.filter(e=>e!==a):o=t,a=getParentNode(a)}return t.set(e,r),r}function getClippingRect(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?isTopLayer(t)?[]:getClippingElementAncestors(t,this._c):[].concat(n),r],a=i[0],s=i.reduce((e,n)=>{const r=getClientRectFromClippingAncestor(t,n,o);return e.top=max$3(r.top,e.top),e.right=min$2(r.right,e.right),e.bottom=min$2(r.bottom,e.bottom),e.left=max$3(r.left,e.left),e},getClientRectFromClippingAncestor(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function getDimensions(e){const{width:t,height:n}=getCssDimensions(e);return{width:t,height:n}}function getRectRelativeToOffsetParent(e,t,n){const r=isHTMLElement(t),o=getDocumentElement(t),i="fixed"===n,a=getBoundingClientRect(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=createCoords(0);function c(){l.x=getWindowScrollBarX(o)}if(r||!r&&!i)if(("body"!==getNodeName(t)||isOverflowElement(o))&&(s=getNodeScroll(t)),r){const e=getBoundingClientRect(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=!o||r||i?createCoords(0):getHTMLOffset(o,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function isStaticPositioned(e){return"static"===getComputedStyle$1(e).position}function getTrueOffsetParent(e,t){if(!isHTMLElement(e)||"fixed"===getComputedStyle$1(e).position)return null;if(t)return t(e);let n=e.offsetParent;return getDocumentElement(e)===n&&(n=n.ownerDocument.body),n}function getOffsetParent(e,t){const n=getWindow(e);if(isTopLayer(e))return n;if(!isHTMLElement(e)){let t=getParentNode(e);for(;t&&!isLastTraversableNode(t);){if(isElement$1(t)&&!isStaticPositioned(t))return t;t=getParentNode(t)}return n}let r=getTrueOffsetParent(e,t);for(;r&&isTableElement(r)&&isStaticPositioned(r);)r=getTrueOffsetParent(r,t);return r&&isLastTraversableNode(r)&&isStaticPositioned(r)&&!isContainingBlock(r)?n:r||getContainingBlock(e)||n}const getElementRects=async function(e){const t=this.getOffsetParent||getOffsetParent,n=this.getDimensions,r=await n(e.floating);return{reference:getRectRelativeToOffsetParent(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function isRTL(e){return"rtl"===getComputedStyle$1(e).direction}const platform={convertOffsetParentRelativeRectToViewportRelativeRect:convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement:getDocumentElement,getClippingRect:getClippingRect,getOffsetParent:getOffsetParent,getElementRects:getElementRects,getClientRects:getClientRects,getDimensions:getDimensions,getScale:getScale,isElement:isElement$1,isRTL:isRTL};function rectsAreEqual(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function observeMove(e,t){let n,r=null;const o=getDocumentElement(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-floor$3(d)+"px "+-floor$3(o.clientWidth-(u+p))+"px "+-floor$3(o.clientHeight-(d+h))+"px "+-floor$3(u)+"px",threshold:max$3(0,min$2(1,l))||1};let A=!0;function m(t){const r=t[0].intersectionRatio;if(r!==l){if(!A)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||rectsAreEqual(c,e.getBoundingClientRect())||a(),A=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(g){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}function autoUpdate(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=unwrapElement(e),u=o||i?[...c?getOverflowAncestors(c):[],...getOverflowAncestors(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=c&&s?observeMove(c,n):null;let p,h=-1,f=null;a&&(f=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let A=l?getBoundingClientRect(e):null;return l&&function t(){const r=getBoundingClientRect(e);A&&!rectsAreEqual(A,r)&&n();A=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const offset$1=offset$2,shift$1=shift$2,flip$1=flip$2,size$1=size$2,arrow$2=arrow$3,inline$3=inline$4,limitShift$1=limitShift$2,computePosition=(e,t,n)=>{const r=new Map,o={platform:platform,...n},i={...o.platform,_c:r};return computePosition$1(e,t,{...o,platform:i})};var isClient="undefined"!=typeof document,noop$2=function(){},index$3=isClient?reactExports.useLayoutEffect:noop$2;function deepEqual(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!deepEqual(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!deepEqual(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function getDPR(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(e,t){const n=getDPR(e);return Math.round(t*n)/n}function useLatestRef(e){const t=reactExports.useRef(e);return index$3(()=>{t.current=e}),t}function useFloating$1(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=reactExports.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=reactExports.useState(r);deepEqual(p,r)||h(r);const[f,A]=reactExports.useState(null),[m,g]=reactExports.useState(null),y=reactExports.useCallback(e=>{e!==w.current&&(w.current=e,A(e))},[]),v=reactExports.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=i||f,x=a||m,w=reactExports.useRef(null),C=reactExports.useRef(null),$=reactExports.useRef(u),_=null!=l,S=useLatestRef(l),E=useLatestRef(o),k=useLatestRef(c),B=reactExports.useCallback(()=>{if(!w.current||!C.current)return;const e={placement:t,strategy:n,middleware:p};E.current&&(e.platform=E.current),computePosition(w.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==k.current};P.current&&!deepEqual($.current,t)&&($.current=t,reactDomExports.flushSync(()=>{d(t)}))})},[p,t,n,E,k]);index$3(()=>{!1===c&&$.current.isPositioned&&($.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);const P=reactExports.useRef(!1);index$3(()=>(P.current=!0,()=>{P.current=!1}),[]),index$3(()=>{if(b&&(w.current=b),x&&(C.current=x),b&&x){if(S.current)return S.current(b,x,B);B()}},[b,x,B,S,_]);const T=reactExports.useMemo(()=>({reference:w,floating:C,setReference:y,setFloating:v}),[y,v]),I=reactExports.useMemo(()=>({reference:b,floating:x}),[b,x]),L=reactExports.useMemo(()=>{const e={position:n,left:0,top:0};if(!I.floating)return e;const t=roundByDPR(I.floating,u.x),r=roundByDPR(I.floating,u.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...getDPR(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,s,I.floating,u.x,u.y]);return reactExports.useMemo(()=>({...u,update:B,refs:T,elements:I,floatingStyles:L}),[u,B,T,I,L])}const arrow$1=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?arrow$2({element:n.current,padding:r}).fn(t):{}:n?arrow$2({element:n,padding:r}).fn(t):{};var o}}),offset=(e,t)=>({...offset$1(e),options:[e,t]}),shift=(e,t)=>({...shift$1(e),options:[e,t]}),limitShift=(e,t)=>({...limitShift$1(e),options:[e,t]}),flip=(e,t)=>({...flip$1(e),options:[e,t]}),size=(e,t)=>({...size$1(e),options:[e,t]}),inline$2=(e,t)=>({...inline$3(e),options:[e,t]}),arrow=(e,t)=>({...arrow$1(e),options:[e,t]}),SafeReact={...React$1},useInsertionEffect=SafeReact.useInsertionEffect,useSafeInsertionEffect=useInsertionEffect||(e=>e());function useEffectEvent(e){const t=reactExports.useRef(()=>{});return useSafeInsertionEffect(()=>{t.current=e}),reactExports.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}var index$2="undefined"!=typeof document?reactExports.useLayoutEffect:reactExports.useEffect;let serverHandoffComplete=!1,count=0;const genId=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+count++;function useFloatingId(){const[e,t]=reactExports.useState(()=>serverHandoffComplete?genId():void 0);return index$2(()=>{null==e&&t(genId())},[]),reactExports.useEffect(()=>{serverHandoffComplete=!0},[]),e}const useReactId=SafeReact.useId,useId=useReactId||useFloatingId;function createPubSub(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter(e=>e!==n))||[])}}}const FloatingNodeContext=reactExports.createContext(null),FloatingTreeContext=reactExports.createContext(null),useFloatingParentNodeId=()=>{var e;return(null==(e=reactExports.useContext(FloatingNodeContext))?void 0:e.id)||null},useFloatingTree=()=>reactExports.useContext(FloatingTreeContext);function useFloatingRootContext(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=useId(),i=reactExports.useRef({}),[a]=reactExports.useState(()=>createPubSub()),s=null!=useFloatingParentNodeId(),[l,c]=reactExports.useState(r.reference),u=useEffectEvent((e,t,r)=>{i.current.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:r,nested:s}),null==n||n(e,t,r)}),d=reactExports.useMemo(()=>({setPositionReference:c}),[]),p=reactExports.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return reactExports.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:p,events:a,floatingId:o,refs:d}),[t,u,p,a,o,d])}function useFloating(e){void 0===e&&(e={});const{nodeId:t}=e,n=useFloatingRootContext({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,a]=reactExports.useState(null),[s,l]=reactExports.useState(null),c=(null==o?void 0:o.domReference)||i,u=reactExports.useRef(null),d=useFloatingTree();index$2(()=>{c&&(u.current=c)},[c]);const p=useFloating$1({...e,elements:{...o,...s&&{reference:s}}}),h=reactExports.useCallback(e=>{const t=isElement$1(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),p.refs.setReference(t)},[p.refs]),f=reactExports.useCallback(e=>{(isElement$1(e)||null===e)&&(u.current=e,a(e)),(isElement$1(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!isElement$1(e))&&p.refs.setReference(e)},[p.refs]),A=reactExports.useMemo(()=>({...p.refs,setReference:f,setPositionReference:h,domReference:u}),[p.refs,f,h]),m=reactExports.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),g=reactExports.useMemo(()=>({...p,...r,refs:A,elements:m,nodeId:t}),[p,A,m,t,r]);return index$2(()=>{r.dataRef.current.floatingContext=g;const e=null==d?void 0:d.nodesRef.current.find(e=>e.id===t);e&&(e.context=g)}),reactExports.useMemo(()=>({...p,context:g,refs:A,elements:m}),[p,A,m,g])}function getFloatingPosition(e,t){if("rtl"===e&&(t.includes("right")||t.includes("left"))){const[e,n]=t.split("-"),r="right"===e?"left":"right";return void 0===n?r:`${r}-${n}`}return t}function horizontalSide(e,t,n,r){return"center"===e||"center"===r?{top:t}:"end"===e?{bottom:n}:"start"===e?{top:n}:{}}function verticalSide(e,t,n,r,o){return"center"===e||"center"===r?{left:t}:"end"===e?{["ltr"===o?"right":"left"]:n}:"start"===e?{["ltr"===o?"left":"right"]:n}:{}}const radiusByFloatingSide={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function getArrowPositionStyles({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:a,dir:s}){const[l,c="center"]=e.split("-"),u={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[radiusByFloatingSide[l]]:r},d=-t/2;return"left"===l?{...u,...horizontalSide(c,a,n,o),right:d,borderLeftColor:"transparent",borderBottomColor:"transparent"}:"right"===l?{...u,...horizontalSide(c,a,n,o),left:d,borderRightColor:"transparent",borderTopColor:"transparent"}:"top"===l?{...u,...verticalSide(c,i,n,o,s),bottom:d,borderTopColor:"transparent",borderLeftColor:"transparent"}:"bottom"===l?{...u,...verticalSide(c,i,n,o,s),top:d,borderBottomColor:"transparent",borderRightColor:"transparent"}:{}}const FloatingArrow=reactExports.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:i,arrowX:a,arrowY:s,style:l,...c},u)=>{const{dir:d}=useDirection();return i?factory$1("div",{...c,ref:u,style:{...l,...getArrowPositionStyles({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:d,arrowX:a,arrowY:s})}}):null});FloatingArrow.displayName="@mantine/core/FloatingArrow";const[PopoverContextProvider,usePopoverContext]=createSafeContext("Popover component was not found in the tree");function FocusTrap({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const o=useMergedRef(useFocusTrap(t),r);return isElement$2(e)?reactExports.cloneElement(e,{[n]:o}):e}function FocusTrapInitialFocus(e){return factory$1(VisuallyHidden,{tabIndex:-1,"data-autofocus":!0,...e})}function createPortalNode(e){const t=document.createElement("div");return t.setAttribute("data-portal","true"),"string"==typeof e.className&&t.classList.add(...e.className.split(" ").filter(Boolean)),"object"==typeof e.style&&Object.assign(t.style,e.style),"string"==typeof e.id&&t.setAttribute("id",e.id),t}FocusTrap.displayName="@mantine/core/FocusTrap",FocusTrapInitialFocus.displayName="@mantine/core/FocusTrapInitialFocus",FocusTrap.InitialFocus=FocusTrapInitialFocus;const defaultProps$X={},Portal=reactExports.forwardRef((e,t)=>{const{children:n,target:r,...o}=useProps("Portal",defaultProps$X,e),[i,a]=reactExports.useState(!1),s=reactExports.useRef(null);return useIsomorphicEffect(()=>(a(!0),s.current=r?"string"==typeof r?document.querySelector(r):r:createPortalNode(o),assignRef(t,s.current),!r&&s.current&&document.body.appendChild(s.current),()=>{!r&&s.current&&document.body.removeChild(s.current)}),[r]),i&&s.current?reactDomExports.createPortal(factory$1(Fragment,{children:n}),s.current):null});function OptionalPortal({withinPortal:e=!0,children:t,...n}){return e?factory$1(Portal,{...n,children:t}):factory$1(Fragment,{children:t})}Portal.displayName="@mantine/core/Portal",OptionalPortal.displayName="@mantine/core/OptionalPortal";const popIn=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${rem("bottom"===e?10:-10)})`},transitionProperty:"transform, opacity"}),transitions={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${rem(30)}`},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${rem(-30)}`},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${rem(30)}`},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${rem(-30)}`},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${rem(-20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${rem(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${rem(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${rem(20)}) rotate(5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...popIn("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...popIn("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...popIn("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...popIn("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...popIn("top"),common:{transformOrigin:"top right"}}},transitionStatuses={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function getTransitionStyles({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return"string"==typeof e?e in transitions?{transitionProperty:transitions[e].transitionProperty,...o,...transitions[e].common,...transitions[e][transitionStatuses[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[transitionStatuses[t]]}}function useTransition({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:i,onEntered:a,onExited:s,enterDelay:l,exitDelay:c}){const u=useMantineTheme(),d=useReducedMotion(),p=!!u.respectReducedMotion&&d,[h,f]=reactExports.useState(p?0:e),[A,m]=reactExports.useState(r?"entered":"exited"),g=reactExports.useRef(-1),y=reactExports.useRef(-1),v=reactExports.useRef(-1),b=n=>{const r=n?o:i,l=n?a:s;window.clearTimeout(g.current);const c=p?0:n?e:t;f(c),0===c?("function"==typeof r&&r(),"function"==typeof l&&l(),m(n?"entered":"exited")):v.current=requestAnimationFrame(()=>{ReactDOM.flushSync(()=>{m(n?"pre-entering":"pre-exiting")}),v.current=requestAnimationFrame(()=>{"function"==typeof r&&r(),m(n?"entering":"exiting"),g.current=window.setTimeout(()=>{"function"==typeof l&&l(),m(n?"entered":"exited")},c)})})};return useDidUpdate(()=>{var e;e=r,window.clearTimeout(y.current),"number"==typeof(e?l:c)?y.current=window.setTimeout(()=>{b(e)},e?l:c):b(e)},[r]),reactExports.useEffect(()=>()=>{window.clearTimeout(g.current),cancelAnimationFrame(v.current)},[]),{transitionDuration:h,transitionStatus:A,transitionTimingFunction:n||"ease"}}function Transition({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:i,timingFunction:a="ease",onExit:s,onEntered:l,onEnter:c,onExited:u,enterDelay:d,exitDelay:p}){const{transitionDuration:h,transitionStatus:f,transitionTimingFunction:A}=useTransition({mounted:o,exitDuration:r,duration:n,timingFunction:a,onExit:s,onEntered:l,onEnter:c,onExited:u,enterDelay:d,exitDelay:p});return 0===h?o?factory$1(Fragment,{children:i({})}):e?i({display:"none"}):null:"exited"===f?e?i({display:"none"}):null:factory$1(Fragment,{children:i(getTransitionStyles({transition:t,duration:h,state:f,timingFunction:A}))})}Transition.displayName="@mantine/core/Transition";var classes$m={dropdown:"m_38a85659",arrow:"m_a31dc6c1"};const defaultProps$W={},PopoverDropdown=factory((e,t)=>{var n,r,o,i;const a=useProps("PopoverDropdown",defaultProps$W,e),{className:s,style:l,vars:c,children:u,onKeyDownCapture:d,variant:p,classNames:h,styles:f,...A}=a,m=usePopoverContext(),g=useFocusReturn({opened:m.opened,shouldReturnFocus:m.returnFocus}),y=m.withRoles?{"aria-labelledby":m.getTargetId(),id:m.getDropdownId(),role:"dialog",tabIndex:-1}:{},v=useMergedRef(t,m.floating);return m.disabled?null:factory$1(OptionalPortal,{...m.portalProps,withinPortal:m.withinPortal,children:factory$1(Transition,{mounted:m.opened,...m.transitionProps,transition:(null==(n=m.transitionProps)?void 0:n.transition)||"fade",duration:(null==(r=m.transitionProps)?void 0:r.duration)??150,keepMounted:m.keepMounted,exitDuration:"number"==typeof(null==(o=m.transitionProps)?void 0:o.exitDuration)?m.transitionProps.exitDuration:null==(i=m.transitionProps)?void 0:i.duration,children:e=>factory$1(FocusTrap,{active:m.trapFocus&&m.opened,innerRef:v,children:factory$1(Box,{...y,...A,variant:p,onKeyDownCapture:closeOnEscape(m.onClose,{active:m.closeOnEscape,onTrigger:g,onKeyDown:d}),"data-position":m.placement,"data-fixed":"fixed"===m.floatingStrategy||void 0,...m.getStyles("dropdown",{className:s,props:a,classNames:h,styles:f,style:[{...e,zIndex:m.zIndex,top:m.y??0,left:m.x??0,width:"target"===m.width?void 0:rem(m.width)},l]}),children:[u,factory$1(FloatingArrow,{ref:m.arrowRef,arrowX:m.arrowX,arrowY:m.arrowY,visible:m.withArrow,position:m.placement,arrowSize:m.arrowSize,arrowRadius:m.arrowRadius,arrowOffset:m.arrowOffset,arrowPosition:m.arrowPosition,...m.getStyles("arrow",{props:a,classNames:h,styles:f})})]})})})})});PopoverDropdown.classes=classes$m,PopoverDropdown.displayName="@mantine/core/PopoverDropdown";const defaultProps$V={refProp:"ref",popupType:"dialog"},PopoverTarget=factory((e,t)=>{const{children:n,refProp:r,popupType:o,...i}=useProps("PopoverTarget",defaultProps$V,e);if(!isElement$2(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const a=i,s=usePopoverContext(),l=useMergedRef(s.reference,n.ref,t),c=s.withRoles?{"aria-haspopup":o,"aria-expanded":s.opened,"aria-controls":s.getDropdownId(),id:s.getTargetId()}:{};return reactExports.cloneElement(n,{...a,...c,...s.targetProps,className:clsx$2(s.targetProps.className,a.className,n.props.className),[r]:l,...s.controlled?null:{onClick:s.onToggle}})});function useFloatingAutoUpdate({opened:e,floating:t,position:n,positionDependencies:r}){const[o,i]=reactExports.useState(0);reactExports.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return autoUpdate(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),useDidUpdate(()=>{t.update()},r),useDidUpdate(()=>{i(e=>e+1)},[e])}function getDefaultMiddlewares(e){if(void 0===e)return{shift:!0,flip:!0};const t={...e};return void 0===e.shift&&(t.shift=!0),void 0===e.flip&&(t.flip=!0),t}function getPopoverMiddlewares(e,t){const n=getDefaultMiddlewares(e.middlewares),r=[offset(e.offset)];return n.shift&&r.push(shift("boolean"==typeof n.shift?{limiter:limitShift(),padding:5}:{limiter:limitShift(),padding:5,...n.shift})),n.flip&&r.push("boolean"==typeof n.flip?flip():flip(n.flip)),n.inline&&r.push("boolean"==typeof n.inline?inline$2():inline$2(n.inline)),r.push(arrow({element:e.arrowRef,padding:e.arrowOffset})),(n.size||"target"===e.width)&&r.push(size({..."boolean"==typeof n.size?{}:n.size,apply({rects:r,availableWidth:o,availableHeight:i,...a}){var s;const l=(null==(s=t().refs.floating.current)?void 0:s.style)??{};n.size&&("object"==typeof n.size&&n.size.apply?n.size.apply({rects:r,availableWidth:o,availableHeight:i,...a}):Object.assign(l,{maxWidth:`${o}px`,maxHeight:`${i}px`})),"target"===e.width&&Object.assign(l,{width:`${r.reference.width}px`})}})),r}function usePopover(e){const[t,n]=useUncontrolled({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=useFloating({strategy:e.strategy,placement:e.position,middleware:getPopoverMiddlewares(e,()=>r)});return useFloatingAutoUpdate({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies||[],floating:r}),useDidUpdate(()=>{var t;null==(t=e.onPositionChange)||t.call(e,r.placement)},[r.placement]),useDidUpdate(()=>{var t,n;e.opened?null==(n=e.onOpen)||n.call(e):null==(t=e.onClose)||t.call(e)},[e.opened]),{floating:r,controlled:"boolean"==typeof e.opened,opened:t,onClose:()=>{var r;t&&(null==(r=e.onClose)||r.call(e),n(!1))},onToggle:()=>{var r,o;t?(null==(r=e.onClose)||r.call(e),n(!1)):(null==(o=e.onOpen)||o.call(e),n(!0))}}}PopoverTarget.displayName="@mantine/core/PopoverTarget";const defaultProps$U={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:getDefaultZIndex("popover"),__staticSelector:"Popover",width:"max-content"},varsResolver$m=createVarsResolver((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":void 0===t?void 0:getRadius(t),"--popover-shadow":getShadow(n)}}));function Popover(e){var t,n,r,o,i,a;const s=useProps("Popover",defaultProps$U,e),{children:l,position:c,offset:u,onPositionChange:d,positionDependencies:p,opened:h,transitionProps:f,width:A,middlewares:m,withArrow:g,arrowSize:y,arrowOffset:v,arrowRadius:b,arrowPosition:x,unstyled:w,classNames:C,styles:$,closeOnClickOutside:_,withinPortal:S,portalProps:E,closeOnEscape:k,clickOutsideEvents:B,trapFocus:P,onClose:T,onOpen:I,onChange:L,zIndex:M,radius:D,shadow:N,id:F,defaultOpened:O,__staticSelector:R,withRoles:U,disabled:j,returnFocus:H,variant:Q,keepMounted:z,vars:V,floatingStrategy:W,...Y}=s,G=useStyles$u({name:R,props:s,classes:classes$m,classNames:C,styles:$,unstyled:w,rootSelector:"dropdown",vars:V,varsResolver:varsResolver$m}),K=reactExports.useRef(null),[q,J]=reactExports.useState(null),[Z,X]=reactExports.useState(null),{dir:ee}=useDirection(),te=useId$1(F),ne=usePopover({middlewares:m,width:A,position:getFloatingPosition(ee,c),offset:"number"==typeof u?u+(g?y/2:0):u,arrowRef:K,arrowOffset:v,onPositionChange:d,positionDependencies:p,opened:h,defaultOpened:O,onChange:L,onOpen:I,onClose:T,strategy:W});useClickOutside(()=>_&&ne.onClose(),B,[q,Z]);const re=reactExports.useCallback(e=>{J(e),ne.floating.refs.setReference(e)},[ne.floating.refs.setReference]),oe=reactExports.useCallback(e=>{X(e),ne.floating.refs.setFloating(e)},[ne.floating.refs.setFloating]);return factory$1(PopoverContextProvider,{value:{returnFocus:H,disabled:j,controlled:ne.controlled,reference:re,floating:oe,x:ne.floating.x,y:ne.floating.y,arrowX:null==(r=null==(n=null==(t=ne.floating)?void 0:t.middlewareData)?void 0:n.arrow)?void 0:r.x,arrowY:null==(a=null==(i=null==(o=ne.floating)?void 0:o.middlewareData)?void 0:i.arrow)?void 0:a.y,opened:ne.opened,arrowRef:K,transitionProps:f,width:A,withArrow:g,arrowSize:y,arrowOffset:v,arrowRadius:b,arrowPosition:x,placement:ne.floating.placement,trapFocus:P,withinPortal:S,portalProps:E,zIndex:M,radius:D,shadow:N,closeOnEscape:k,onClose:ne.onClose,onToggle:ne.onToggle,getTargetId:()=>`${te}-target`,getDropdownId:()=>`${te}-dropdown`,withRoles:U,targetProps:Y,__staticSelector:R,classNames:C,styles:$,unstyled:w,variant:Q,keepMounted:z,getStyles:G,floatingStrategy:W},children:l})}Popover.Target=PopoverTarget,Popover.Dropdown=PopoverDropdown,Popover.displayName="@mantine/core/Popover",Popover.extend=e=>e;const CloseIcon=reactExports.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>factory$1("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:r,...n,children:factory$1("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));CloseIcon.displayName="@mantine/core/CloseIcon";var classes$l={root:"m_86a44da5","root--subtle":"m_220c80f2"};const defaultProps$T={variant:"subtle"},varsResolver$l=createVarsResolver((e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":getSize(t,"cb-size"),"--cb-radius":void 0===n?void 0:getRadius(n),"--cb-icon-size":rem(r)}})),CloseButton=polymorphicFactory((e,t)=>{const n=useProps("CloseButton",defaultProps$T,e),{iconSize:r,children:o,vars:i,radius:a,className:s,classNames:l,style:c,styles:u,unstyled:d,"data-disabled":p,disabled:h,variant:f,icon:A,mod:m,...g}=n,y=useStyles$u({name:"CloseButton",props:n,className:s,style:c,classes:classes$l,classNames:l,styles:u,unstyled:d,vars:i,varsResolver:varsResolver$l});return factory$1(UnstyledButton,{ref:t,...g,unstyled:d,variant:f,disabled:h,mod:[{disabled:h||p},m],...y("root",{variant:f,active:!h&&!p}),children:[A||factory$1(CloseIcon,{}),o]})});CloseButton.classes=classes$l,CloseButton.displayName="@mantine/core/CloseButton";const[InputWrapperProvider,useInputWrapperContext]=createOptionalContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var classes$k={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const defaultProps$S={},varsResolver$k=createVarsResolver((e,{size:t})=>({description:{"--input-description-size":void 0===t?void 0:`calc(${getFontSize(t)} - ${rem(2)})`}})),InputDescription=factory((e,t)=>{const n=useProps("InputDescription",defaultProps$S,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,size:c,__staticSelector:u,__inheritStyles:d=!0,variant:p,...h}=useProps("InputDescription",defaultProps$S,n),f=useInputWrapperContext(),A=useStyles$u({name:["InputWrapper",u],props:n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"description",vars:l,varsResolver:varsResolver$k}),m=d&&(null==f?void 0:f.getStyles)||A;return factory$1(Box,{component:"p",ref:t,variant:p,size:c,...m("description",(null==f?void 0:f.getStyles)?{className:o,style:i}:void 0),...h})});InputDescription.classes=classes$k,InputDescription.displayName="@mantine/core/InputDescription";const defaultProps$R={},varsResolver$j=createVarsResolver((e,{size:t})=>({error:{"--input-error-size":void 0===t?void 0:`calc(${getFontSize(t)} - ${rem(2)})`}})),InputError=factory((e,t)=>{const n=useProps("InputError",defaultProps$R,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,size:c,__staticSelector:u,__inheritStyles:d=!0,variant:p,...h}=n,f=useStyles$u({name:["InputWrapper",u],props:n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"error",vars:l,varsResolver:varsResolver$j}),A=useInputWrapperContext(),m=d&&(null==A?void 0:A.getStyles)||f;return factory$1(Box,{component:"p",ref:t,variant:p,size:c,...m("error",(null==A?void 0:A.getStyles)?{className:o,style:i}:void 0),...h})});InputError.classes=classes$k,InputError.displayName="@mantine/core/InputError";const defaultProps$Q={labelElement:"label"},varsResolver$i=createVarsResolver((e,{size:t})=>({label:{"--input-label-size":getFontSize(t),"--input-asterisk-color":void 0}})),InputLabel=factory((e,t)=>{const n=useProps("InputLabel",defaultProps$Q,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,labelElement:c,size:u,required:d,htmlFor:p,onMouseDown:h,children:f,__staticSelector:A,variant:m,mod:g,...y}=useProps("InputLabel",defaultProps$Q,n),v=useStyles$u({name:["InputWrapper",A],props:n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"label",vars:l,varsResolver:varsResolver$i}),b=useInputWrapperContext(),x=(null==b?void 0:b.getStyles)||v;return factory$1(Box,{...x("label",(null==b?void 0:b.getStyles)?{className:o,style:i}:void 0),component:c,variant:m,size:u,ref:t,htmlFor:"label"===c?p:void 0,mod:[{required:d},g],onMouseDown:e=>{null==h||h(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()},...y,children:[f,d&&factory$1("span",{...x("required"),"aria-hidden":!0,children:" *"})]})});InputLabel.classes=classes$k,InputLabel.displayName="@mantine/core/InputLabel";const defaultProps$P={},InputPlaceholder=factory((e,t)=>{const n=useProps("InputPlaceholder",defaultProps$P,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,__staticSelector:c,variant:u,error:d,mod:p,...h}=useProps("InputPlaceholder",defaultProps$P,n),f=useStyles$u({name:["InputPlaceholder",c],props:n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"placeholder"});return factory$1(Box,{...f("placeholder"),mod:[{error:!!d},p],component:"span",variant:u,ref:t,...h})});function getInputOffsets(e,{hasDescription:t,hasError:n}){const r=e.findIndex(e=>"input"===e),o=e.slice(0,r),i=e.slice(r+1),a=t&&o.includes("description")||n&&o.includes("error");return{offsetBottom:t&&i.includes("description")||n&&i.includes("error"),offsetTop:a}}InputPlaceholder.classes=classes$k,InputPlaceholder.displayName="@mantine/core/InputPlaceholder";const defaultProps$O={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},varsResolver$h=createVarsResolver((e,{size:t})=>({label:{"--input-label-size":getFontSize(t),"--input-asterisk-color":void 0},error:{"--input-error-size":void 0===t?void 0:`calc(${getFontSize(t)} - ${rem(2)})`},description:{"--input-description-size":void 0===t?void 0:`calc(${getFontSize(t)} - ${rem(2)})`}})),InputWrapper=factory((e,t)=>{const n=useProps("InputWrapper",defaultProps$O,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,size:c,variant:u,__staticSelector:d,inputContainer:p,inputWrapperOrder:h,label:f,error:A,description:m,labelProps:g,descriptionProps:y,errorProps:v,labelElement:b,children:x,withAsterisk:w,id:C,required:$,__stylesApiProps:_,mod:S,...E}=n,k=useStyles$u({name:["InputWrapper",d],props:_||n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$h}),B={size:c,variant:u,__staticSelector:d},P=useId$1(C),T="boolean"==typeof w?w:$,I=(null==v?void 0:v.id)||`${P}-error`,L=(null==y?void 0:y.id)||`${P}-description`,M=P,D=!!A&&"boolean"!=typeof A,N=!!m,F=`${D?I:""} ${N?L:""}`,O=F.trim().length>0?F.trim():void 0,R=(null==g?void 0:g.id)||`${P}-label`,U=f&&factory$1(InputLabel,{labelElement:b,id:R,htmlFor:M,required:T,...B,...g,children:f}),j=N&&factory$1(InputDescription,{...y,...B,size:(null==y?void 0:y.size)||B.size,id:(null==y?void 0:y.id)||L,children:m}),H=factory$1(reactExports.Fragment,{children:p(x)}),Q=D&&reactExports.createElement(InputError,{...v,...B,size:(null==v?void 0:v.size)||B.size,key:"error",id:(null==v?void 0:v.id)||I},A),z=h.map(e=>{switch(e){case"label":return U;case"input":return H;case"description":return j;case"error":return Q;default:return null}});return factory$1(InputWrapperProvider,{value:{getStyles:k,describedBy:O,inputId:M,labelId:R,...getInputOffsets(h,{hasDescription:N,hasError:D})},children:factory$1(Box,{ref:t,variant:u,size:c,mod:[{error:!!A},S],...k("root"),...E,children:z})})});InputWrapper.classes=classes$k,InputWrapper.displayName="@mantine/core/InputWrapper";const defaultProps$N={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},varsResolver$g=createVarsResolver((e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":getSize(t.size,"input-height"),"--input-fz":getFontSize(t.size),"--input-radius":void 0===t.radius?void 0:getRadius(t.radius),"--input-left-section-width":void 0!==t.leftSectionWidth?rem(t.leftSectionWidth):void 0,"--input-right-section-width":void 0!==t.rightSectionWidth?rem(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?getSize(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}})),Input$5=polymorphicFactory((e,t)=>{const n=useProps("Input",defaultProps$N,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,required:l,__staticSelector:c,__stylesApiProps:u,size:d,wrapperProps:p,error:h,disabled:f,leftSection:A,leftSectionProps:m,leftSectionWidth:g,rightSection:y,rightSectionProps:v,rightSectionWidth:b,rightSectionPointerEvents:x,leftSectionPointerEvents:w,variant:C,vars:$,pointer:_,multiline:S,radius:E,id:k,withAria:B,withErrorStyles:P,mod:T,inputSize:I,...L}=n,{styleProps:M,rest:D}=extractStyleProps(L),N=useInputWrapperContext(),F={offsetBottom:null==N?void 0:N.offsetBottom,offsetTop:null==N?void 0:N.offsetTop},O=useStyles$u({name:["Input",c],props:u||n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,stylesCtx:F,rootSelector:"wrapper",vars:$,varsResolver:varsResolver$g}),R=B?{required:l,disabled:f,"aria-invalid":!!h,"aria-describedby":null==N?void 0:N.describedBy,id:(null==N?void 0:N.inputId)||k}:{};return factory$1(Box,{...O("wrapper"),...M,...p,mod:[{error:!!h&&P,pointer:_,disabled:f,multiline:S,"data-with-right-section":!!y,"data-with-left-section":!!A},T],variant:C,size:d,children:[A&&factory$1("div",{...m,"data-position":"left",...O("section",{className:null==m?void 0:m.className,style:null==m?void 0:m.style}),children:A}),factory$1(Box,{component:"input",...D,...R,ref:t,required:l,mod:{disabled:f,error:!!h&&P},variant:C,__size:I,...O("input")}),y&&factory$1("div",{...v,"data-position":"right",...O("section",{className:null==v?void 0:v.className,style:null==v?void 0:v.style}),children:y})]})});function useInputProps(e,t,n){const r=useProps(e,t,n),{label:o,description:i,error:a,required:s,classNames:l,styles:c,className:u,unstyled:d,__staticSelector:p,__stylesApiProps:h,errorProps:f,labelProps:A,descriptionProps:m,wrapperProps:g,id:y,size:v,style:b,inputContainer:x,inputWrapperOrder:w,withAsterisk:C,variant:$,vars:_,mod:S,...E}=r,{styleProps:k,rest:B}=extractStyleProps(E);return{...B,classNames:l,styles:c,unstyled:d,wrapperProps:{...{label:o,description:i,error:a,required:s,classNames:l,className:u,__staticSelector:p,__stylesApiProps:h||r,errorProps:f,labelProps:A,descriptionProps:m,unstyled:d,styles:c,size:v,style:b,inputContainer:x,inputWrapperOrder:w,withAsterisk:C,variant:$,id:y,mod:S,...g},...k},inputProps:{required:s,classNames:l,styles:c,unstyled:d,size:v,__staticSelector:p,__stylesApiProps:h||r,error:a,variant:$,id:y}}}Input$5.classes=classes$k,Input$5.Wrapper=InputWrapper,Input$5.Label=InputLabel,Input$5.Error=InputError,Input$5.Description=InputDescription,Input$5.Placeholder=InputPlaceholder,Input$5.displayName="@mantine/core/Input";const defaultProps$M={__staticSelector:"InputBase",withAria:!0},InputBase=polymorphicFactory((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=useInputProps("InputBase",defaultProps$M,e);return factory$1(Input$5.Wrapper,{...r,children:factory$1(Input$5,{...n,...o,ref:t})})});function AccordionChevron({style:e,size:t=16,...n}){return factory$1("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:rem(t),height:rem(t),display:"block"},...n,children:factory$1("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function parseItem(e){return"string"==typeof e?{value:e,label:e}:"value"in e&&!("label"in e)?{value:e.value,label:e.value,disabled:e.disabled}:"number"==typeof e?{value:e.toString(),label:e.toString()}:"group"in e?{group:e.group,items:e.items.map(e=>parseItem(e))}:e}function getParsedComboboxData(e){return e?e.map(e=>parseItem(e)):[]}function getOptionsLockup(e){return e.reduce((e,t)=>"group"in t?{...e,...getOptionsLockup(t.items)}:(e[t.value]=t,e),{})}InputBase.classes={...Input$5.classes,...Input$5.Wrapper.classes},InputBase.displayName="@mantine/core/InputBase",AccordionChevron.displayName="@mantine/core/AccordionChevron";var classes$j={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2"};const defaultProps$L={error:null},varsResolver$f=createVarsResolver((e,{size:t})=>({chevron:{"--combobox-chevron-size":getSize(t,"combobox-chevron-size")}})),ComboboxChevron=factory((e,t)=>{const n=useProps("ComboboxChevron",defaultProps$L,e),{size:r,error:o,style:i,className:a,classNames:s,styles:l,unstyled:c,vars:u,mod:d,...p}=n,h=useStyles$u({name:"ComboboxChevron",classes:classes$j,props:n,style:i,className:a,classNames:s,styles:l,unstyled:c,vars:u,varsResolver:varsResolver$f,rootSelector:"chevron"});return factory$1(Box,{component:"svg",...p,...h("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:o},d],ref:t,children:factory$1("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});ComboboxChevron.classes=classes$j,ComboboxChevron.displayName="@mantine/core/ComboboxChevron";const[ComboboxProvider,useComboboxContext]=createSafeContext("Combobox component was not found in tree"),ComboboxClearButton=reactExports.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},i)=>factory$1(CloseButton,{ref:i,size:e||"sm",variant:"transparent",tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:e=>{e.preventDefault(),null==t||t(e)},onClick:e=>{r(),null==n||n(e)}}));ComboboxClearButton.displayName="@mantine/core/ComboboxClearButton";const defaultProps$K={},ComboboxDropdown=factory((e,t)=>{const{classNames:n,styles:r,className:o,style:i,hidden:a,...s}=useProps("ComboboxDropdown",defaultProps$K,e),l=useComboboxContext();return factory$1(Popover.Dropdown,{...s,ref:t,role:"presentation","data-hidden":a||void 0,...l.getStyles("dropdown",{className:o,style:i,classNames:n,styles:r})})});ComboboxDropdown.classes=classes$j,ComboboxDropdown.displayName="@mantine/core/ComboboxDropdown";const defaultProps$J={refProp:"ref"},ComboboxDropdownTarget=factory((e,t)=>{const{children:n,refProp:r}=useProps("ComboboxDropdownTarget",defaultProps$J,e);if(useComboboxContext(),!isElement$2(n))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return factory$1(Popover.Target,{ref:t,refProp:r,children:n})});ComboboxDropdownTarget.displayName="@mantine/core/ComboboxDropdownTarget";const defaultProps$I={},ComboboxEmpty=factory((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...s}=useProps("ComboboxEmpty",defaultProps$I,e),l=useComboboxContext();return factory$1(Box,{ref:t,...l.getStyles("empty",{className:r,classNames:n,styles:i,style:o}),...s})});function useComboboxTargetProps({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:i}){const a=useComboboxContext(),[s,l]=reactExports.useState(null);return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!(!a.store.listId||!a.store.dropdownOpened)||void 0,"aria-controls":a.store.listId,"aria-activedescendant":a.store.dropdownOpened&&s||void 0,autoComplete:i,"data-expanded":a.store.dropdownOpened||void 0,"data-mantine-stop-propagation":a.store.dropdownOpened||void 0}:{},onKeyDown:n=>{if(null==e||e(n),!a.readOnly&&t){if(n.nativeEvent.isComposing)return;if("ArrowDown"===n.nativeEvent.code&&(n.preventDefault(),a.store.dropdownOpened?l(a.store.selectNextOption()):(a.store.openDropdown("keyboard"),l(a.store.selectActiveOption()))),"ArrowUp"===n.nativeEvent.code&&(n.preventDefault(),a.store.dropdownOpened?l(a.store.selectPreviousOption()):(a.store.openDropdown("keyboard"),l(a.store.selectActiveOption()))),"Enter"===n.nativeEvent.code||"NumpadEnter"===n.nativeEvent.code){if(229===n.nativeEvent.keyCode)return;const e=a.store.getSelectedOptionIndex();a.store.dropdownOpened&&-1!==e?(n.preventDefault(),a.store.clickSelectedOption()):"button"===o&&(n.preventDefault(),a.store.openDropdown("keyboard"))}"Escape"===n.nativeEvent.code&&a.store.closeDropdown("keyboard"),"Space"===n.nativeEvent.code&&"button"===o&&(n.preventDefault(),a.store.toggleDropdown("keyboard"))}}}}ComboboxEmpty.classes=classes$j,ComboboxEmpty.displayName="@mantine/core/ComboboxEmpty";const defaultProps$H={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},ComboboxEventsTarget=factory((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:a,targetType:s,autoComplete:l,...c}=useProps("ComboboxEventsTarget",defaultProps$H,e);if(!isElement$2(n))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=useComboboxContext(),d=useComboboxTargetProps({targetType:s,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:n.props.onKeyDown,autoComplete:l});return reactExports.cloneElement(n,{...d,...c,[r]:useMergedRef(t,u.store.targetRef,null==n?void 0:n.ref)})});ComboboxEventsTarget.displayName="@mantine/core/ComboboxEventsTarget";const defaultProps$G={},ComboboxFooter=factory((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...s}=useProps("ComboboxFooter",defaultProps$G,e),l=useComboboxContext();return factory$1(Box,{ref:t,...l.getStyles("footer",{className:r,classNames:n,style:o,styles:i}),...s,onMouseDown:e=>{e.preventDefault()}})});ComboboxFooter.classes=classes$j,ComboboxFooter.displayName="@mantine/core/ComboboxFooter";const defaultProps$F={},ComboboxGroup=factory((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,children:s,label:l,...c}=useProps("ComboboxGroup",defaultProps$F,e),u=useComboboxContext();return factory$1(Box,{ref:t,...u.getStyles("group",{className:r,classNames:n,style:o,styles:i}),...c,children:[l&&factory$1("div",{...u.getStyles("groupLabel",{classNames:n,styles:i}),children:l}),s]})});ComboboxGroup.classes=classes$j,ComboboxGroup.displayName="@mantine/core/ComboboxGroup";const defaultProps$E={},ComboboxHeader=factory((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...s}=useProps("ComboboxHeader",defaultProps$E,e),l=useComboboxContext();return factory$1(Box,{ref:t,...l.getStyles("header",{className:r,classNames:n,style:o,styles:i}),...s,onMouseDown:e=>{e.preventDefault()}})});function ComboboxHiddenInput({value:e,valuesDivider:t=",",...n}){return factory$1("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}ComboboxHeader.classes=classes$j,ComboboxHeader.displayName="@mantine/core/ComboboxHeader",ComboboxHiddenInput.displayName="@mantine/core/ComboboxHiddenInput";const defaultProps$D={},ComboboxOption=factory((e,t)=>{const n=useProps("ComboboxOption",defaultProps$D,e),{classNames:r,className:o,style:i,styles:a,vars:s,onClick:l,id:c,active:u,onMouseDown:d,onMouseOver:p,disabled:h,selected:f,mod:A,...m}=n,g=useComboboxContext(),y=reactExports.useId(),v=c||y;return factory$1(Box,{...g.getStyles("option",{className:o,classNames:r,styles:a,style:i}),...m,ref:t,id:v,mod:["combobox-option",{"combobox-active":u,"combobox-disabled":h,"combobox-selected":f},A],role:"option",onClick:e=>{var t;h?e.preventDefault():(null==(t=g.onOptionSubmit)||t.call(g,n.value,n),null==l||l(e))},onMouseDown:e=>{e.preventDefault(),null==d||d(e)},onMouseOver:e=>{g.resetSelectionOnOptionHover&&g.store.resetSelectedOption(),null==p||p(e)}})});ComboboxOption.classes=classes$j,ComboboxOption.displayName="@mantine/core/ComboboxOption";const defaultProps$C={},ComboboxOptions=factory((e,t)=>{const n=useProps("ComboboxOptions",defaultProps$C,e),{classNames:r,className:o,style:i,styles:a,id:s,onMouseDown:l,labelledBy:c,...u}=n,d=useComboboxContext(),p=useId$1(s);return reactExports.useEffect(()=>{d.store.setListId(p)},[p]),factory$1(Box,{ref:t,...d.getStyles("options",{className:o,style:i,classNames:r,styles:a}),...u,id:p,role:"listbox","aria-labelledby":c,onMouseDown:e=>{e.preventDefault(),null==l||l(e)}})});ComboboxOptions.classes=classes$j,ComboboxOptions.displayName="@mantine/core/ComboboxOptions";const defaultProps$B={withAriaAttributes:!0,withKeyboardNavigation:!0},ComboboxSearch=factory((e,t)=>{const n=useProps("ComboboxSearch",defaultProps$B,e),{classNames:r,styles:o,unstyled:i,vars:a,withAriaAttributes:s,onKeyDown:l,withKeyboardNavigation:c,size:u,...d}=n,p=useComboboxContext(),h=p.getStyles("search"),f=useComboboxTargetProps({targetType:"input",withAriaAttributes:s,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:l,autoComplete:"off"});return factory$1(Input$5,{ref:useMergedRef(t,p.store.searchRef),classNames:[{input:h.className},r],styles:[{input:h.style},o],size:u||p.size,...f,...d,__staticSelector:"Combobox"})});ComboboxSearch.classes=classes$j,ComboboxSearch.displayName="@mantine/core/ComboboxSearch";const defaultProps$A={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},ComboboxTarget=factory((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:a,targetType:s,autoComplete:l,...c}=useProps("ComboboxTarget",defaultProps$A,e);if(!isElement$2(n))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=useComboboxContext(),d=useComboboxTargetProps({targetType:s,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:n.props.onKeyDown,autoComplete:l}),p=reactExports.cloneElement(n,{...d,...c});return factory$1(Popover.Target,{ref:useMergedRef(t,u.store.targetRef),children:p})});function getPreviousIndex(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;if(n)for(let r=t.length-1;r>-1;r-=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;return e}function getNextIndex$1(e,t,n){for(let r=e+1;r<t.length;r+=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;if(n)for(let r=0;r<t.length;r+=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;return e}function getFirstIndex(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function useCombobox({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:i=!0,scrollBehavior:a="instant"}={}){const[s,l]=useUncontrolled({value:t,defaultValue:e,finalValue:!1,onChange:n}),c=reactExports.useRef(null),u=reactExports.useRef(-1),d=reactExports.useRef(null),p=reactExports.useRef(null),h=reactExports.useRef(-1),f=reactExports.useRef(-1),A=reactExports.useRef(-1),m=reactExports.useCallback((e="unknown")=>{s||(l(!0),null==o||o(e))},[l,o,s]),g=reactExports.useCallback((e="unknown")=>{s&&(l(!1),null==r||r(e))},[l,r,s]),y=reactExports.useCallback((e="unknown")=>{s?g(e):m(e)},[g,m,s]),v=reactExports.useCallback(()=>{const e=document.querySelector(`#${c.current} [data-combobox-selected]`);null==e||e.removeAttribute("data-combobox-selected"),null==e||e.removeAttribute("aria-selected")},[]),b=reactExports.useCallback(e=>{const t=document.getElementById(c.current),n=null==t?void 0:t.querySelectorAll("[data-combobox-option]");if(!n)return null;const r=e>=n.length?0:e<0?n.length-1:e;return u.current=r,(null==n?void 0:n[r])&&!n[r].hasAttribute("data-combobox-disabled")?(v(),n[r].setAttribute("data-combobox-selected","true"),n[r].setAttribute("aria-selected","true"),n[r].scrollIntoView({block:"nearest",behavior:a}),n[r].id):null},[a,v]),x=reactExports.useCallback(()=>{const e=document.querySelector(`#${c.current} [data-combobox-active]`);if(e){const t=document.querySelectorAll(`#${c.current} [data-combobox-option]`),n=Array.from(t).findIndex(t=>t===e);return b(n)}return b(0)},[b]),w=reactExports.useCallback(()=>b(getNextIndex$1(u.current,document.querySelectorAll(`#${c.current} [data-combobox-option]`),i)),[b,i]),C=reactExports.useCallback(()=>b(getPreviousIndex(u.current,document.querySelectorAll(`#${c.current} [data-combobox-option]`),i)),[b,i]),$=reactExports.useCallback(()=>b(getFirstIndex(document.querySelectorAll(`#${c.current} [data-combobox-option]`))),[b]),_=reactExports.useCallback((e="selected",t)=>{A.current=window.setTimeout(()=>{var n;const r=document.querySelectorAll(`#${c.current} [data-combobox-option]`),o=Array.from(r).findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=o,(null==t?void 0:t.scrollIntoView)&&(null==(n=r[o])||n.scrollIntoView({block:"nearest",behavior:a}))},0)},[]),S=reactExports.useCallback(()=>{u.current=-1,v()},[v]),E=reactExports.useCallback(()=>{const e=document.querySelectorAll(`#${c.current} [data-combobox-option]`),t=null==e?void 0:e[u.current];null==t||t.click()},[]),k=reactExports.useCallback(e=>{c.current=e},[]),B=reactExports.useCallback(()=>{h.current=window.setTimeout(()=>d.current.focus(),0)},[]),P=reactExports.useCallback(()=>{f.current=window.setTimeout(()=>p.current.focus(),0)},[]),T=reactExports.useCallback(()=>u.current,[]);return reactExports.useEffect(()=>()=>{window.clearTimeout(h.current),window.clearTimeout(f.current),window.clearTimeout(A.current)},[]),{dropdownOpened:s,openDropdown:m,closeDropdown:g,toggleDropdown:y,selectedOptionIndex:u.current,getSelectedOptionIndex:T,selectOption:b,selectFirstOption:$,selectActiveOption:x,selectNextOption:w,selectPreviousOption:C,resetSelectedOption:S,updateSelectedOptionIndex:_,listId:c.current,setListId:k,clickSelectedOption:E,searchRef:d,focusSearchInput:B,targetRef:p,focusTarget:P}}ComboboxTarget.displayName="@mantine/core/ComboboxTarget";const defaultProps$z={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},varsResolver$e=createVarsResolver((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":getFontSize(t),"--combobox-option-padding":getSize(t,"combobox-option-padding")},dropdown:{"--combobox-padding":void 0===n?void 0:rem(n),"--combobox-option-fz":getFontSize(t),"--combobox-option-padding":getSize(t,"combobox-option-padding")}}));function Combobox(e){const t=useProps("Combobox",defaultProps$z,e),{classNames:n,styles:r,unstyled:o,children:i,store:a,vars:s,onOptionSubmit:l,onClose:c,size:u,dropdownPadding:d,resetSelectionOnOptionHover:p,__staticSelector:h,readOnly:f,...A}=t,m=useCombobox(),g=a||m,y=useStyles$u({name:h||"Combobox",classes:classes$j,props:t,classNames:n,styles:r,unstyled:o,vars:s,varsResolver:varsResolver$e});return factory$1(ComboboxProvider,{value:{getStyles:y,store:g,onOptionSubmit:l,size:u,resetSelectionOnOptionHover:p,readOnly:f},children:factory$1(Popover,{opened:g.dropdownOpened,...A,onClose:()=>{null==c||c(),g.closeDropdown()},withRoles:!1,unstyled:o,children:i})})}const extendCombobox=e=>e;Combobox.extend=extendCombobox,Combobox.classes=classes$j,Combobox.displayName="@mantine/core/Combobox",Combobox.Target=ComboboxTarget,Combobox.Dropdown=ComboboxDropdown,Combobox.Options=ComboboxOptions,Combobox.Option=ComboboxOption,Combobox.Search=ComboboxSearch,Combobox.Empty=ComboboxEmpty,Combobox.Chevron=ComboboxChevron,Combobox.Footer=ComboboxFooter,Combobox.Header=ComboboxHeader,Combobox.EventsTarget=ComboboxEventsTarget,Combobox.DropdownTarget=ComboboxDropdownTarget,Combobox.Group=ComboboxGroup,Combobox.ClearButton=ComboboxClearButton,Combobox.HiddenInput=ComboboxHiddenInput;var classes$i={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const InlineInputClasses=classes$i,InlineInput=reactExports.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:i,children:a,label:s,description:l,id:c,disabled:u,error:d,size:p,labelPosition:h="left",bodyElement:f="div",labelElement:A="label",variant:m,style:g,vars:y,mod:v,...b},x)=>{const w=useStyles$u({name:e,props:t,className:n,style:g,classes:classes$i,classNames:r,styles:o,unstyled:i});return factory$1(Box,{...w("root"),ref:x,__vars:{"--label-fz":getFontSize(p),"--label-lh":getSize(p,"label-lh")},mod:[{"label-position":h},v],variant:m,size:p,...b,children:factory$1(Box,{component:f,htmlFor:"label"===f?c:void 0,...w("body"),children:[a,factory$1("div",{...w("labelWrapper"),"data-disabled":u||void 0,children:[s&&factory$1(Box,{component:A,htmlFor:"label"===A?c:void 0,...w("label"),"data-disabled":u||void 0,children:s}),l&&factory$1(Input$5.Description,{size:p,__inheritStyles:!1,...w("description"),children:l}),d&&"boolean"!=typeof d&&factory$1(Input$5.Error,{size:p,__inheritStyles:!1,...w("error"),children:d})]})]})})});InlineInput.displayName="@mantine/core/InlineInput";const CheckboxGroupContext=reactExports.createContext(null),CheckboxGroupProvider=CheckboxGroupContext.Provider,useCheckboxGroupContext=()=>reactExports.useContext(CheckboxGroupContext),[CheckboxCardProvider,useCheckboxCardContext]=createOptionalContext();var classes$h={card:"m_26775b0a"};const defaultProps$y={withBorder:!0},varsResolver$d=createVarsResolver((e,{radius:t})=>({card:{"--card-radius":getRadius(t)}})),CheckboxCard=factory((e,t)=>{const n=useProps("CheckboxCard",defaultProps$y,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,checked:c,mod:u,withBorder:d,value:p,onClick:h,...f}=n,A=useStyles$u({name:"CheckboxCard",classes:classes$h,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$d,rootSelector:"card"}),m=useCheckboxGroupContext(),g="boolean"==typeof c?c:(null==m?void 0:m.value.includes(p||""))||!1;return factory$1(CheckboxCardProvider,{value:{checked:g},children:factory$1(UnstyledButton,{ref:t,mod:[{"with-border":d,checked:g},u],...A("card"),...f,role:"checkbox","aria-checked":g,onClick:e=>{null==h||h(e),null==m||m.onChange(p||"")}})})});function InputsGroupFieldset({children:e,role:t}){const n=useInputWrapperContext();return n?factory$1("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):factory$1(Fragment,{children:e})}CheckboxCard.displayName="@mantine/core/CheckboxCard",CheckboxCard.classes=classes$h;const defaultProps$x={},CheckboxGroup=factory((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:s,readOnly:l,...c}=useProps("CheckboxGroup",defaultProps$x,e),[u,d]=useUncontrolled({value:n,defaultValue:r,finalValue:[],onChange:o});return factory$1(CheckboxGroupProvider,{value:{value:u,onChange:e=>{const t="string"==typeof e?e:e.currentTarget.value;!l&&d(u.includes(t)?u.filter(e=>e!==t):[...u,t])},size:i},children:factory$1(Input$5.Wrapper,{size:i,ref:t,...a,...c,labelElement:"div",__staticSelector:"CheckboxGroup",children:factory$1(InputsGroupFieldset,{role:"group",children:s})})})});function CheckIcon({size:e,style:t,...n}){const r=void 0!==e?{width:rem(e),height:rem(e),...t}:t;return factory$1("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:factory$1("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function CheckboxIcon({indeterminate:e,...t}){return e?factory$1("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:factory$1("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):factory$1(CheckIcon,{...t})}CheckboxGroup.classes=Input$5.Wrapper.classes,CheckboxGroup.displayName="@mantine/core/CheckboxGroup";var classes$g={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const defaultProps$w={icon:CheckboxIcon},varsResolver$c=createVarsResolver((e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const s=parseThemeColor({color:n||e.primaryColor,theme:e}),l=s.isThemeColor&&void 0===s.shade?`var(--mantine-color-${s.color}-outline)`:s.color;return{indicator:{"--checkbox-size":getSize(r,"checkbox-size"),"--checkbox-radius":void 0===t?void 0:getRadius(t),"--checkbox-color":"outline"===i?l:getThemeColor(n,e),"--checkbox-icon-color":o?getThemeColor(o,e):getAutoContrastValue(a,e)?getContrastColor({color:n,theme:e,autoContrast:a}):void 0}}}),CheckboxIndicator=factory((e,t)=>{const n=useProps("CheckboxIndicator",defaultProps$w,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,icon:c,indeterminate:u,radius:d,color:p,iconColor:h,autoContrast:f,checked:A,mod:m,variant:g,disabled:y,...v}=n,b=c,x=useStyles$u({name:"CheckboxIndicator",classes:classes$g,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$c,rootSelector:"indicator"}),w=useCheckboxCardContext(),C="boolean"==typeof A||"boolean"==typeof u?A||u:(null==w?void 0:w.checked)||!1;return factory$1(Box,{ref:t,...x("indicator",{variant:g}),variant:g,mod:[{checked:C,disabled:y},m],...v,children:factory$1(b,{indeterminate:u,...x("icon")})})});CheckboxIndicator.displayName="@mantine/core/CheckboxIndicator",CheckboxIndicator.classes=classes$g;var classes$f={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const defaultProps$v={labelPosition:"right",icon:CheckboxIcon},varsResolver$b=createVarsResolver((e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const s=parseThemeColor({color:n||e.primaryColor,theme:e}),l=s.isThemeColor&&void 0===s.shade?`var(--mantine-color-${s.color}-outline)`:s.color;return{root:{"--checkbox-size":getSize(r,"checkbox-size"),"--checkbox-radius":void 0===t?void 0:getRadius(t),"--checkbox-color":"outline"===i?l:getThemeColor(n,e),"--checkbox-icon-color":o?getThemeColor(o,e):getAutoContrastValue(a,e)?getContrastColor({color:n,theme:e,autoContrast:a}):void 0}}}),Checkbox=factory((e,t)=>{const n=useProps("Checkbox",defaultProps$v,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,color:c,label:u,id:d,size:p,radius:h,wrapperProps:f,checked:A,labelPosition:m,description:g,error:y,disabled:v,variant:b,indeterminate:x,icon:w,rootRef:C,iconColor:$,onChange:_,autoContrast:S,mod:E,...k}=n,B=useCheckboxGroupContext(),P=p||(null==B?void 0:B.size),T=w,I=useStyles$u({name:"Checkbox",props:n,classes:classes$f,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$b}),{styleProps:L,rest:M}=extractStyleProps(k),D=useId$1(d),N=B?{checked:B.value.includes(M.value),onChange:e=>{B.onChange(e),null==_||_(e)}}:{};return factory$1(InlineInput,{...I("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:D,size:P,labelPosition:m,label:u,description:g,error:y,disabled:v,classNames:r,styles:a,unstyled:s,"data-checked":N.checked||A||void 0,variant:b,ref:C,mod:E,...L,...f,children:factory$1(Box,{...I("inner"),mod:{"data-label-position":m},children:[factory$1(Box,{component:"input",id:D,ref:t,checked:A,disabled:v,mod:{error:!!y,indeterminate:x},...I("input",{focusable:!0,variant:b}),onChange:_,...M,...N,type:"checkbox"}),factory$1(T,{indeterminate:x,...I("icon")})]})})});function isOptionsGroup(e){return"group"in e}function defaultOptionsFilter({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let i=0;i<e.length;i+=1){const a=e[i];if(o.length===n)return o;isOptionsGroup(a)&&o.push({group:a.group,items:defaultOptionsFilter({options:a.items,search:t,limit:n-o.length})}),isOptionsGroup(a)||a.label.toLowerCase().includes(r)&&o.push(a)}return o}function isEmptyComboboxData(e){if(0===e.length)return!0;for(const t of e){if(!("group"in t))return!1;if(t.items.length>0)return!1}return!0}function validateOptions(e,t=new Set){if(Array.isArray(e))for(const n of e)if(isOptionsGroup(n))validateOptions(n.items,t);else{if(void 0===n.value)throw new Error("[@mantine/core] Each option must have value property");if("string"!=typeof n.value)throw new Error("[@mantine/core] Option value must be a string, other data formats are not supported, got "+typeof n.value);if(t.has(n.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function isValueChecked(e,t){return Array.isArray(e)?e.includes(t):e===t}function Option({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:i}){if(!isOptionsGroup(e)){const a=isValueChecked(n,e.value),s=t&&a&&factory$1(CheckIcon,{className:classes$j.optionsDropdownCheckIcon}),l=factory$1(Fragment,{children:["left"===r&&s,factory$1("span",{children:e.label}),"right"===r&&s]});return factory$1(Combobox.Option,{value:e.value,disabled:e.disabled,className:clsx$2({[classes$j.optionsDropdownOption]:!o}),"data-reverse":"right"===r||void 0,"data-checked":a||void 0,"aria-selected":a,active:a,children:"function"==typeof i?i({option:e,checked:a}):l})}const a=e.items.map(e=>factory$1(Option,{data:e,value:n,unstyled:o,withCheckIcon:t,checkIconPosition:r,renderOption:i},e.value));return factory$1(Combobox.Group,{label:e.group,children:a})}function OptionsDropdown({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:i,maxDropdownHeight:a,withScrollArea:s=!0,filterOptions:l=!0,withCheckIcon:c=!1,value:u,checkIconPosition:d,nothingFoundMessage:p,unstyled:h,labelId:f,renderOption:A,scrollAreaProps:m,"aria-label":g}){validateOptions(e);const y="string"==typeof o?(r||defaultOptionsFilter)({options:e,search:l?o:"",limit:i??1/0}):e,v=isEmptyComboboxData(y),b=y.map(e=>factory$1(Option,{data:e,withCheckIcon:c,value:u,checkIconPosition:d,unstyled:h,renderOption:A},isOptionsGroup(e)?e.group:e.value));return factory$1(Combobox.Dropdown,{hidden:t||n&&v,children:factory$1(Combobox.Options,{labelledBy:f,"aria-label":g,children:[s?factory$1(ScrollArea.Autosize,{mah:a??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...m,children:b}):b,v&&p&&factory$1(Combobox.Empty,{children:p})]})})}Checkbox.classes={...classes$f,...InlineInputClasses},Checkbox.displayName="@mantine/core/Checkbox",Checkbox.Group=CheckboxGroup,Checkbox.Indicator=CheckboxIndicator,Checkbox.Card=CheckboxCard;var index$1=reactExports.useLayoutEffect,useLatest=function(e){var t=React.useRef(e);return index$1(function(){t.current=e}),t},updateRef=function(e,t){"function"!=typeof e?e.current=t:e(t)},useComposedRef=function(e,t){var n=React.useRef();return React.useCallback(function(r){e.current=r,n.current&&updateRef(n.current,null),n.current=t,t&&updateRef(t,r)},[t])},HIDDEN_TEXTAREA_STYLE={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},forceHiddenStyles=function(e){Object.keys(HIDDEN_TEXTAREA_STYLE).forEach(function(t){e.style.setProperty(t,HIDDEN_TEXTAREA_STYLE[t],"important")})},forceHiddenStyles$1=forceHiddenStyles,hiddenTextarea=null,getHeight=function(e,t){var n=e.scrollHeight;return"border-box"===t.sizingStyle.boxSizing?n+t.borderSize:n-t.paddingSize};function calculateNodeHeight(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=1/0),hiddenTextarea||((hiddenTextarea=document.createElement("textarea")).setAttribute("tabindex","-1"),hiddenTextarea.setAttribute("aria-hidden","true"),forceHiddenStyles$1(hiddenTextarea)),null===hiddenTextarea.parentNode&&document.body.appendChild(hiddenTextarea);var o=e.paddingSize,i=e.borderSize,a=e.sizingStyle,s=a.boxSizing;Object.keys(a).forEach(function(e){var t=e;hiddenTextarea.style[t]=a[t]}),forceHiddenStyles$1(hiddenTextarea),hiddenTextarea.value=t;var l=getHeight(hiddenTextarea,e);hiddenTextarea.value=t,l=getHeight(hiddenTextarea,e),hiddenTextarea.value="x";var c=hiddenTextarea.scrollHeight-o,u=c*n;"border-box"===s&&(u=u+o+i),l=Math.max(u,l);var d=c*r;return"border-box"===s&&(d=d+o+i),[l=Math.min(d,l),c]}var noop$1=function(){},pick=function(e,t){return e.reduce(function(e,n){return e[n]=t[n],e},{})},SIZING_STYLE=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],isIE=!!document.documentElement.currentStyle,getSizingData=function(e){var t=window.getComputedStyle(e);if(null===t)return null;var n=pick(SIZING_STYLE,t),r=n.boxSizing;return""===r?null:(isIE&&"border-box"===r&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px"),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})},getSizingData$1=getSizingData;function useListener(e,t,n){var r=useLatest(n);reactExports.useLayoutEffect(function(){var n=function(e){return r.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}},[])}var useWindowResizeListener=function(e){useListener(window,"resize",e)},useFontsLoadedListener=function(e){useListener(document.fonts,"loadingdone",e)},_excluded$1=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],TextareaAutosize=function(e,t){var n=e.cacheMeasurements,r=e.maxRows,o=e.minRows,i=e.onChange,a=void 0===i?noop$1:i,s=e.onHeightChange,l=void 0===s?noop$1:s,c=_objectWithoutPropertiesLoose(e,_excluded$1),u=void 0!==c.value,d=reactExports.useRef(null),p=useComposedRef(d,t),h=reactExports.useRef(0),f=reactExports.useRef(),A=function(){var e=d.current,t=n&&f.current?f.current:getSizingData$1(e);if(t){f.current=t;var i=calculateNodeHeight(t,e.value||e.placeholder||"x",o,r),a=i[0],s=i[1];h.current!==a&&(h.current=a,e.style.setProperty("height",a+"px","important"),l(a,{rowHeight:s}))}};return reactExports.useLayoutEffect(A),useWindowResizeListener(A),useFontsLoadedListener(A),reactExports.createElement("textarea",_extends({},c,{onChange:function(e){u||A(),a(e)},ref:p}))},index=reactExports.forwardRef(TextareaAutosize);const defaultProps$u={},Textarea=factory((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:i,resize:a,...s}=useProps("Textarea",defaultProps$u,e),l=n&&"test"!==getEnv();return factory$1(InputBase,{component:l?index:"textarea",ref:t,...s,__staticSelector:i||"Textarea",multiline:!0,"data-no-overflow":n&&void 0===r||void 0,__vars:{"--input-resize":a},...l?{maxRows:r,minRows:o}:{}})});Textarea.classes=InputBase.classes,Textarea.displayName="@mantine/core/Textarea";const[PillsInputProvider,usePillsInputContext]=createOptionalContext(),[PillGroupProvider,usePillGroupContext]=createOptionalContext();var classes$e={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const defaultProps$t={},varsResolver$a=createVarsResolver((e,{gap:t},{size:n})=>({group:{"--pg-gap":void 0!==t?getSize(t):getSize(n,"pg-gap")}})),PillGroup=factory((e,t)=>{const n=useProps("PillGroup",defaultProps$t,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,size:c,disabled:u,...d}=n,p=usePillsInputContext(),h=(null==p?void 0:p.size)||c||void 0,f=useStyles$u({name:"PillGroup",classes:classes$e,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$a,stylesCtx:{size:h},rootSelector:"group"});return factory$1(PillGroupProvider,{value:{size:h,disabled:u},children:factory$1(Box,{ref:t,size:h,...f("group"),...d})})});PillGroup.classes=classes$e,PillGroup.displayName="@mantine/core/PillGroup";const defaultProps$s={variant:"default"},varsResolver$9=createVarsResolver((e,{radius:t},{size:n})=>({root:{"--pill-fz":getSize(n,"pill-fz"),"--pill-height":getSize(n,"pill-height"),"--pill-radius":void 0===t?void 0:getRadius(t)}})),Pill=factory((e,t)=>{const n=useProps("Pill",defaultProps$s,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,variant:c,children:u,withRemoveButton:d,onRemove:p,removeButtonProps:h,radius:f,size:A,disabled:m,mod:g,...y}=n,v=usePillGroupContext(),b=usePillsInputContext(),x=A||(null==v?void 0:v.size)||void 0,w="filled"===(null==b?void 0:b.variant)?"contrast":c||"default",C=useStyles$u({name:"Pill",classes:classes$e,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$9,stylesCtx:{size:x}});return factory$1(Box,{component:"span",ref:t,variant:w,size:x,...C("root",{variant:w}),mod:[{"with-remove":d&&!m,disabled:m||(null==v?void 0:v.disabled)},g],...y,children:[factory$1("span",{...C("label"),children:u}),d&&factory$1(CloseButton,{variant:"transparent",radius:f,tabIndex:-1,"aria-hidden":!0,unstyled:s,...h,...C("remove",{className:null==h?void 0:h.className,style:null==h?void 0:h.style}),onMouseDown:e=>{var t;e.preventDefault(),e.stopPropagation(),null==(t=null==h?void 0:h.onMouseDown)||t.call(h,e)},onClick:e=>{var t;e.stopPropagation(),null==p||p(),null==(t=null==h?void 0:h.onClick)||t.call(h,e)}})]})});Pill.classes=classes$e,Pill.displayName="@mantine/core/Pill",Pill.Group=PillGroup;var classes$d={field:"m_45c4369d"};const defaultProps$r={type:"visible"},PillsInputField=factory((e,t)=>{const n=useProps("PillsInputField",defaultProps$r,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,type:c,disabled:u,id:d,pointer:p,mod:h,...f}=n,A=usePillsInputContext(),m=useInputWrapperContext(),g=useStyles$u({name:"PillsInputField",classes:classes$d,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"field"}),y=u||(null==A?void 0:A.disabled);return factory$1(Box,{component:"input",ref:useMergedRef(t,null==A?void 0:A.fieldRef),"data-type":c,disabled:y,mod:[{disabled:y,pointer:p},h],...g("field"),...f,id:(null==m?void 0:m.inputId)||d,"aria-invalid":null==A?void 0:A.hasError,"aria-describedby":null==m?void 0:m.describedBy,type:"text",onMouseDown:e=>!p&&e.stopPropagation()})});PillsInputField.classes=classes$d,PillsInputField.displayName="@mantine/core/PillsInputField";const defaultProps$q={},PillsInput=factory((e,t)=>{const n=useProps("PillsInput",defaultProps$q,e),{children:r,onMouseDown:o,onClick:i,size:a,disabled:s,__staticSelector:l,error:c,variant:u,...d}=n,p=reactExports.useRef();return factory$1(PillsInputProvider,{value:{fieldRef:p,size:a,disabled:s,hasError:!!c,variant:u},children:factory$1(InputBase,{size:a,error:c,variant:u,component:"div",ref:t,onMouseDown:e=>{var t;e.preventDefault(),null==o||o(e),null==(t=p.current)||t.focus()},onClick:e=>{var t;e.preventDefault(),null==i||i(e),null==(t=p.current)||t.focus()},...d,multiline:!0,disabled:s,__staticSelector:l||"PillsInput",withAria:!1,children:r})})});function filterPickedValues({data:e,value:t}){const n=t.map(e=>e.trim().toLowerCase());return e.reduce((e,t)=>(isOptionsGroup(t)?e.push({group:t.group,items:t.items.filter(e=>-1===n.indexOf(e.value.toLowerCase().trim()))}):-1===n.indexOf(t.value.toLowerCase().trim())&&e.push(t),e),[])}PillsInput.displayName="@mantine/core/PillsInput",PillsInput.Field=PillsInputField;const defaultProps$p={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},MultiSelect=factory((e,t)=>{const n=useProps("MultiSelect",defaultProps$p,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,size:c,value:u,defaultValue:d,onChange:p,onKeyDown:h,variant:f,data:A,dropdownOpened:m,defaultDropdownOpened:g,onDropdownOpen:y,onDropdownClose:v,selectFirstOptionOnChange:b,onOptionSubmit:x,comboboxProps:w,filter:C,limit:$,withScrollArea:_,maxDropdownHeight:S,searchValue:E,defaultSearchValue:k,onSearchChange:B,readOnly:P,disabled:T,onFocus:I,onBlur:L,onPaste:M,radius:D,rightSection:N,rightSectionWidth:F,rightSectionPointerEvents:O,rightSectionProps:R,leftSection:U,leftSectionWidth:j,leftSectionPointerEvents:H,leftSectionProps:Q,inputContainer:z,inputWrapperOrder:V,withAsterisk:W,labelProps:Y,descriptionProps:G,errorProps:K,wrapperProps:q,description:J,label:Z,error:X,maxValues:ee,searchable:te,nothingFoundMessage:ne,withCheckIcon:re,checkIconPosition:oe,hidePickedOptions:ie,withErrorStyles:ae,name:se,form:le,id:ce,clearable:ue,clearButtonProps:de,hiddenInputProps:pe,placeholder:he,hiddenInputValuesDivider:fe,required:Ae,mod:me,renderOption:ge,onRemove:ye,onClear:ve,scrollAreaProps:be,...xe}=n,we=useId$1(ce),Ce=getParsedComboboxData(A),$e=getOptionsLockup(Ce),_e=useCombobox({opened:m,defaultOpened:g,onDropdownOpen:y,onDropdownClose:()=>{null==v||v(),_e.resetSelectedOption()}}),{styleProps:Se,rest:{type:Ee,autoComplete:ke,...Be}}=extractStyleProps(xe),[Pe,Te]=useUncontrolled({value:u,defaultValue:d,finalValue:[],onChange:p}),[Ie,Le]=useUncontrolled({value:E,defaultValue:k,finalValue:"",onChange:B}),Me=useStyles$u({name:"MultiSelect",classes:{},props:n,classNames:r,styles:a,unstyled:s}),{resolvedClassNames:De,resolvedStyles:Ne}=useResolvedStylesApi({props:n,styles:a,classNames:r}),Fe=Pe.map((e,t)=>{var n,r;return factory$1(Pill,{withRemoveButton:!P&&!(null==(n=$e[e])?void 0:n.disabled),onRemove:()=>{Te(Pe.filter(t=>e!==t)),null==ye||ye(e)},unstyled:s,disabled:T,...Me("pill"),children:(null==(r=$e[e])?void 0:r.label)||e})});reactExports.useEffect(()=>{b&&_e.selectFirstOption()},[b,Pe]);const Oe=ue&&Pe.length>0&&!T&&!P&&factory$1(Combobox.ClearButton,{size:c,...de,onClear:()=>{null==ve||ve(),Te([]),Le("")}}),Re=filterPickedValues({data:Ce,value:Pe});return factory$1(Fragment,{children:[factory$1(Combobox,{store:_e,classNames:De,styles:Ne,unstyled:s,size:c,readOnly:P,__staticSelector:"MultiSelect",onOptionSubmit:e=>{null==x||x(e),Le(""),_e.updateSelectedOptionIndex("selected"),Pe.includes($e[e].value)?(Te(Pe.filter(t=>t!==$e[e].value)),null==ye||ye($e[e].value)):Pe.length<ee&&Te([...Pe,$e[e].value])},...w,children:[factory$1(Combobox.DropdownTarget,{children:factory$1(PillsInput,{...Se,__staticSelector:"MultiSelect",classNames:De,styles:Ne,unstyled:s,size:c,className:o,style:i,variant:f,disabled:T,radius:D,rightSection:N||Oe||factory$1(Combobox.Chevron,{size:c,error:X,unstyled:s}),rightSectionPointerEvents:O||(Oe?"all":"none"),rightSectionWidth:F,rightSectionProps:R,leftSection:U,leftSectionWidth:j,leftSectionPointerEvents:H,leftSectionProps:Q,inputContainer:z,inputWrapperOrder:V,withAsterisk:W,labelProps:Y,descriptionProps:G,errorProps:K,wrapperProps:q,description:J,label:Z,error:X,multiline:!0,withErrorStyles:ae,__stylesApiProps:{...n,rightSectionPointerEvents:O||(Oe?"all":"none"),multiline:!0},pointer:!te,onClick:()=>te?_e.openDropdown():_e.toggleDropdown(),"data-expanded":_e.dropdownOpened||void 0,id:we,required:Ae,mod:me,children:factory$1(Pill.Group,{disabled:T,unstyled:s,...Me("pillsList"),children:[Fe,factory$1(Combobox.EventsTarget,{autoComplete:ke,children:factory$1(PillsInput.Field,{...Be,ref:t,id:we,placeholder:he,type:te||he?"visible":"hidden",...Me("inputField"),unstyled:s,onFocus:e=>{null==I||I(e),te&&_e.openDropdown()},onBlur:e=>{null==L||L(e),_e.closeDropdown(),Le("")},onKeyDown:e=>{null==h||h(e)," "!==e.key||te||(e.preventDefault(),_e.toggleDropdown()),"Backspace"===e.key&&0===Ie.length&&Pe.length>0&&(null==ye||ye(Pe[Pe.length-1]),Te(Pe.slice(0,Pe.length-1)))},value:Ie,onChange:e=>{Le(e.currentTarget.value),te&&_e.openDropdown(),b&&_e.selectFirstOption()},disabled:T,readOnly:P||!te,pointer:!te})})]})})}),factory$1(OptionsDropdown,{data:ie?Re:Ce,hidden:P||T,filter:C,search:Ie,limit:$,hiddenWhenEmpty:!ne,withScrollArea:_,maxDropdownHeight:S,filterOptions:te,value:Pe,checkIconPosition:oe,withCheckIcon:re,nothingFoundMessage:ne,unstyled:s,labelId:Z?`${we}-label`:void 0,"aria-label":Z?void 0:xe["aria-label"],renderOption:ge,scrollAreaProps:be})]}),factory$1(Combobox.HiddenInput,{name:se,valuesDivider:fe,value:Pe,form:le,disabled:T,...pe})]})});MultiSelect.classes={...InputBase.classes,...Combobox.classes},MultiSelect.displayName="@mantine/core/MultiSelect";const[RadioGroupProvider,useRadioGroupContext]=createOptionalContext(),[RadioCardProvider,useRadioCardContext]=createOptionalContext();var classes$c={card:"m_9dc8ae12"};const defaultProps$o={withBorder:!0},varsResolver$8=createVarsResolver((e,{radius:t})=>({card:{"--card-radius":getRadius(t)}})),RadioCard=factory((e,t)=>{const n=useProps("RadioCard",defaultProps$o,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,checked:c,mod:u,withBorder:d,value:p,onClick:h,name:f,onKeyDown:A,...m}=n,g=useStyles$u({name:"RadioCard",classes:classes$c,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$8,rootSelector:"card"}),{dir:y}=useDirection(),v=useRadioGroupContext(),b="boolean"==typeof c?c:(null==v?void 0:v.value)===p||!1,x=f||(null==v?void 0:v.name);return factory$1(RadioCardProvider,{value:{checked:b},children:factory$1(UnstyledButton,{ref:t,mod:[{"with-border":d,checked:b},u],...g("card"),...m,role:"radio","aria-checked":b,name:x,onClick:e=>{null==h||h(e),null==v||v.onChange(p||"")},onKeyDown:e=>{if(null==A||A(e),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(e.nativeEvent.code)){e.preventDefault();const t=Array.from(document.querySelectorAll(`[role="radio"][name="${x||"__mantine"}"]`)),n=t.findIndex(t=>t===e.target),r=n+1>=t.length?0:n+1,o=n-1<0?t.length-1:n-1;"ArrowDown"===e.nativeEvent.code&&(t[r].focus(),t[r].click()),"ArrowUp"===e.nativeEvent.code&&(t[o].focus(),t[o].click()),"ArrowLeft"===e.nativeEvent.code&&(t["ltr"===y?o:r].focus(),t["ltr"===y?o:r].click()),"ArrowRight"===e.nativeEvent.code&&(t["ltr"===y?r:o].focus(),t["ltr"===y?r:o].click())}}})})});RadioCard.displayName="@mantine/core/RadioCard",RadioCard.classes=classes$c;const defaultProps$n={},RadioGroup=factory((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:s,name:l,readOnly:c,...u}=useProps("RadioGroup",defaultProps$n,e),d=useId$1(l),[p,h]=useUncontrolled({value:n,defaultValue:r,finalValue:"",onChange:o});return factory$1(RadioGroupProvider,{value:{value:p,onChange:e=>!c&&h("string"==typeof e?e:e.currentTarget.value),size:i,name:d},children:factory$1(Input$5.Wrapper,{size:i,ref:t,...a,...u,labelElement:"div",__staticSelector:"RadioGroup",children:factory$1(InputsGroupFieldset,{role:"radiogroup",children:s})})})});function RadioIcon({size:e,style:t,...n}){return factory$1("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:rem(e),height:rem(e),...t},"aria-hidden":!0,...n,children:factory$1("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}RadioGroup.classes=Input$5.Wrapper.classes,RadioGroup.displayName="@mantine/core/RadioGroup";var classes$b={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const defaultProps$m={icon:RadioIcon},varsResolver$7=createVarsResolver((e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const s=parseThemeColor({color:n||e.primaryColor,theme:e}),l=s.isThemeColor&&void 0===s.shade?`var(--mantine-color-${s.color}-outline)`:s.color;return{indicator:{"--radio-size":getSize(r,"radio-size"),"--radio-radius":void 0===t?void 0:getRadius(t),"--radio-color":"outline"===i?l:getThemeColor(n,e),"--radio-icon-size":getSize(r,"radio-icon-size"),"--radio-icon-color":o?getThemeColor(o,e):getAutoContrastValue(a,e)?getContrastColor({color:n,theme:e,autoContrast:a}):void 0}}}),RadioIndicator=factory((e,t)=>{const n=useProps("RadioIndicator",defaultProps$m,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,icon:c,radius:u,color:d,iconColor:p,autoContrast:h,checked:f,mod:A,variant:m,disabled:g,...y}=n,v=c,b=useStyles$u({name:"RadioIndicator",classes:classes$b,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$7,rootSelector:"indicator"}),x=useRadioCardContext(),w="boolean"==typeof f?f:(null==x?void 0:x.checked)||!1;return factory$1(Box,{ref:t,...b("indicator",{variant:m}),variant:m,mod:[{checked:w,disabled:g},A],...y,children:factory$1(v,{...b("icon")})})});RadioIndicator.displayName="@mantine/core/RadioIndicator",RadioIndicator.classes=classes$b;var classes$a={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const defaultProps$l={labelPosition:"right"},varsResolver$6=createVarsResolver((e,{size:t,radius:n,color:r,iconColor:o,variant:i,autoContrast:a})=>{const s=parseThemeColor({color:r||e.primaryColor,theme:e}),l=s.isThemeColor&&void 0===s.shade?`var(--mantine-color-${s.color}-outline)`:s.color;return{root:{"--radio-size":getSize(t,"radio-size"),"--radio-radius":void 0===n?void 0:getRadius(n),"--radio-color":"outline"===i?l:getThemeColor(r,e),"--radio-icon-color":o?getThemeColor(o,e):getAutoContrastValue(a,e)?getContrastColor({color:r,theme:e,autoContrast:a}):void 0,"--radio-icon-size":getSize(t,"radio-icon-size")}}}),Radio=factory((e,t)=>{const n=useProps("Radio",defaultProps$l,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,id:c,size:u,label:d,labelPosition:p,description:h,error:f,radius:A,color:m,variant:g,disabled:y,wrapperProps:v,icon:b=RadioIcon,rootRef:x,iconColor:w,onChange:C,mod:$,..._}=n,S=useStyles$u({name:"Radio",classes:classes$a,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$6}),E=useRadioGroupContext(),k=(null==E?void 0:E.size)??u,B=n.size?u:k,{styleProps:P,rest:T}=extractStyleProps(_),I=useId$1(c),L=E?{checked:E.value===T.value,name:T.name??E.name,onChange:e=>{E.onChange(e),null==C||C(e)}}:{};return factory$1(InlineInput,{...S("root"),__staticSelector:"Radio",__stylesApiProps:n,id:I,size:B,labelPosition:p,label:d,description:h,error:f,disabled:y,classNames:r,styles:a,unstyled:s,"data-checked":L.checked||void 0,variant:g,ref:x,mod:$,...P,...v,children:factory$1(Box,{...S("inner"),mod:{"label-position":p},children:[factory$1(Box,{...S("radio",{focusable:!0,variant:g}),onChange:C,...T,...L,component:"input",mod:{error:!!f},ref:t,id:I,disabled:y,type:"radio"}),factory$1(b,{...S("icon"),"aria-hidden":!0})]})})});Radio.classes=classes$a,Radio.displayName="@mantine/core/Radio",Radio.Group=RadioGroup,Radio.Card=RadioCard,Radio.Indicator=RadioIndicator;const defaultProps$k={searchable:!1,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left"},Select=factory((e,t)=>{const n=useProps("Select",defaultProps$k,e),{classNames:r,styles:o,unstyled:i,vars:a,dropdownOpened:s,defaultDropdownOpened:l,onDropdownClose:c,onDropdownOpen:u,onFocus:d,onBlur:p,onClick:h,onChange:f,data:A,value:m,defaultValue:g,selectFirstOptionOnChange:y,onOptionSubmit:v,comboboxProps:b,readOnly:x,disabled:w,filter:C,limit:$,withScrollArea:_,maxDropdownHeight:S,size:E,searchable:k,rightSection:B,checkIconPosition:P,withCheckIcon:T,nothingFoundMessage:I,name:L,form:M,searchValue:D,defaultSearchValue:N,onSearchChange:F,allowDeselect:O,error:R,rightSectionPointerEvents:U,id:j,clearable:H,clearButtonProps:Q,hiddenInputProps:z,renderOption:V,onClear:W,autoComplete:Y,scrollAreaProps:G,...K}=n,q=reactExports.useMemo(()=>getParsedComboboxData(A),[A]),J=reactExports.useMemo(()=>getOptionsLockup(q),[q]),Z=useId$1(j),[X,ee,te]=useUncontrolled({value:m,defaultValue:g,finalValue:null,onChange:f}),ne="string"==typeof X?J[X]:void 0,re=usePrevious(ne),[oe,ie]=useUncontrolled({value:D,defaultValue:N,finalValue:ne?ne.label:"",onChange:F}),ae=useCombobox({opened:s,defaultOpened:l,onDropdownOpen:()=>{null==u||u(),ae.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{null==c||c(),ae.resetSelectedOption()}}),{resolvedClassNames:se,resolvedStyles:le}=useResolvedStylesApi({props:n,styles:o,classNames:r});reactExports.useEffect(()=>{y&&ae.selectFirstOption()},[y,X]),reactExports.useEffect(()=>{null===m&&ie(""),"string"!=typeof m||!ne||(null==re?void 0:re.value)===ne.value&&(null==re?void 0:re.label)===ne.label||ie(ne.label)},[m,ne]);const ce=H&&!!X&&!w&&!x&&factory$1(Combobox.ClearButton,{size:E,...Q,onClear:()=>{ee(null,null),ie(""),null==W||W()}});return factory$1(Fragment,{children:[factory$1(Combobox,{store:ae,__staticSelector:"Select",classNames:se,styles:le,unstyled:i,readOnly:x,onOptionSubmit:e=>{null==v||v(e);const t=O&&J[e].value===X?null:J[e],n=t?t.value:null;n!==X&&ee(n,t),!te&&ie("string"==typeof n&&(null==t?void 0:t.label)||""),ae.closeDropdown()},size:E,...b,children:[factory$1(Combobox.Target,{targetType:k?"input":"button",autoComplete:Y,children:factory$1(InputBase,{id:Z,ref:t,rightSection:B||ce||factory$1(Combobox.Chevron,{size:E,error:R,unstyled:i}),rightSectionPointerEvents:U||(ce?"all":"none"),...K,size:E,__staticSelector:"Select",disabled:w,readOnly:x||!k,value:oe,onChange:e=>{ie(e.currentTarget.value),ae.openDropdown(),y&&ae.selectFirstOption()},onFocus:e=>{k&&ae.openDropdown(),null==d||d(e)},onBlur:e=>{var t;k&&ae.closeDropdown(),ie(null!=X&&(null==(t=J[X])?void 0:t.label)||""),null==p||p(e)},onClick:e=>{k?ae.openDropdown():ae.toggleDropdown(),null==h||h(e)},classNames:se,styles:le,unstyled:i,pointer:!k,error:R})}),factory$1(OptionsDropdown,{data:q,hidden:x||w,filter:C,search:oe,limit:$,hiddenWhenEmpty:!I,withScrollArea:_,maxDropdownHeight:S,filterOptions:k&&(null==ne?void 0:ne.label)!==oe,value:X,checkIconPosition:P,withCheckIcon:T,nothingFoundMessage:I,unstyled:i,labelId:K.label?`${Z}-label`:void 0,"aria-label":K.label?void 0:K["aria-label"],renderOption:V,scrollAreaProps:G})]}),factory$1(Combobox.HiddenInput,{value:X,name:L,form:M,disabled:w,...z})]})});Select.classes={...InputBase.classes,...Combobox.classes},Select.displayName="@mantine/core/Select";const[SliderProvider,useSliderContext]=createSafeContext("SliderProvider was not found in tree"),SliderRoot=reactExports.forwardRef(({size:e,disabled:t,variant:n,color:r,thumbSize:o,radius:i,...a},s)=>{const{getStyles:l}=useSliderContext();return factory$1(Box,{tabIndex:-1,variant:n,size:e,ref:s,...l("root"),...a})});SliderRoot.displayName="@mantine/core/SliderRoot";const Thumb=reactExports.forwardRef(({max:e,min:t,value:n,position:r,label:o,dragging:i,onMouseDown:a,onKeyDownCapture:s,labelTransitionProps:l,labelAlwaysOn:c,thumbLabel:u,onFocus:d,onBlur:p,showLabelOnHover:h,isHovered:f,children:A=null,disabled:m},g)=>{const{getStyles:y}=useSliderContext(),[v,b]=reactExports.useState(!1),x=c||i||v||h&&f;return factory$1(Box,{tabIndex:0,role:"slider","aria-label":u,"aria-valuemax":e,"aria-valuemin":t,"aria-valuenow":n,ref:g,__vars:{"--slider-thumb-offset":`${r}%`},...y("thumb",{focusable:!0}),mod:{dragging:i,disabled:m},onFocus:()=>{b(!0),"function"==typeof d&&d()},onBlur:()=>{b(!1),"function"==typeof p&&p()},onTouchStart:a,onMouseDown:a,onKeyDownCapture:s,onClick:e=>e.stopPropagation(),children:[A,factory$1(Transition,{mounted:null!=o&&!!x,transition:"fade",duration:0,...l,children:e=>factory$1("div",{...y("label",{style:e}),children:o})})]})});function getPosition({value:e,min:t,max:n}){const r=(e-t)/(n-t)*100;return Math.min(Math.max(r,0),100)}function isMarkFilled({mark:e,offset:t,value:n,inverted:r=!1}){return r?"number"==typeof t&&e.value<=t||e.value>=n:"number"==typeof t?e.value>=t&&e.value<=n:e.value<=n}function Marks({marks:e,min:t,max:n,disabled:r,value:o,offset:i,inverted:a}){const{getStyles:s}=useSliderContext();if(!e)return null;const l=e.map((e,l)=>reactExports.createElement(Box,{...s("markWrapper"),__vars:{"--mark-offset":`${getPosition({value:e.value,min:t,max:n})}%`},key:l},factory$1(Box,{...s("mark"),mod:{filled:isMarkFilled({mark:e,value:o,offset:i,inverted:a}),disabled:r}}),e.label&&factory$1("div",{...s("markLabel"),children:e.label})));return factory$1("div",{children:l})}function Track({filled:e,children:t,offset:n,disabled:r,marksOffset:o,inverted:i,containerProps:a,...s}){const{getStyles:l}=useSliderContext();return factory$1(Fragment,{children:factory$1(Box,{...l("trackContainer"),mod:{disabled:r},...a,children:factory$1(Box,{...l("track"),mod:{inverted:i,disabled:r},children:[factory$1(Box,{mod:{inverted:i,disabled:r},__vars:{"--slider-bar-width":`calc(${e}% + var(--slider-size))`,"--slider-bar-offset":`calc(${n}% - var(--slider-size))`},...l("bar")}),t,factory$1(Marks,{...s,offset:o,disabled:r,inverted:i})]})})})}function getChangeValue({value:e,containerWidth:t,min:n,max:r,step:o,precision:i}){const a=(t?Math.min(Math.max(e,0),t)/t:e)*(r-n),s=(0!==a?Math.round(a/o)*o:0)+n,l=Math.max(s,n);return void 0!==i?Number(l.toFixed(i)):l}function getFloatingValue(e,t){return parseFloat(e.toFixed(t))}function getPrecision(e){if(!e)return 0;const t=e.toString().split(".");return t.length>1?t[1].length:0}Thumb.displayName="@mantine/core/SliderThumb",Marks.displayName="@mantine/core/SliderMarks",Track.displayName="@mantine/core/SliderTrack";var classes$9={root:"m_dd36362e",label:"m_c9357328",thumb:"m_c9a9a60a",trackContainer:"m_a8645c2",track:"m_c9ade57f",bar:"m_38aeed47",markWrapper:"m_b7b0423a",mark:"m_dd33bc19",markLabel:"m_68c77a5b"};const defaultProps$j={radius:"xl",min:0,max:100,step:1,marks:[],label:e=>e,labelTransitionProps:{transition:"fade",duration:0},labelAlwaysOn:!1,thumbLabel:"",showLabelOnHover:!0,disabled:!1,scale:e=>e},varsResolver$5=createVarsResolver((e,{size:t,color:n,thumbSize:r,radius:o})=>({root:{"--slider-size":getSize(t,"slider-size"),"--slider-color":n?getThemeColor(n,e):void 0,"--slider-radius":void 0===o?void 0:getRadius(o),"--slider-thumb-size":void 0!==r?rem(r):"calc(var(--slider-size) * 2)"}})),Slider=factory((e,t)=>{const n=useProps("Slider",defaultProps$j,e),{classNames:r,styles:o,value:i,onChange:a,onChangeEnd:s,size:l,min:c,max:u,step:d,precision:p,defaultValue:h,name:f,marks:A,label:m,labelTransitionProps:g,labelAlwaysOn:y,thumbLabel:v,showLabelOnHover:b,thumbChildren:x,disabled:w,unstyled:C,scale:$,inverted:_,className:S,style:E,vars:k,hiddenInputProps:B,...P}=n,T=useStyles$u({name:"Slider",props:n,classes:classes$9,classNames:r,className:S,styles:o,style:E,vars:k,varsResolver:varsResolver$5,unstyled:C}),{dir:I}=useDirection(),[L,M]=reactExports.useState(!1),[D,N]=useUncontrolled({value:"number"==typeof i?clamp$2(i,c,u):i,defaultValue:"number"==typeof h?clamp$2(h,c,u):h,finalValue:clamp$2(0,c,u),onChange:a}),F=reactExports.useRef(D),O=reactExports.useRef(),R=reactExports.useRef(),U=getPosition({value:D,min:c,max:u}),j=$(D),H="function"==typeof m?m(j):m,Q=p??getPrecision(d),z=reactExports.useCallback(({x:e})=>{if(!w){const t=getChangeValue({value:e,min:c,max:u,step:d,precision:Q});N(t),F.current=t}},[w,c,u,d,Q,N]),{ref:V,active:W}=useMove(z,{onScrubEnd:()=>null==s?void 0:s(F.current)},I);return factory$1(SliderProvider,{value:{getStyles:T},children:factory$1(SliderRoot,{...P,ref:useMergedRef(t,O),onKeyDownCapture:e=>{var t,n,r,o,i,a;if(!w)switch(e.key){case"ArrowUp":{e.preventDefault(),null==(t=R.current)||t.focus();const n=getFloatingValue(Math.min(Math.max(D+d,c),u),Q);N(n),null==s||s(n);break}case"ArrowRight":{e.preventDefault(),null==(n=R.current)||n.focus();const t=getFloatingValue(Math.min(Math.max("rtl"===I?D-d:D+d,c),u),Q);N(t),null==s||s(t);break}case"ArrowDown":{e.preventDefault(),null==(r=R.current)||r.focus();const t=getFloatingValue(Math.min(Math.max(D-d,c),u),Q);N(t),null==s||s(t);break}case"ArrowLeft":{e.preventDefault(),null==(o=R.current)||o.focus();const t=getFloatingValue(Math.min(Math.max("rtl"===I?D+d:D-d,c),u),Q);N(t),null==s||s(t);break}case"Home":e.preventDefault(),null==(i=R.current)||i.focus(),N(c),null==s||s(c);break;case"End":e.preventDefault(),null==(a=R.current)||a.focus(),N(u),null==s||s(u)}},onMouseDownCapture:()=>{var e;return null==(e=O.current)?void 0:e.focus()},size:l,disabled:w,children:[factory$1(Track,{inverted:_,offset:0,filled:U,marks:A,min:c,max:u,value:j,disabled:w,containerProps:{ref:V,onMouseEnter:b?()=>M(!0):void 0,onMouseLeave:b?()=>M(!1):void 0},children:factory$1(Thumb,{max:u,min:c,value:j,position:U,dragging:W,label:H,ref:R,labelTransitionProps:g,labelAlwaysOn:y,thumbLabel:v,showLabelOnHover:b,isHovered:L,disabled:w,children:x})}),factory$1("input",{type:"hidden",name:f,value:j,...B})]})})});Slider.classes=classes$9,Slider.displayName="@mantine/core/Slider";const SwitchGroupContext=reactExports.createContext(null),SwitchGroupProvider=SwitchGroupContext.Provider,useSwitchGroupContext=()=>reactExports.useContext(SwitchGroupContext),defaultProps$i={},SwitchGroup=factory((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:s,readOnly:l,...c}=useProps("SwitchGroup",defaultProps$i,e),[u,d]=useUncontrolled({value:n,defaultValue:r,finalValue:[],onChange:o});return factory$1(SwitchGroupProvider,{value:{value:u,onChange:e=>{const t=e.currentTarget.value;!l&&d(u.includes(t)?u.filter(e=>e!==t):[...u,t])},size:i},children:factory$1(Input$5.Wrapper,{size:i,ref:t,...a,...c,labelElement:"div",__staticSelector:"SwitchGroup",children:factory$1(InputsGroupFieldset,{role:"group",children:s})})})});SwitchGroup.classes=Input$5.Wrapper.classes,SwitchGroup.displayName="@mantine/core/SwitchGroup";var classes$8={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const defaultProps$h={labelPosition:"right"},varsResolver$4=createVarsResolver((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":void 0===t?void 0:getRadius(t),"--switch-height":getSize(r,"switch-height"),"--switch-width":getSize(r,"switch-width"),"--switch-thumb-size":getSize(r,"switch-thumb-size"),"--switch-label-font-size":getSize(r,"switch-label-font-size"),"--switch-track-label-padding":getSize(r,"switch-track-label-padding"),"--switch-color":n?getThemeColor(n,e):void 0}})),Switch=factory((e,t)=>{const n=useProps("Switch",defaultProps$h,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,color:c,label:u,offLabel:d,onLabel:p,id:h,size:f,radius:A,wrapperProps:m,thumbIcon:g,checked:y,defaultChecked:v,onChange:b,labelPosition:x,description:w,error:C,disabled:$,variant:_,rootRef:S,mod:E,...k}=n,B=useSwitchGroupContext(),P=f||(null==B?void 0:B.size),T=useStyles$u({name:"Switch",props:n,classes:classes$8,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$4}),{styleProps:I,rest:L}=extractStyleProps(k),M=useId$1(h),D=B?{checked:B.value.includes(L.value),onChange:B.onChange}:{},[N,F]=useUncontrolled({value:D.checked??y,defaultValue:v,finalValue:!1});return factory$1(InlineInput,{...T("root"),__staticSelector:"Switch",__stylesApiProps:n,id:M,size:P,labelPosition:x,label:u,description:w,error:C,disabled:$,bodyElement:"label",labelElement:"span",classNames:r,styles:a,unstyled:s,"data-checked":D.checked||void 0,variant:_,ref:S,mod:E,...I,...m,children:[factory$1("input",{...L,disabled:$,checked:N,onChange:e=>{var t;B?null==(t=D.onChange)||t.call(D,e):null==b||b(e),F(e.currentTarget.checked)},id:M,ref:t,type:"checkbox",role:"switch",...T("input")}),factory$1(Box,{"aria-hidden":"true",mod:{error:C,"label-position":x,"without-labels":!p&&!d},...T("track"),children:[factory$1(Box,{component:"span",mod:"reduce-motion",...T("thumb"),children:g}),factory$1("span",{...T("trackLabel"),children:N?p:d})]})]})});Switch.classes={...classes$8,...InlineInputClasses},Switch.displayName="@mantine/core/Switch",Switch.Group=SwitchGroup;const defaultProps$g={},TextInput=factory((e,t)=>{const n=useProps("TextInput",defaultProps$g,e);return factory$1(InputBase,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});var createRoot;TextInput.classes=InputBase.classes,TextInput.displayName="@mantine/core/TextInput";var m$2=reactDomExports;createRoot=m$2.createRoot,m$2.hydrateRoot;const baseServices$1={alertService:Symbol("alertService"),errorService:Symbol("errorService"),layoutService:Symbol("layoutService"),loggerService:Symbol("loggerService"),routerService:Symbol("routerService"),linkService:Symbol("linkService")},globalServices$1={symbolGlobalService:Symbol("symbolGlobalService"),priceGlobalService:Symbol("priceGlobalService"),backtestGlobalService:Symbol("backtestGlobalService"),liveGlobalService:Symbol("liveGlobalService")},helperServices$1={explorerHelperService:Symbol("explorerHelperService"),markdownHelperService:Symbol("markdownHelperService")},mockServices$1={exchangeMockService:Symbol("exchangeMockService"),notificationMockService:Symbol("notificationMockService"),storageMockService:Symbol("storageMockService"),logMockService:Symbol("logMockService"),statusMockService:Symbol("statusMockService"),markdownMockService:Symbol("markdownMockService"),explorerMockService:Symbol("explorerMockService"),signalMockService:Symbol("signalMockService"),heatMockService:Symbol("heatMockService")},viewServices$1={exchangeViewService:Symbol("exchangeViewService"),notificationViewService:Symbol("notificationViewService"),storageViewService:Symbol("storageViewService"),logViewService:Symbol("logViewService"),statusViewService:Symbol("statusViewService"),markdownViewService:Symbol("markdownViewService"),explorerViewService:Symbol("explorerViewService"),signalViewService:Symbol("signalViewService"),heatViewService:Symbol("heatViewService")},TYPES={...baseServices$1,...globalServices$1,...helperServices$1,...mockServices$1,...viewServices$1};class ErrorService{routerService=YS(TYPES.routerService);loggerService=YS(TYPES.loggerService);errorSubject=new ar;handleGlobalError=e=>{console.error(e),this.loggerService.error(e),this.routerService.push("/error_page"),this.errorSubject.next()}}class LayoutService{appbarSubject=new ar;modalSubject=new ar;pickSignalSubject=new ar;pickRiskSubject=new ar;pickSignalOpenedSubject=new ar;pickSignalClosedSubject=new ar;pickSignalScheduledSubject=new ar;pickSignalCancelledSubject=new ar;pickSignalNotifySubject=new ar;pickPartialProfitAvailableSubject=new ar;pickPartialProfitCommitSubject=new ar;pickPartialLossAvailableSubject=new ar;pickPartialLossCommitSubject=new ar;pickBreakevenAvailableSubject=new ar;pickBreakevenCommitSubject=new ar;pickTrailingStopSubject=new ar;pickTrailingTakeSubject=new ar;pickActivateScheduledSubject=new ar;pickAverageBuyCommitSubject=new ar;pickSignalSyncOpenSubject=new ar;pickSignalSyncCloseSubject=new ar;pickCancelScheduledSubject=new ar;pickClosePendingSubject=new ar;pickDumpContentSubject=new ar;closeModalSubject=new ar;reloadOutletSubject=new ar;openDocumentSubject=new ar;promptOutgoing=new ar;promptIncoming=new ar;alertOutgoung=new ar;_modalLoading=0;_appbarLoading=0;get hasModalLoader(){return!!this._modalLoading}get hasAppbarLoader(){return!!this._appbarLoading}setModalLoader=e=>{this._modalLoading=Math.max(this._modalLoading+(e?1:-1),0),this.modalSubject.next(e)};setAppbarLoader=e=>{this._appbarLoading=Math.max(this._appbarLoading+(e?1:-1),0),this.appbarSubject.next(e)};dropModalLoader=()=>{this._modalLoading=0,this.modalSubject.next(!1)};dropAppbarLoader=()=>{this._appbarLoading=0,this.appbarSubject.next(!1)};reloadOutlet=()=>{this.reloadOutletSubject.next()};prompt=async(e,t="")=>(this.promptOutgoing.next({title:e,value:t}),await this.promptIncoming.toPromise());closeModal=async()=>{await this.closeModalSubject.next()};downloadFile=(e,t,n)=>{this.openDocumentSubject.next({url:e,fileName:t,sizeOriginal:n})};pickAlert=async(e,t)=>{await this.alertOutgoung.next({title:e,description:t})};pickSignal=async e=>{await this.pickSignalSubject.next(e)};pickRisk=async e=>{await this.pickRiskSubject.next(e)};pickSignalOpened=async e=>{await this.pickSignalOpenedSubject.next(e)};pickSignalNotify=async e=>{await this.pickSignalNotifySubject.next(e)};pickSignalClosed=async e=>{await this.pickSignalClosedSubject.next(e)};pickSignalScheduled=async e=>{await this.pickSignalScheduledSubject.next(e)};pickSignalCancelled=async e=>{await this.pickSignalCancelledSubject.next(e)};pickPartialProfitAvailable=async e=>{await this.pickPartialProfitAvailableSubject.next(e)};pickPartialProfitCommit=async e=>{await this.pickPartialProfitCommitSubject.next(e)};pickPartialLossAvailable=async e=>{await this.pickPartialLossAvailableSubject.next(e)};pickPartialLossCommit=async e=>{await this.pickPartialLossCommitSubject.next(e)};pickBreakevenAvailable=async e=>{await this.pickBreakevenAvailableSubject.next(e)};pickBreakevenCommit=async e=>{await this.pickBreakevenCommitSubject.next(e)};pickTrailingStop=async e=>{await this.pickTrailingStopSubject.next(e)};pickTrailingTake=async e=>{await this.pickTrailingTakeSubject.next(e)};pickActivateScheduled=async e=>{await this.pickActivateScheduledSubject.next(e)};pickAverageBuyCommit=async e=>{await this.pickAverageBuyCommitSubject.next(e)};pickSignalSyncOpen=async e=>{await this.pickSignalSyncOpenSubject.next(e)};pickSignalSyncClose=async e=>{await this.pickSignalSyncCloseSubject.next(e)};pickCancelScheduled=async e=>{await this.pickCancelScheduledSubject.next(e)};pickClosePending=async e=>{await this.pickClosePendingSubject.next(e)};pickDumpContent=async e=>{await this.pickDumpContentSubject.next(e)}}class LoggerService{reloadSubject=new ar;_enabled=!1;error=e=>{console.error(e)};log=(e,t)=>{this._enabled&&console.log(e,t)};setEnabled=e=>{this._enabled=e,this.reloadSubject.next()}}const basePathSet=new Set(["/error_page","/offline_page","/dashboard"]),browserHistory=CC_FORCE_BROWSER_HISTORY?jf():hI("router-service-path",{allowed:e=>!basePathSet.has(e),map:e=>basePathSet.has(e)?"/":e}),DEFAULT_PATH$l="/",ALLOWED_BACK_PATH=new Set(["/dashboard"]),lastBasePathManager=ip("router-service_lastBasePath");class RouterService{reloadSubject=new ar;location=browserHistory.location;action=browserHistory.action;get lastBasePath(){return lastBasePathManager.getValue()}set lastBasePath(e){lastBasePathManager.setValue(e)}subscribeLeave=e=>mr.create(e=>this.listen(({action:t})=>{"PUSH"===t&&e()})).once(e);get locationState(){return this.location.state?this.location.state:{}}get path(){var e;return(null==(e=this.location)?void 0:e.pathname)||DEFAULT_PATH$l}pushPreviousPath=e=>{ALLOWED_BACK_PATH.has(e)&&(this.lastBasePath=e)};updateState=()=>{this.location=browserHistory.location,this.action=browserHistory.action,this.reloadSubject.next()};createHref=e=>{const t=browserHistory.createHref(e);return this.updateState(),t};push=(e,t)=>{const n="string"==typeof e?e:e.pathname;this.pushPreviousPath(this.location.pathname);const r=browserHistory.push({pathname:n,search:window.location.search,hash:window.location.hash},t||this.locationState);return this.updateState(),r};replace=(e,t)=>{const n="string"==typeof e?e:e.pathname;this.pushPreviousPath(this.location.pathname);const r=browserHistory.replace({pathname:n,search:window.location.search,hash:window.location.hash},t||this.locationState);return this.updateState(),r};go=e=>{const t=browserHistory.go(e);return this.updateState(),t};back=()=>{if(this.lastBasePath){const e=browserHistory.push({pathname:this.lastBasePath,search:window.location.search,hash:window.location.hash});return this.lastBasePath=null,this.updateState(),e}const e=browserHistory.back();return this.updateState(),e};forward=()=>{const e=browserHistory.forward();return this.updateState(),e};listen=e=>{const t=browserHistory.listen(e);return this.updateState(),t};block=e=>{const t=browserHistory.block(e);return this.updateState(),t};prefetch=so(async()=>{basePathSet.has(browserHistory.location.pathname)&&browserHistory.push("/")})}const byteToHex=[];for(let Wp=0;Wp<256;++Wp)byteToHex.push((Wp+256).toString(16).slice(1));function unsafeStringify(e,t=0){return(byteToHex[e[t+0]]+byteToHex[e[t+1]]+byteToHex[e[t+2]]+byteToHex[e[t+3]]+"-"+byteToHex[e[t+4]]+byteToHex[e[t+5]]+"-"+byteToHex[e[t+6]]+byteToHex[e[t+7]]+"-"+byteToHex[e[t+8]]+byteToHex[e[t+9]]+"-"+byteToHex[e[t+10]]+byteToHex[e[t+11]]+byteToHex[e[t+12]]+byteToHex[e[t+13]]+byteToHex[e[t+14]]+byteToHex[e[t+15]]).toLowerCase()}let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");getRandomValues=crypto.getRandomValues.bind(crypto)}return getRandomValues(rnds8)}const randomUUID="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native={randomUUID:randomUUID};function v4(e,t,n){var r;if(native.randomUUID&&!e)return native.randomUUID();const o=(e=e||{}).random??(null==(r=e.rng)?void 0:r.call(e))??rng();if(o.length<16)throw new Error("Random bytes length must be >= 16");return o[6]=15&o[6]|64,o[8]=63&o[8]|128,unsafeStringify(o)}class AlertService{reloadSubject=new ar;_alerts=[];get current(){return this._alerts.length?this._alerts[0]:null}hideCurrent=()=>{this._alerts.length>0&&this._alerts.shift(),this.reloadSubject.next()};notify=(e,t=!1)=>{this.hideCurrent(),this._alerts.push({key:v4(),pin:t,message:e}),this.reloadSubject.next()}}class LinkService{loggerService=YS(TYPES.loggerService);routerService=YS(TYPES.routerService);layoutService=YS(TYPES.layoutService);openLink=async e=>{this.loggerService.log("linkService openLink",{href:e});let t=null;if(t=fL("/pick-dump-search/:search",e))return await this.layoutService.closeModal(),void this.routerService.push(`/dump/${t.params.search}`);(t=fL("/pick-signal/:signalId",e))?this.layoutService.pickSignal(t.params.signalId):(t=fL("/pick-risk/:notificationId",e))?this.layoutService.pickRisk(t.params.notificationId):(t=fL("/pick-dump-content/:sessionId",e))?this.layoutService.pickDumpContent(t.params.sessionId):(t=fL("/pick-signal-opened/:notificationId",e))?this.layoutService.pickSignalOpened(t.params.notificationId):(t=fL("/pick-signal-closed/:notificationId",e))?this.layoutService.pickSignalClosed(t.params.notificationId):(t=fL("/pick-signal-scheduled/:notificationId",e))?this.layoutService.pickSignalScheduled(t.params.notificationId):(t=fL("/pick-signal-cancelled/:notificationId",e))?this.layoutService.pickSignalCancelled(t.params.notificationId):(t=fL("/pick-signal-sync-open/:notificationId",e))?this.layoutService.pickSignalSyncOpen(t.params.notificationId):(t=fL("/pick-signal-sync-close/:notificationId",e))?this.layoutService.pickSignalSyncClose(t.params.notificationId):(t=fL("/pick-activate-scheduled/:notificationId",e))?this.layoutService.pickActivateScheduled(t.params.notificationId):(t=fL("/pick-average-buy-commit/:notificationId",e))?this.layoutService.pickAverageBuyCommit(t.params.notificationId):(t=fL("/pick-cancel-scheduled/:notificationId",e))?this.layoutService.pickCancelScheduled(t.params.notificationId):(t=fL("/pick-close-pending/:notificationId",e))?this.layoutService.pickClosePending(t.params.notificationId):(t=fL("/pick-partial-loss-available/:notificationId",e))?this.layoutService.pickPartialLossAvailable(t.params.notificationId):(t=fL("/pick-partial-loss-commit/:notificationId",e))?this.layoutService.pickPartialLossCommit(t.params.notificationId):(t=fL("/pick-partial-profit-available/:notificationId",e))?this.layoutService.pickPartialProfitAvailable(t.params.notificationId):(t=fL("/pick-partial-profit-commit/:notificationId",e))?this.layoutService.pickPartialProfitCommit(t.params.notificationId):(t=fL("/pick-breakeven-available/:notificationId",e))?this.layoutService.pickBreakevenAvailable(t.params.notificationId):(t=fL("/pick-breakeven-commit/:notificationId",e))?this.layoutService.pickBreakevenCommit(t.params.notificationId):(t=fL("/pick-trailing-stop/:notificationId",e))?this.layoutService.pickTrailingStop(t.params.notificationId):(t=fL("/pick-trailing-take/:notificationId",e))?this.layoutService.pickTrailingTake(t.params.notificationId):ak(e)}}class ExchangeMockService{loggerService=YS(TYPES.loggerService);getSignalCandles=async(e,t)=>{this.loggerService.log("exchangeMockService getSignalCandles",{signalId:e,interval:t});const{data:n,error:r}=await Mf("/api/v1/mock/candles_signal",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),signalId:e,interval:t})});if(r)throw new Error(r);return n};getPointCandles=async e=>{this.loggerService.log("exchangeMockService getPointCandles",{dto:e});const{data:t,error:n}=await Mf("/api/v1/mock/candles_point",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),...e})});if(n)throw new Error(n);return t};getLiveCandles=async(e,t)=>{this.loggerService.log("exchangeMockService getLiveCandles",{signalId:e,interval:t});const{data:n,error:r}=await Mf("/api/v1/mock/candles_live",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),signalId:e,interval:t})});if(r)throw new Error(r);return n};getLastCandles=async(e,t)=>{this.loggerService.log("exchangeMockService getLastCandles",{symbol:e,interval:t});const{data:n,error:r}=await Mf("/api/v1/mock/candles_last",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,interval:t})});if(r)throw new Error(r);return n};getRangeCandles=async e=>{this.loggerService.log("exchangeMockService getRangeCandles",{dto:e});const{data:t,error:n}=await Mf("/api/v1/mock/candles_range",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),...e})});if(n)throw new Error(n);return t}}class NotificationMockService{loggerService=YS(TYPES.loggerService);getList=async()=>{this.loggerService.log("notificationMockService getList");const{data:e,error:t}=await Mf("/api/v1/mock/notification_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getOne=async e=>{this.loggerService.log("notificationMockService getOne",{id:e});const{data:t,error:n}=await Mf(`/api/v1/mock/notification_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};findByFilter=async(e,t,n)=>{this.loggerService.log("notificationMockService findByFilter",{filterData:e,limit:t,offset:n});const{data:r,error:o}=await Mf("/api/v1/mock/notification_filter",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),filterData:e,limit:t,offset:n})});if(o)throw new Error(o);return r}}class StorageMockService{loggerService=YS(TYPES.loggerService);findSignalById=async e=>{this.loggerService.log("storageMockService findSignalById",{signalId:e});const{data:t,error:n}=await Mf(`/api/v1/mock/storage_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};listSignalLive=async()=>{this.loggerService.log("storageMockService listSignalLive");const{data:e,error:t}=await Mf("/api/v1/mock/storage_list/live",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};listSignalBacktest=async()=>{this.loggerService.log("storageMockService listSignalBacktest");const{data:e,error:t}=await Mf("/api/v1/mock/storage_list/backtest",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e}}class LogMockService{loggerService=YS(TYPES.loggerService);getList=async()=>{this.loggerService.log("logMockService getList");const{data:e,error:t}=await Mf("/api/v1/mock/log_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getOne=async e=>{this.loggerService.log("logMockService getOne",{id:e});const{data:t,error:n}=await Mf(`/api/v1/mock/log_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};findByFilter=async(e,t,n)=>{this.loggerService.log("logMockService findByFilter",{filterData:e,limit:t,offset:n});const{data:r,error:o}=await Mf("/api/v1/mock/log_filter",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),filterData:e,limit:t,offset:n})});if(o)throw new Error(o);return r}}class StatusMockService{loggerService=YS(TYPES.loggerService);getStatusList=async()=>{this.loggerService.log("statusMockService getStatusList");const{data:e,error:t}=await Mf("/api/v1/mock/status_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getStatusMap=async()=>{this.loggerService.log("statusMockService getStatusMap");return(await this.getStatusList()).reduce((e,t)=>({...e,[t.id]:t}),{})};getStatusOne=async e=>{this.loggerService.log("statusMockService getStatusOne",{id:e});const{data:t,error:n}=await Mf(`/api/v1/mock/status_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};getStatusInfo=async()=>{this.loggerService.log("statusMockService getStatusInfo");const{data:e,error:t}=await Mf("/api/v1/mock/status_info",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e}}class MarkdownMockService{loggerService=YS(TYPES.loggerService);getStrategyData=async(e,t,n,r)=>{this.loggerService.log("markdownMockService getStrategyData",{symbol:e,strategyName:t,exchangeName:n,frameName:r});const{data:o,error:i}=await Mf("/api/v1/markdown_mock/strategy_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r})});if(i)throw new Error(i);return o};getStrategyReport=async(e,t,n,r)=>{this.loggerService.log("markdownMockService getStrategyReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r});const{data:o,error:i}=await Mf("/api/v1/markdown_mock/strategy_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r})});if(i)throw new Error(i);return o};getBacktestData=async(e,t,n,r)=>{this.loggerService.log("markdownMockService getBacktestData",{symbol:e,strategyName:t,exchangeName:n,frameName:r});const{data:o,error:i}=await Mf("/api/v1/markdown_mock/backtest_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r})});if(i)throw new Error(i);return o};getBacktestReport=async(e,t,n,r)=>{this.loggerService.log("markdownMockService getBacktestReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r});const{data:o,error:i}=await Mf("/api/v1/markdown_mock/backtest_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r})});if(i)throw new Error(i);return o};getLiveData=async(e,t,n)=>{this.loggerService.log("markdownMockService getLiveData",{symbol:e,strategyName:t,exchangeName:n});const{data:r,error:o}=await Mf("/api/v1/markdown_mock/live_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n})});if(o)throw new Error(o);return r};getLiveReport=async(e,t,n)=>{this.loggerService.log("markdownMockService getLiveReport",{symbol:e,strategyName:t,exchangeName:n});const{data:r,error:o}=await Mf("/api/v1/markdown_mock/live_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n})});if(o)throw new Error(o);return r};getBreakevenData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getBreakevenData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/breakeven_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getBreakevenReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getBreakevenReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/breakeven_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getRiskData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getRiskData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/risk_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getRiskReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getRiskReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/risk_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPartialData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getPartialData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/partial_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPartialReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getPartialReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/partial_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getHighestProfitData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getHighestProfitData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/highest_profit_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getHighestProfitReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getHighestProfitReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/highest_profit_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getMaxDrawdownData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getMaxDrawdownData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/max_drawdown_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getMaxDrawdownReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getMaxDrawdownReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/max_drawdown_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getScheduleData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getScheduleData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/schedule_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getScheduleReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getScheduleReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/schedule_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPerformanceData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getPerformanceData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/performance_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPerformanceReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getPerformanceReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/performance_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getSyncData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getSyncData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/sync_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getSyncReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getSyncReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/sync_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getHeatData=async(e,t,n,r=!1)=>{this.loggerService.log("markdownMockService getHeatData",{strategyName:e,exchangeName:t,frameName:n,backtest:r});const{data:o,error:i}=await Mf("/api/v1/markdown_mock/heat_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),strategyName:e,exchangeName:t,frameName:n,backtest:r})});if(i)throw new Error(i);return o};getHeatReport=async(e,t,n,r=!1)=>{this.loggerService.log("markdownMockService getHeatReport",{strategyName:e,exchangeName:t,frameName:n,backtest:r});const{data:o,error:i}=await Mf("/api/v1/markdown_mock/heat_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),strategyName:e,exchangeName:t,frameName:n,backtest:r})});if(i)throw new Error(i);return o};getWalkerData=async(e,t)=>{this.loggerService.log("markdownMockService getWalkerData",{symbol:e,walkerName:t});const{data:n,error:r}=await Mf("/api/v1/markdown_mock/walker_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,walkerName:t})});if(r)throw new Error(r);return n};getWalkerReport=async(e,t)=>{this.loggerService.log("markdownMockService getWalkerReport",{symbol:e,walkerName:t});const{data:n,error:r}=await Mf("/api/v1/markdown_mock/walker_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,walkerName:t})});if(r)throw new Error(r);return n}}const TTL_TIMEOUT$3=45e3;class ExplorerMockService{loggerService=YS(TYPES.loggerService);explorerHelperService=YS(TYPES.explorerHelperService);getFolderTree=CC(async()=>{this.loggerService.log("explorerMockService getFolderTree");const{data:e,error:t}=await Mf("/api/v1/explorer_mock/tree",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e},{timeout:TTL_TIMEOUT$3});getFolderMap=CC(async()=>{this.loggerService.log("explorerMockService getFolderMap");const e={},t=await this.getFolderTree();for(const n of this.explorerHelperService.deepFlat(t))e[n.id]=n;return e},{timeout:TTL_TIMEOUT$3});getFileContent=async e=>{this.loggerService.log("explorerMockService getFileContent",{path:e});const{data:t,error:n}=await Mf("/api/v1/explorer_mock/node",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),path:e})});if(n)throw new Error(n);return t};getFileInfo=async e=>{this.loggerService.log("explorerMockService getFileInfo",{id:e});const t=(await this.getFolderMap())[e];if(!t)throw new Error(`explorerMockService getFileInfo file not found id=${e}`);if("file"!==t.type)throw new Error(`explorerMockService getFileInfo not a file id=${e} type=${t.type}`);return t};clear=()=>{this.loggerService.log("explorerMockService clear"),this.getFolderTree.clear(),this.getFolderMap.clear()}}class SignalMockService{loggerService=YS(TYPES.loggerService);getLastUpdateTimestamp=async e=>{this.loggerService.log("signalMockService getLastUpdateTimestamp",{signalId:e});const{data:t,error:n}=await Mf(`/api/v1/mock/signal_last_update/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};getPendingSignal=async e=>{this.loggerService.log("signalMockService getPendingSignal",{symbol:e});const{data:t,error:n}=await Mf("/api/v1/mock/signal_pending",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e})});if(n)throw new Error(n);return t}}class HeatMockService{loggerService=YS(TYPES.loggerService);getStrategyHeatData=async()=>{this.loggerService.log("heatMockService getStrategyHeatData");const{data:e,error:t}=await Mf("/api/v1/mock/heat_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getStrategyHeatReport=async()=>{this.loggerService.log("heatMockService getStrategyHeatReport");const{data:e,error:t}=await Mf("/api/v1/mock/heat_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e}}class ExchangeViewService{loggerService=YS(TYPES.loggerService);exchangeMockService=YS(TYPES.exchangeMockService);getSignalCandles=async(e,t)=>{if(this.loggerService.log("exchangeViewService getSignalCandles",{signalId:e,interval:t}),CC_ENABLE_MOCK)return await this.exchangeMockService.getSignalCandles(e,t);const{data:n,error:r}=await Mf("/api/v1/view/candles_signal",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),signalId:e,interval:t})});if(r)throw new Error(r);return n};getPointCandles=async e=>{if(this.loggerService.log("exchangeViewService getPointCandles",{dto:e}),CC_ENABLE_MOCK)return await this.exchangeMockService.getPointCandles(e);const{data:t,error:n}=await Mf("/api/v1/view/candles_point",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),...e})});if(n)throw new Error(n);return t};getLiveCandles=async(e,t)=>{if(this.loggerService.log("exchangeViewService getLiveCandles",{signalId:e,interval:t}),CC_ENABLE_MOCK)return await this.exchangeMockService.getLiveCandles(e,t);const{data:n,error:r}=await Mf("/api/v1/view/candles_live",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),signalId:e,interval:t})});if(r)throw new Error(r);return n};getLastCandles=async(e,t)=>{if(this.loggerService.log("exchangeViewService getLastCandles",{symbol:e,interval:t}),CC_ENABLE_MOCK)return await this.exchangeMockService.getLastCandles(e,t);const{data:n,error:r}=await Mf("/api/v1/view/candles_last",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,interval:t})});if(r)throw new Error(r);return n};getRangeCandles=async e=>{if(this.loggerService.log("exchangeViewService getRangeCandles",{dto:e}),CC_ENABLE_MOCK)return await this.exchangeMockService.getRangeCandles(e);const{data:t,error:n}=await Mf("/api/v1/view/candles_range",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),...e})});if(n)throw new Error(n);return t}}class NotificationViewService{loggerService=YS(TYPES.loggerService);notificationMockService=YS(TYPES.notificationMockService);getList=async()=>{if(this.loggerService.log("notificationViewService getList"),CC_ENABLE_MOCK)return await this.notificationMockService.getList();const{data:e,error:t}=await Mf("/api/v1/view/notification_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getOne=async e=>{if(this.loggerService.log("notificationViewService getOne",{id:e}),CC_ENABLE_MOCK)return await this.notificationMockService.getOne(e);const{data:t,error:n}=await Mf(`/api/v1/view/notification_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};findByFilter=async(e,t,n)=>{if(this.loggerService.log("notificationViewService findByFilter",{filterData:e,limit:t,offset:n}),CC_ENABLE_MOCK)return await this.notificationMockService.findByFilter(e,t,n);const{data:r,error:o}=await Mf("/api/v1/view/notification_filter",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),filterData:e,limit:t,offset:n})});if(o)throw new Error(o);return r}}class StorageViewService{loggerService=YS(TYPES.loggerService);storageMockService=YS(TYPES.storageMockService);findSignalById=async e=>{if(this.loggerService.log("storageViewService findSignalById",{signalId:e}),CC_ENABLE_MOCK)return await this.storageMockService.findSignalById(e);const{data:t,error:n}=await Mf(`/api/v1/view/storage_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};listSignalLive=async()=>{if(this.loggerService.log("storageViewService listSignalLive"),CC_ENABLE_MOCK)return await this.storageMockService.listSignalLive();const{data:e,error:t}=await Mf("/api/v1/view/storage_list/live",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};listSignalBacktest=async()=>{if(this.loggerService.log("storageViewService listSignalBacktest"),CC_ENABLE_MOCK)return await this.storageMockService.listSignalBacktest();const{data:e,error:t}=await Mf("/api/v1/view/storage_list/backtest",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e}}class LogViewService{loggerService=YS(TYPES.loggerService);logMockService=YS(TYPES.logMockService);getList=async()=>{if(this.loggerService.log("logViewService getList"),CC_ENABLE_MOCK)return await this.logMockService.getList();const{data:e,error:t}=await Mf("/api/v1/view/log_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getOne=async e=>{if(this.loggerService.log("logViewService getOne",{id:e}),CC_ENABLE_MOCK)return await this.logMockService.getOne(e);const{data:t,error:n}=await Mf(`/api/v1/view/log_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};findByFilter=async(e,t,n)=>{if(this.loggerService.log("logViewService findByFilter",{filterData:e,limit:t,offset:n}),CC_ENABLE_MOCK)return await this.logMockService.findByFilter(e,t,n);const{data:r,error:o}=await Mf("/api/v1/view/log_filter",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),filterData:e,limit:t,offset:n})});if(o)throw new Error(o);return r}}const TTL_TIMEOUT$2=45e3;class StatusViewService{loggerService=YS(TYPES.loggerService);statusMockService=YS(TYPES.statusMockService);getStatusList=async()=>{if(this.loggerService.log("statusViewService getStatusList"),CC_ENABLE_MOCK)return await this.statusMockService.getStatusList();const{data:e,error:t}=await Mf("/api/v1/view/status_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getStatusMap=async()=>{if(this.loggerService.log("statusViewService getStatusMap"),CC_ENABLE_MOCK)return await this.statusMockService.getStatusMap();return(await this.getStatusList()).reduce((e,t)=>({...e,[t.id]:t}),{})};getStatusOne=async e=>{if(this.loggerService.log("statusViewService getStatusOne",{id:e}),CC_ENABLE_MOCK)return await this.statusMockService.getStatusOne(e);const{data:t,error:n}=await Mf(`/api/v1/view/status_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};getStatusInfo=CC(async()=>{if(this.loggerService.log("statusViewService getStatusInfo"),CC_ENABLE_MOCK)return await this.statusMockService.getStatusInfo();const{data:e,error:t}=await Mf("/api/v1/view/status_info",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e},{timeout:TTL_TIMEOUT$2})}class MarkdownViewService{loggerService=YS(TYPES.loggerService);markdownMockService=YS(TYPES.markdownMockService);getStrategyData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getStrategyData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getStrategyData(e,t,n,r);const{data:i,error:a}=await Mf("/api/v1/markdown_view/strategy_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getStrategyReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getStrategyReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getStrategyReport(e,t,n,r);const{data:i,error:a}=await Mf("/api/v1/markdown_view/strategy_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getBacktestData=async(e,t,n,r)=>{if(this.loggerService.log("markdownViewService getBacktestData",{symbol:e,strategyName:t,exchangeName:n,frameName:r}),CC_ENABLE_MOCK)return await this.markdownMockService.getBacktestData(e,t,n,r);const{data:o,error:i}=await Mf("/api/v1/markdown_view/backtest_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r})});if(i)throw new Error(i);return o};getBacktestReport=async(e,t,n,r)=>{if(this.loggerService.log("markdownViewService getBacktestReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r}),CC_ENABLE_MOCK)return await this.markdownMockService.getBacktestReport(e,t,n,r);const{data:o,error:i}=await Mf("/api/v1/markdown_view/backtest_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r})});if(i)throw new Error(i);return o};getLiveData=async(e,t,n)=>{if(this.loggerService.log("markdownViewService getLiveData",{symbol:e,strategyName:t,exchangeName:n}),CC_ENABLE_MOCK)return await this.markdownMockService.getLiveData(e,t,n);const{data:r,error:o}=await Mf("/api/v1/markdown_view/live_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n})});if(o)throw new Error(o);return r};getLiveReport=async(e,t,n)=>{if(this.loggerService.log("markdownViewService getLiveReport",{symbol:e,strategyName:t,exchangeName:n}),CC_ENABLE_MOCK)return await this.markdownMockService.getLiveReport(e,t,n);const{data:r,error:o}=await Mf("/api/v1/markdown_view/live_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n})});if(o)throw new Error(o);return r};getBreakevenData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getBreakevenData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getBreakevenData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/breakeven_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getBreakevenReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getBreakevenReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getBreakevenReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/breakeven_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getRiskData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getRiskData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getRiskData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/risk_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getRiskReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getRiskReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getRiskReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/risk_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPartialData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getPartialData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getPartialData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/partial_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPartialReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getPartialReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getPartialReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/partial_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getHighestProfitData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getHighestProfitData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getHighestProfitData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/highest_profit_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getHighestProfitReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getHighestProfitReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getHighestProfitReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/highest_profit_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getMaxDrawdownData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getMaxDrawdownData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getMaxDrawdownData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/max_drawdown_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getMaxDrawdownReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getMaxDrawdownReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getMaxDrawdownReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/max_drawdown_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getScheduleData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getScheduleData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getScheduleData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/schedule_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getScheduleReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getScheduleReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getScheduleReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/schedule_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPerformanceData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getPerformanceData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getPerformanceData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/performance_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPerformanceReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getPerformanceReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getPerformanceReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/performance_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getSyncData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getSyncData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getSyncData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/sync_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getSyncReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getSyncReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getSyncReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/sync_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getHeatData=async(e,t,n,r=!1)=>{if(this.loggerService.log("markdownViewService getHeatData",{strategyName:e,exchangeName:t,frameName:n,backtest:r}),CC_ENABLE_MOCK)return await this.markdownMockService.getHeatData(e,t,n,r);const{data:o,error:i}=await Mf("/api/v1/markdown_view/heat_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),strategyName:e,exchangeName:t,frameName:n,backtest:r})});if(i)throw new Error(i);return o};getHeatReport=async(e,t,n,r=!1)=>{if(this.loggerService.log("markdownViewService getHeatReport",{strategyName:e,exchangeName:t,frameName:n,backtest:r}),CC_ENABLE_MOCK)return await this.markdownMockService.getHeatReport(e,t,n,r);const{data:o,error:i}=await Mf("/api/v1/markdown_view/heat_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),strategyName:e,exchangeName:t,frameName:n,backtest:r})});if(i)throw new Error(i);return o};getWalkerData=async(e,t)=>{if(this.loggerService.log("markdownViewService getWalkerData",{symbol:e,walkerName:t}),CC_ENABLE_MOCK)return await this.markdownMockService.getWalkerData(e,t);const{data:n,error:r}=await Mf("/api/v1/markdown_view/walker_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,walkerName:t})});if(r)throw new Error(r);return n};getWalkerReport=async(e,t)=>{if(this.loggerService.log("markdownViewService getWalkerReport",{symbol:e,walkerName:t}),CC_ENABLE_MOCK)return await this.markdownMockService.getWalkerReport(e,t);const{data:n,error:r}=await Mf("/api/v1/markdown_view/walker_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,walkerName:t})});if(r)throw new Error(r);return n}}const TTL_TIMEOUT$1=45e3;class ExplorerViewService{loggerService=YS(TYPES.loggerService);explorerMockService=YS(TYPES.explorerMockService);explorerHelperService=YS(TYPES.explorerHelperService);getFolderTree=CC(async()=>{if(this.loggerService.log("explorerViewService getFolderTreeRaw"),CC_ENABLE_MOCK)return await this.explorerMockService.getFolderTree();const{data:e,error:t}=await Mf("/api/v1/explorer_view/tree",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e},{timeout:TTL_TIMEOUT$1});getFolderMap=CC(async()=>{if(this.loggerService.log("explorerViewService getFolderMap"),CC_ENABLE_MOCK)return await this.explorerMockService.getFolderMap();const e={},t=await this.getFolderTree();for(const n of this.explorerHelperService.deepFlat(t))e[n.id]=n;return e},{timeout:TTL_TIMEOUT$1});getFileContent=async e=>{if(this.loggerService.log("explorerViewService getFileContent",{path:e}),CC_ENABLE_MOCK)return await this.explorerMockService.getFileContent(e);const{data:t,error:n}=await Mf("/api/v1/explorer_view/node",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),path:e})});if(n)throw new Error(n);return t};getFileInfo=async e=>{if(this.loggerService.log("explorerViewService getFileInfo",{id:e}),CC_ENABLE_MOCK)return await this.explorerMockService.getFileInfo(e);const t=(await this.getFolderMap())[e];if(!t)throw new Error(`explorerViewService getFileInfo file not found id=${e}`);if("file"!==t.type)throw new Error(`explorerViewService getFileInfo not a file id=${e} type=${t.type}`);return t};clear=()=>{this.loggerService.log("explorerViewService clear"),CC_ENABLE_MOCK&&this.explorerMockService.clear(),this.getFolderTree.clear()}}class SignalViewService{loggerService=YS(TYPES.loggerService);signalMockService=YS(TYPES.signalMockService);getLastUpdateTimestamp=async e=>{if(this.loggerService.log("signalViewService getLastUpdateTimestamp",{signalId:e}),CC_ENABLE_MOCK)return await this.signalMockService.getLastUpdateTimestamp(e);const{data:t,error:n}=await Mf(`/api/v1/view/signal_last_update/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};getPendingSignal=async e=>{if(this.loggerService.log("signalViewService getPendingSignal",{symbol:e}),CC_ENABLE_MOCK)return await this.signalMockService.getPendingSignal(e);const{data:t,error:n}=await Mf("/api/v1/view/signal_pending",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e})});if(n)throw new Error(n);return t}}const TTL_TIMEOUT=45e3;class HeatViewService{loggerService=YS(TYPES.loggerService);heatMockService=YS(TYPES.heatMockService);getStrategyHeatData=CC(async()=>{if(this.loggerService.log("heatViewService getStrategyHeatData"),CC_ENABLE_MOCK)return await this.heatMockService.getStrategyHeatData();const{data:e,error:t}=await Mf("/api/v1/view/heat_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e},{timeout:TTL_TIMEOUT});getStrategyHeatReport=CC(async()=>{if(this.loggerService.log("heatViewService getStrategyHeatReport"),CC_ENABLE_MOCK)return await this.heatMockService.getStrategyHeatReport();const{data:e,error:t}=await Mf("/api/v1/view/heat_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e},{timeout:TTL_TIMEOUT})}class SymbolGlobalService{loggerService=YS(TYPES.loggerService);getSymbolList=async()=>{this.loggerService.log("symbolGlobalService getSymbolList");const{data:e,error:t}=await Mf("/api/v1/dict/symbol/list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getSymbolMap=async()=>{this.loggerService.log("symbolGlobalService getSymbolMap");const{data:e,error:t}=await Mf("/api/v1/dict/symbol/map",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getSymbol=async e=>{this.loggerService.log("symbolGlobalService getSymbol",{symbol:e});const{data:t,error:n}=await Mf("/api/v1/dict/symbol/one",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),id:e})});if(n)throw new Error(n);return t}}class PriceGlobalService{loggerService=YS(TYPES.loggerService);getSignalPendingPrice=async(e,t,n,r,o)=>{this.loggerService.log("priceGlobalService getSignalPendingPrice",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/global/signal_pending_price",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i}}class BacktestGlobalService{loggerService=YS(TYPES.loggerService);list=async()=>{this.loggerService.log("backtestGlobalService list");const{data:e,error:t}=await Mf("/api/v1/global/backtest_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e}}class LiveGlobalService{loggerService=YS(TYPES.loggerService);list=async()=>{this.loggerService.log("liveGlobalService list");const{data:e,error:t}=await Mf("/api/v1/global/live_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e}}var html2pdf$1={exports:{}};const scriptRel="modulepreload",assetsURL=function(e){return"/"+e},seen={},__vitePreload=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const e=document.querySelector("meta[property=csp-nonce]"),n=(null==e?void 0:e.nonce)||(null==e?void 0:e.getAttribute("nonce"));r=Promise.allSettled(t.map(e=>{if((e=assetsURL(e))in seen)return;seen[e]=!0;const t=e.endsWith(".css"),r=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${r}`))return;const o=document.createElement("link");return o.rel=t?"stylesheet":scriptRel,t||(o.as="script"),o.crossOrigin="",o.href=e,n&&o.setAttribute("nonce",n),document.head.appendChild(o),t?new Promise((t,n)=>{o.addEventListener("load",t),o.addEventListener("error",()=>n(new Error(`Unable to preload CSS for ${e}`)))}):void 0}))}function o(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(const e of t||[])"rejected"===e.status&&o(e.reason);return e().catch(o)})};function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var u8=Uint8Array,u16=Uint16Array,i32=Int32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(e,t){for(var n=new u16(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new i32(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return{b:n,r:o}},_a$1=freb(fleb,2),fl=_a$1.b,revfl=_a$1.r;fl[28]=258,revfl[258]=28;for(var _b=freb(fdeb,0),revfd=_b.r,rev=new u16(32768),i$3=0;i$3<32768;++i$3){var x$4=(43690&i$3)>>1|(21845&i$3)<<1;x$4=(52428&x$4)>>2|(13107&x$4)<<2,x$4=(61680&x$4)>>4|(3855&x$4)<<4,rev[i$3]=((65280&x$4)>>8|(255&x$4)<<8)>>1}for(var hMap=function(e,t,n){for(var r=e.length,o=0,i=new u16(t);o<r;++o)e[o]&&++i[e[o]-1];var a,s=new u16(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(n){a=new u16(1<<t);var l=15-t;for(o=0;o<r;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],d=s[e[o]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)a[rev[d]>>l]=c}else for(a=new u16(r),o=0;o<r;++o)e[o]&&(a[o]=rev[s[e[o]-1]++]>>15-e[o]);return a},flt=new u8(288),i$3=0;i$3<144;++i$3)flt[i$3]=8;for(var i$3=144;i$3<256;++i$3)flt[i$3]=9;for(var i$3=256;i$3<280;++i$3)flt[i$3]=7;for(var i$3=280;i$3<288;++i$3)flt[i$3]=8;for(var fdt=new u8(32),i$3=0;i$3<32;++i$3)fdt[i$3]=5;var flm=hMap(flt,9,0),fdm=hMap(fdt,5,0),shft=function(e){return(e+7)/8|0},slc=function(e,t,n){return(null==n||n>e.length)&&(n=e.length),new u8(e.subarray(t,n))},wbits=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},wbits16=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},hTree=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,i=n.slice();if(!o)return{t:et$2,l:0};if(1==o){var a=new u8(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=o-1;)s=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:s.f+l.f,l:s,r:l};var p=i[0].s;for(r=1;r<o;++r)i[r].s>p&&(p=i[r].s);var h=new u16(p+1),f=ln$1(n[u-1],h,0);if(f>t){r=0;var A=0,m=f-t,g=1<<m;for(i.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});r<o;++r){var y=i[r].s;if(!(h[y]>t))break;A+=g-(1<<f-h[y]),h[y]=t}for(A>>=m;A>0;){var v=i[r].s;h[v]<t?A-=1<<t-h[v]++-1:++r}for(;r>=0&&A;--r){var b=i[r].s;h[b]==t&&(--h[b],++A)}f=t}return{t:new u8(h),l:f}},ln$1=function(e,t,n){return-1==e.s?Math.max(ln$1(e.l,t,n+1),ln$1(e.r,t,n+1)):t[e.s]=n},lc=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new u16(++t),r=0,o=e[0],i=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return{c:n.subarray(0,r),n:t}},clen=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},wfblk=function(e,t,n){var r=n.length,o=shft(t+2);e[o]=255&r,e[o+1]=r>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<r;++i)e[o+i+4]=n[i];return 8*(o+4+r)},wblk=function(e,t,n,r,o,i,a,s,l,c,u){wbits(t,u++,n),++o[256];for(var d=hTree(o,15),p=d.t,h=d.l,f=hTree(i,15),A=f.t,m=f.l,g=lc(p),y=g.c,v=g.n,b=lc(A),x=b.c,w=b.n,C=new u16(19),$=0;$<y.length;++$)++C[31&y[$]];for($=0;$<x.length;++$)++C[31&x[$]];for(var _=hTree(C,7),S=_.t,E=_.l,k=19;k>4&&!S[clim[k-1]];--k);var B,P,T,I,L=c+5<<3,M=clen(o,flt)+clen(i,fdt)+a,D=clen(o,p)+clen(i,A)+a+14+3*k+clen(C,S)+2*C[16]+3*C[17]+7*C[18];if(l>=0&&L<=M&&L<=D)return wfblk(t,u,e.subarray(l,l+c));if(wbits(t,u,1+(D<M)),u+=2,D<M){B=hMap(p,h,0),P=p,T=hMap(A,m,0),I=A;var N=hMap(S,E,0);wbits(t,u,v-257),wbits(t,u+5,w-1),wbits(t,u+10,k-4),u+=14;for($=0;$<k;++$)wbits(t,u+3*$,S[clim[$]]);u+=3*k;for(var F=[y,x],O=0;O<2;++O){var R=F[O];for($=0;$<R.length;++$){var U=31&R[$];wbits(t,u,N[U]),u+=S[U],U>15&&(wbits(t,u,R[$]>>5&127),u+=R[$]>>12)}}}else B=flm,P=flt,T=fdm,I=fdt;for($=0;$<s;++$){var j=r[$];if(j>255){wbits16(t,u,B[(U=j>>18&31)+257]),u+=P[U+257],U>7&&(wbits(t,u,j>>23&31),u+=fleb[U]);var H=31&j;wbits16(t,u,T[H]),u+=I[H],H>3&&(wbits16(t,u,j>>5&8191),u+=fdeb[H])}else wbits16(t,u,B[j]),u+=P[j]}return wbits16(t,u,B[256]),u+P[256]},deo=new i32([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),et$2=new u8(0),dflt=function(e,t,n,r,o,i){var a=i.z||e.length,s=new u8(r+a+5*(1+Math.ceil(a/7e3))+o),l=s.subarray(r,s.length-o),c=i.l,u=7&(i.r||0);if(t){u&&(l[0]=i.r>>3);for(var d=deo[t-1],p=d>>13,h=8191&d,f=(1<<n)-1,A=i.p||new u16(32768),m=i.h||new u16(f+1),g=Math.ceil(n/3),y=2*g,v=function(t){return(e[t]^e[t+1]<<g^e[t+2]<<y)&f},b=new i32(25e3),x=new u16(288),w=new u16(32),C=0,$=0,_=i.i||0,S=0,E=i.w||0,k=0;_+2<a;++_){var B=v(_),P=32767&_,T=m[B];if(A[P]=T,m[B]=P,E<=_){var I=a-_;if((C>7e3||S>24576)&&(I>423||!c)){u=wblk(e,l,0,b,x,w,$,S,k,_-k,u),S=C=$=0,k=_;for(var L=0;L<286;++L)x[L]=0;for(L=0;L<30;++L)w[L]=0}var M=2,D=0,N=h,F=P-T&32767;if(I>2&&B==v(_-F))for(var O=Math.min(p,I)-1,R=Math.min(32767,_),U=Math.min(258,I);F<=R&&--N&&P!=T;){if(e[_+M]==e[_+M-F]){for(var j=0;j<U&&e[_+j]==e[_+j-F];++j);if(j>M){if(M=j,D=F,j>O)break;var H=Math.min(F,j-2),Q=0;for(L=0;L<H;++L){var z=_-F+L&32767,V=z-A[z]&32767;V>Q&&(Q=V,T=z)}}}F+=(P=T)-(T=A[P])&32767}if(D){b[S++]=268435456|revfl[M]<<18|revfd[D];var W=31&revfl[M],Y=31&revfd[D];$+=fleb[W]+fdeb[Y],++x[257+W],++w[Y],E=_+M,++C}else b[S++]=e[_],++x[e[_]]}}for(_=Math.max(_,E);_<a;++_)b[S++]=e[_],++x[e[_]];u=wblk(e,l,c,b,x,w,$,S,k,_-k,u),c||(i.r=7&u|l[u/8|0]<<3,u-=7,i.h=m,i.p=A,i.i=_,i.w=E)}else{for(_=i.w||0;_<a+c;_+=65535){var G=_+65535;G>=a&&(l[u/8|0]=c,G=a),u=wfblk(l,u+1,e.subarray(_,G))}i.i=a}return slc(s,0,r+shft(u)+o)},adler=function(){var e=1,t=0;return{p:function(n){for(var r=e,o=t,i=0|n.length,a=0;a!=i;){for(var s=Math.min(a+2655,i);a<s;++a)o+=r+=n[a];r=(65535&r)+15*(r>>16),o=(65535&o)+15*(o>>16)}e=r,t=o},d:function(){return(255&(e%=65521))<<24|(65280&e)<<8|(255&(t%=65521))<<8|t>>8}}},dopt=function(e,t,n,r,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),a=new u8(i.length+e.length);a.set(i),a.set(e,i.length),e=a,o.w=i.length}return dflt(e,null==t.level?6:t.level,null==t.mem?o.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,n,r,o)},wbytes=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},zlh=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var o=adler();o.p(t.dictionary),wbytes(e,2,o.d())}};function zlibSync(e,t){t||(t={});var n=adler();n.p(e);var r=dopt(e,t,t.dictionary?6:2,4);return zlh(r,t),wbytes(r,r.length-4,n.d()),r}var td="undefined"!=typeof TextDecoder&&new TextDecoder,tds=0;try{td.decode(et$2,{stream:!0}),tds=1}catch(e2){}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function decode$5(e,t="utf8"){return new TextDecoder(t).decode(e)}const encoder=new TextEncoder;function encode$4(e){return encoder.encode(e)}const defaultByteLength=8192,hostBigEndian=(()=>{const e=new Uint8Array(4);return!((new Uint32Array(e.buffer)[0]=1)&e[0])})(),typedArrays={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class IOBuffer{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(e=defaultByteLength,t={}){let n=!1;"number"==typeof e?e=new ArrayBuffer(e):(n=!0,this.lastWrittenByte=e.byteLength);const r=t.offset?t.offset>>>0:0,o=e.byteLength-r;let i=r;(ArrayBuffer.isView(e)||e instanceof IOBuffer)&&(e.byteLength!==e.buffer.byteLength&&(i=e.byteOffset+r),e=e.buffer),this.lastWrittenByte=n?o:0,this.buffer=e,this.length=o,this.byteLength=o,this.byteOffset=i,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,i,o),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(void 0===e)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const t=2*(this.offset+e),n=new Uint8Array(t);n.set(new Uint8Array(this.buffer)),this.buffer=n.buffer,this.length=t,this.byteLength=t,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,t){const n=typedArrays[t].BYTES_PER_ELEMENT*e,r=this.byteOffset+this.offset,o=this.buffer.slice(r,r+n);if(this.littleEndian===hostBigEndian&&"uint8"!==t&&"int8"!==t){const e=new Uint8Array(this.buffer.slice(r,r+n));e.reverse();const o=new typedArrays[t](e.buffer);return this.offset+=n,o.reverse(),o}const i=new typedArrays[t](o);return this.offset+=n,i}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let t="";for(let n=0;n<e;n++)t+=this.readChar();return t}readUtf8(e=1){return decode$5(this.readBytes(e))}decodeText(e=1,t="utf8"){return decode$5(this.readBytes(e),t)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let t=0;t<e.length;t++)this.writeUint8(e.charCodeAt(t));return this}writeUtf8(e){return this.writeBytes(encode$4(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function zero$1(e){let t=e.length;for(;--t>=0;)e[t]=0}const MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,DIST_CODE_LEN=512,static_ltree=new Array(2*(L_CODES$1+2));zero$1(static_ltree);const static_dtree=new Array(2*D_CODES$1);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);const adler32=(e,t,n,r)=>{let o=65535&e,i=e>>>16&65535,a=0;for(;0!==n;){a=n>2e3?2e3:n,n-=a;do{o=o+t[r++]|0,i=i+o|0}while(--a);o%=65521,i%=65521}return o|i<<16};var adler32_1=adler32;const makeTable=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t},crcTable$1=new Uint32Array(makeTable()),crc32=(e,t,n,r)=>{const o=crcTable$1,i=r+n;e^=-1;for(let a=r;a<i;a++)e=e>>>8^o[255&(e^t[a])];return-1^e};var crc32_1=crc32,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},constants$2={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const _has=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var assign$3=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)_has(n,t)&&(e[t]=n[t])}}return e},flattenChunks=e=>{let t=0;for(let r=0,o=e.length;r<o;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,o=0,i=e.length;r<i;r++){let t=e[r];n.set(t,o),o+=t.length}return n},common={assign:assign$3,flattenChunks:flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(__){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let Wp=0;Wp<256;Wp++)_utf8len[Wp]=Wp>=252?6:Wp>=248?5:Wp>=240?4:Wp>=224?3:Wp>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,r,o,i,a=e.length,s=0;for(o=0;o<a;o++)n=e.charCodeAt(o),55296==(64512&n)&&o+1<a&&(r=e.charCodeAt(o+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),i=0,o=0;i<s;o++)n=e.charCodeAt(o),55296==(64512&n)&&o+1<a&&(r=e.charCodeAt(o+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),n<128?t[i++]=n:n<2048?(t[i++]=192|n>>>6,t[i++]=128|63&n):n<65536?(t[i++]=224|n>>>12,t[i++]=128|n>>>6&63,t[i++]=128|63&n):(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63,t[i++]=128|n>>>6&63,t[i++]=128|63&n);return t};const buf2binstring=(e,t)=>{if(t<65534&&e.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var buf2string=(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,o;const i=new Array(2*n);for(o=0,r=0;r<n;){let t=e[r++];if(t<128){i[o++]=t;continue}let a=_utf8len[t];if(a>4)i[o++]=65533,r+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&r<n;)t=t<<6|63&e[r++],a--;a>1?i[o++]=65533:t<65536?i[o++]=t:(t-=65536,i[o++]=55296|t>>10&1023,i[o++]=56320|1023&t)}}return buf2binstring(i,o)},utf8border=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+_utf8len[e[n]]>t?n:t},strings={string2buf:string2buf,buf2string:buf2string,utf8border:utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream;const BAD$1=16209,TYPE$1=16191;var inffast=function(e,t){let n,r,o,i,a,s,l,c,u,d,p,h,f,A,m,g,y,v,b,x,w,C,$,_;const S=e.state;n=e.next_in,$=e.input,r=n+(e.avail_in-5),o=e.next_out,_=e.output,i=o-(t-e.avail_out),a=o+(e.avail_out-257),s=S.dmax,l=S.wsize,c=S.whave,u=S.wnext,d=S.window,p=S.hold,h=S.bits,f=S.lencode,A=S.distcode,m=(1<<S.lenbits)-1,g=(1<<S.distbits)-1;e:do{h<15&&(p+=$[n++]<<h,h+=8,p+=$[n++]<<h,h+=8),y=f[p&m];t:for(;;){if(v=y>>>24,p>>>=v,h-=v,v=y>>>16&255,0===v)_[o++]=65535&y;else{if(!(16&v)){if(64&v){if(32&v){S.mode=TYPE$1;break e}e.msg="invalid literal/length code",S.mode=BAD$1;break e}y=f[(65535&y)+(p&(1<<v)-1)];continue t}for(b=65535&y,v&=15,v&&(h<v&&(p+=$[n++]<<h,h+=8),b+=p&(1<<v)-1,p>>>=v,h-=v),h<15&&(p+=$[n++]<<h,h+=8,p+=$[n++]<<h,h+=8),y=A[p&g];;){if(v=y>>>24,p>>>=v,h-=v,v=y>>>16&255,16&v){if(x=65535&y,v&=15,h<v&&(p+=$[n++]<<h,h+=8,h<v&&(p+=$[n++]<<h,h+=8)),x+=p&(1<<v)-1,x>s){e.msg="invalid distance too far back",S.mode=BAD$1;break e}if(p>>>=v,h-=v,v=o-i,x>v){if(v=x-v,v>c&&S.sane){e.msg="invalid distance too far back",S.mode=BAD$1;break e}if(w=0,C=d,0===u){if(w+=l-v,v<b){b-=v;do{_[o++]=d[w++]}while(--v);w=o-x,C=_}}else if(u<v){if(w+=l+u-v,v-=u,v<b){b-=v;do{_[o++]=d[w++]}while(--v);if(w=0,u<b){v=u,b-=v;do{_[o++]=d[w++]}while(--v);w=o-x,C=_}}}else if(w+=u-v,v<b){b-=v;do{_[o++]=d[w++]}while(--v);w=o-x,C=_}for(;b>2;)_[o++]=C[w++],_[o++]=C[w++],_[o++]=C[w++],b-=3;b&&(_[o++]=C[w++],b>1&&(_[o++]=C[w++]))}else{w=o-x;do{_[o++]=_[w++],_[o++]=_[w++],_[o++]=_[w++],b-=3}while(b>2);b&&(_[o++]=_[w++],b>1&&(_[o++]=_[w++]))}break}if(64&v){e.msg="invalid distance code",S.mode=BAD$1;break e}y=A[(65535&y)+(p&(1<<v)-1)]}}break}}while(n<r&&o<a);b=h>>3,n-=b,h-=b<<3,p&=(1<<h)-1,e.next_in=n,e.next_out=o,e.avail_in=n<r?r-n+5:5-(n-r),e.avail_out=o<a?a-o+257:257-(o-a),S.hold=p,S.bits=h};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),lext=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),dbase=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),dext=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),inflate_table=(e,t,n,r,o,i,a,s)=>{const l=s.bits;let c,u,d,p,h,f,A=0,m=0,g=0,y=0,v=0,b=0,x=0,w=0,C=0,$=0,_=null;const S=new Uint16Array(MAXBITS+1),E=new Uint16Array(MAXBITS+1);let k,B,P,T=null;for(A=0;A<=MAXBITS;A++)S[A]=0;for(m=0;m<r;m++)S[t[n+m]]++;for(v=l,y=MAXBITS;y>=1&&0===S[y];y--);if(v>y&&(v=y),0===y)return o[i++]=20971520,o[i++]=20971520,s.bits=1,0;for(g=1;g<y&&0===S[g];g++);for(v<g&&(v=g),w=1,A=1;A<=MAXBITS;A++)if(w<<=1,w-=S[A],w<0)return-1;if(w>0&&(e===CODES$1||1!==y))return-1;for(E[1]=0,A=1;A<MAXBITS;A++)E[A+1]=E[A]+S[A];for(m=0;m<r;m++)0!==t[n+m]&&(a[E[t[n+m]]++]=m);if(e===CODES$1?(_=T=a,f=20):e===LENS$1?(_=lbase,T=lext,f=257):(_=dbase,T=dext,f=0),$=0,m=0,A=g,h=i,b=v,x=0,d=-1,C=1<<v,p=C-1,e===LENS$1&&C>ENOUGH_LENS$1||e===DISTS$1&&C>ENOUGH_DISTS$1)return 1;for(;;){k=A-x,a[m]+1<f?(B=0,P=a[m]):a[m]>=f?(B=T[a[m]-f],P=_[a[m]-f]):(B=96,P=0),c=1<<A-x,u=1<<b,g=u;do{u-=c,o[h+($>>x)+u]=k<<24|B<<16|P}while(0!==u);for(c=1<<A-1;$&c;)c>>=1;if(0!==c?($&=c-1,$+=c):$=0,m++,0===--S[A]){if(A===y)break;A=t[n+a[m]]}if(A>v&&($&p)!==d){for(0===x&&(x=v),h+=g,b=A-x,w=1<<b;b+x<y&&(w-=S[b+x],!(w<=0));)b++,w<<=1;if(C+=1<<b,e===LENS$1&&C>ENOUGH_LENS$1||e===DISTS$1&&C>ENOUGH_DISTS$1)return 1;d=$&p,o[d]=v<<24|b<<16|h-i}}return 0!==$&&(o[h+$]=A-x<<24|64<<16),s.bits=v,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK:Z_BLOCK,Z_TREES:Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR:Z_BUF_ERROR,Z_DEFLATED:Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function InflateState(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const inflateStateCheck=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<HEAD||t.mode>SYNC?1:0},inflateResetKeep=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=HEAD,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(ENOUGH_LENS),t.distcode=t.distdyn=new Int32Array(ENOUGH_DISTS),t.sane=1,t.back=-1,Z_OK$1},inflateReset=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,inflateResetKeep(e)},inflateReset2=(e,t)=>{let n;if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const r=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Z_STREAM_ERROR$1:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,inflateReset(e))},inflateInit2=(e,t)=>{if(!e)return Z_STREAM_ERROR$1;const n=new InflateState;e.state=n,n.strm=e,n.window=null,n.mode=HEAD;const r=inflateReset2(e,t);return r!==Z_OK$1&&(e.state=null),r},inflateInit=e=>inflateInit2(e,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=e=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(inftrees(LENS,e.lens,0,288,lenfix,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;inftrees(DISTS,e.lens,0,32,distfix,0,e.work,{bits:5}),virgin=!1}e.lencode=lenfix,e.lenbits=9,e.distcode=distfix,e.distbits=5},updatewindow=(e,t,n,r)=>{let o;const i=e.state;return null===i.window&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),r>=i.wsize?(i.window.set(t.subarray(n-i.wsize,n),0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>r&&(o=r),i.window.set(t.subarray(n-r,n-r+o),i.wnext),(r-=o)?(i.window.set(t.subarray(n-r,n),0),i.wnext=r,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=o))),0},inflate$2=(e,t)=>{let n,r,o,i,a,s,l,c,u,d,p,h,f,A,m,g,y,v,b,x,w,C,$=0;const _=new Uint8Array(4);let S,E;const k=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(e)||!e.output||!e.input&&0!==e.avail_in)return Z_STREAM_ERROR$1;n=e.state,n.mode===TYPE&&(n.mode=TYPEDO),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,r=e.input,s=e.avail_in,c=n.hold,u=n.bits,d=s,p=l,C=Z_OK$1;e:for(;;)switch(n.mode){case HEAD:if(0===n.wrap){n.mode=TYPEDO;break}for(;u<16;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(2&n.wrap&&35615===c){0===n.wbits&&(n.wbits=15),n.check=0,_[0]=255&c,_[1]=c>>>8&255,n.check=crc32_1(n.check,_,2,0),c=0,u=0,n.mode=FLAGS;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=BAD;break}if((15&c)!==Z_DEFLATED){e.msg="unknown compression method",n.mode=BAD;break}if(c>>>=4,u-=4,w=8+(15&c),0===n.wbits&&(n.wbits=w),w>15||w>n.wbits){e.msg="invalid window size",n.mode=BAD;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&c?DICTID:TYPE,c=0,u=0;break;case FLAGS:for(;u<16;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(n.flags=c,(255&n.flags)!==Z_DEFLATED){e.msg="unknown compression method",n.mode=BAD;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=BAD;break}n.head&&(n.head.text=c>>8&1),512&n.flags&&4&n.wrap&&(_[0]=255&c,_[1]=c>>>8&255,n.check=crc32_1(n.check,_,2,0)),c=0,u=0,n.mode=TIME;case TIME:for(;u<32;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}n.head&&(n.head.time=c),512&n.flags&&4&n.wrap&&(_[0]=255&c,_[1]=c>>>8&255,_[2]=c>>>16&255,_[3]=c>>>24&255,n.check=crc32_1(n.check,_,4,0)),c=0,u=0,n.mode=OS;case OS:for(;u<16;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&4&n.wrap&&(_[0]=255&c,_[1]=c>>>8&255,n.check=crc32_1(n.check,_,2,0)),c=0,u=0,n.mode=EXLEN;case EXLEN:if(1024&n.flags){for(;u<16;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&4&n.wrap&&(_[0]=255&c,_[1]=c>>>8&255,n.check=crc32_1(n.check,_,2,0)),c=0,u=0}else n.head&&(n.head.extra=null);n.mode=EXTRA;case EXTRA:if(1024&n.flags&&(h=n.length,h>s&&(h=s),h&&(n.head&&(w=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(i,i+h),w)),512&n.flags&&4&n.wrap&&(n.check=crc32_1(n.check,r,h,i)),s-=h,i+=h,n.length-=h),n.length))break e;n.length=0,n.mode=NAME;case NAME:if(2048&n.flags){if(0===s)break e;h=0;do{w=r[i+h++],n.head&&w&&n.length<65536&&(n.head.name+=String.fromCharCode(w))}while(w&&h<s);if(512&n.flags&&4&n.wrap&&(n.check=crc32_1(n.check,r,h,i)),s-=h,i+=h,w)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=COMMENT;case COMMENT:if(4096&n.flags){if(0===s)break e;h=0;do{w=r[i+h++],n.head&&w&&n.length<65536&&(n.head.comment+=String.fromCharCode(w))}while(w&&h<s);if(512&n.flags&&4&n.wrap&&(n.check=crc32_1(n.check,r,h,i)),s-=h,i+=h,w)break e}else n.head&&(n.head.comment=null);n.mode=HCRC;case HCRC:if(512&n.flags){for(;u<16;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(4&n.wrap&&c!==(65535&n.check)){e.msg="header crc mismatch",n.mode=BAD;break}c=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=TYPE;break;case DICTID:for(;u<32;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}e.adler=n.check=zswap32(c),c=0,u=0,n.mode=DICT;case DICT:if(0===n.havedict)return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,Z_NEED_DICT$1;e.adler=n.check=1,n.mode=TYPE;case TYPE:if(t===Z_BLOCK||t===Z_TREES)break e;case TYPEDO:if(n.last){c>>>=7&u,u-=7&u,n.mode=CHECK;break}for(;u<3;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}switch(n.last=1&c,c>>>=1,u-=1,3&c){case 0:n.mode=STORED;break;case 1:if(fixedtables(n),n.mode=LEN_,t===Z_TREES){c>>>=2,u-=2;break e}break;case 2:n.mode=TABLE;break;case 3:e.msg="invalid block type",n.mode=BAD}c>>>=2,u-=2;break;case STORED:for(c>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=BAD;break}if(n.length=65535&c,c=0,u=0,n.mode=COPY_,t===Z_TREES)break e;case COPY_:n.mode=COPY;case COPY:if(h=n.length,h){if(h>s&&(h=s),h>l&&(h=l),0===h)break e;o.set(r.subarray(i,i+h),a),s-=h,i+=h,l-=h,a+=h,n.length-=h;break}n.mode=TYPE;break;case TABLE:for(;u<14;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(n.nlen=257+(31&c),c>>>=5,u-=5,n.ndist=1+(31&c),c>>>=5,u-=5,n.ncode=4+(15&c),c>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=BAD;break}n.have=0,n.mode=LENLENS;case LENLENS:for(;n.have<n.ncode;){for(;u<3;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}n.lens[k[n.have++]]=7&c,c>>>=3,u-=3}for(;n.have<19;)n.lens[k[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,S={bits:n.lenbits},C=inftrees(CODES,n.lens,0,19,n.lencode,0,n.work,S),n.lenbits=S.bits,C){e.msg="invalid code lengths set",n.mode=BAD;break}n.have=0,n.mode=CODELENS;case CODELENS:for(;n.have<n.nlen+n.ndist;){for(;$=n.lencode[c&(1<<n.lenbits)-1],m=$>>>24,g=$>>>16&255,y=65535&$,!(m<=u);){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(y<16)c>>>=m,u-=m,n.lens[n.have++]=y;else{if(16===y){for(E=m+2;u<E;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(c>>>=m,u-=m,0===n.have){e.msg="invalid bit length repeat",n.mode=BAD;break}w=n.lens[n.have-1],h=3+(3&c),c>>>=2,u-=2}else if(17===y){for(E=m+3;u<E;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}c>>>=m,u-=m,w=0,h=3+(7&c),c>>>=3,u-=3}else{for(E=m+7;u<E;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}c>>>=m,u-=m,w=0,h=11+(127&c),c>>>=7,u-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=BAD;break}for(;h--;)n.lens[n.have++]=w}}if(n.mode===BAD)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=BAD;break}if(n.lenbits=9,S={bits:n.lenbits},C=inftrees(LENS,n.lens,0,n.nlen,n.lencode,0,n.work,S),n.lenbits=S.bits,C){e.msg="invalid literal/lengths set",n.mode=BAD;break}if(n.distbits=6,n.distcode=n.distdyn,S={bits:n.distbits},C=inftrees(DISTS,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,S),n.distbits=S.bits,C){e.msg="invalid distances set",n.mode=BAD;break}if(n.mode=LEN_,t===Z_TREES)break e;case LEN_:n.mode=LEN;case LEN:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,inffast(e,p),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,r=e.input,s=e.avail_in,c=n.hold,u=n.bits,n.mode===TYPE&&(n.back=-1);break}for(n.back=0;$=n.lencode[c&(1<<n.lenbits)-1],m=$>>>24,g=$>>>16&255,y=65535&$,!(m<=u);){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(g&&!(240&g)){for(v=m,b=g,x=y;$=n.lencode[x+((c&(1<<v+b)-1)>>v)],m=$>>>24,g=$>>>16&255,y=65535&$,!(v+m<=u);){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}c>>>=v,u-=v,n.back+=v}if(c>>>=m,u-=m,n.back+=m,n.length=y,0===g){n.mode=LIT;break}if(32&g){n.back=-1,n.mode=TYPE;break}if(64&g){e.msg="invalid literal/length code",n.mode=BAD;break}n.extra=15&g,n.mode=LENEXT;case LENEXT:if(n.extra){for(E=n.extra;u<E;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=DIST;case DIST:for(;$=n.distcode[c&(1<<n.distbits)-1],m=$>>>24,g=$>>>16&255,y=65535&$,!(m<=u);){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(!(240&g)){for(v=m,b=g,x=y;$=n.distcode[x+((c&(1<<v+b)-1)>>v)],m=$>>>24,g=$>>>16&255,y=65535&$,!(v+m<=u);){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}c>>>=v,u-=v,n.back+=v}if(c>>>=m,u-=m,n.back+=m,64&g){e.msg="invalid distance code",n.mode=BAD;break}n.offset=y,n.extra=15&g,n.mode=DISTEXT;case DISTEXT:if(n.extra){for(E=n.extra;u<E;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=BAD;break}n.mode=MATCH;case MATCH:if(0===l)break e;if(h=p-l,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=BAD;break}h>n.wnext?(h-=n.wnext,f=n.wsize-h):f=n.wnext-h,h>n.length&&(h=n.length),A=n.window}else A=o,f=a-n.offset,h=n.length;h>l&&(h=l),l-=h,n.length-=h;do{o[a++]=A[f++]}while(--h);0===n.length&&(n.mode=LEN);break;case LIT:if(0===l)break e;o[a++]=n.length,l--,n.mode=LEN;break;case CHECK:if(n.wrap){for(;u<32;){if(0===s)break e;s--,c|=r[i++]<<u,u+=8}if(p-=l,e.total_out+=p,n.total+=p,4&n.wrap&&p&&(e.adler=n.check=n.flags?crc32_1(n.check,o,p,a-p):adler32_1(n.check,o,p,a-p)),p=l,4&n.wrap&&(n.flags?c:zswap32(c))!==n.check){e.msg="incorrect data check",n.mode=BAD;break}c=0,u=0}n.mode=LENGTH;case LENGTH:if(n.wrap&&n.flags){for(;u<32;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(4&n.wrap&&c!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=BAD;break}c=0,u=0}n.mode=DONE;case DONE:C=Z_STREAM_END$1;break e;case BAD:C=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;default:return Z_STREAM_ERROR$1}return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,(n.wsize||p!==e.avail_out&&n.mode<BAD&&(n.mode<CHECK||t!==Z_FINISH$1))&&updatewindow(e,e.output,e.next_out,p-e.avail_out),d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,n.total+=p,4&n.wrap&&p&&(e.adler=n.check=n.flags?crc32_1(n.check,o,p,e.next_out-p):adler32_1(n.check,o,p,e.next_out-p)),e.data_type=n.bits+(n.last?64:0)+(n.mode===TYPE?128:0)+(n.mode===LEN_||n.mode===COPY_?256:0),(0===d&&0===p||t===Z_FINISH$1)&&C===Z_OK$1&&(C=Z_BUF_ERROR),C},inflateEnd=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;let t=e.state;return t.window&&(t.window=null),e.state=null,Z_OK$1},inflateGetHeader=(e,t)=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,Z_OK$1):Z_STREAM_ERROR$1},inflateSetDictionary=(e,t)=>{const n=t.length;let r,o,i;return inflateStateCheck(e)?Z_STREAM_ERROR$1:(r=e.state,0!==r.wrap&&r.mode!==DICT?Z_STREAM_ERROR$1:r.mode===DICT&&(o=1,o=adler32_1(o,t,n,0),o!==r.check)?Z_DATA_ERROR$1:(i=updatewindow(e,t,n,n),i?(r.mode=MEM,Z_MEM_ERROR$1):(r.havedict=1,Z_OK$1)))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo:inflateInfo};function GZheader(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH,Z_FINISH:Z_FINISH,Z_OK:Z_OK,Z_STREAM_END:Z_STREAM_END,Z_NEED_DICT:Z_NEED_DICT,Z_STREAM_ERROR:Z_STREAM_ERROR,Z_DATA_ERROR:Z_DATA_ERROR,Z_MEM_ERROR:Z_MEM_ERROR}=constants$2;function Inflate$1(e){this.options=common.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let n=inflate_1$2.inflateInit2(this.strm,t.windowBits);if(n!==Z_OK)throw new Error(messages[n]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=strings.string2buf(t.dictionary):"[object ArrayBuffer]"===toString.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=inflate_1$2.inflateSetDictionary(this.strm,t.dictionary),n!==Z_OK)))throw new Error(messages[n])}function inflate$1(e,t){const n=new Inflate$1(t);if(n.push(e),n.err)throw n.msg||messages[n.err];return n.result}Inflate$1.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,o=this.options.dictionary;let i,a,s;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Z_FINISH:Z_NO_FLUSH,"[object ArrayBuffer]"===toString.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),i=inflate_1$2.inflate(n,a),i===Z_NEED_DICT&&o&&(i=inflate_1$2.inflateSetDictionary(n,o),i===Z_OK?i=inflate_1$2.inflate(n,a):i===Z_DATA_ERROR&&(i=Z_NEED_DICT));n.avail_in>0&&i===Z_STREAM_END&&n.state.wrap>0&&0!==e[n.next_in];)inflate_1$2.inflateReset(n),i=inflate_1$2.inflate(n,a);switch(i){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(i),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(0===n.avail_out||i===Z_STREAM_END))if("string"===this.options.to){let e=strings.utf8border(n.output,n.next_out),t=n.next_out-e,o=strings.buf2string(n.output,e);n.next_out=t,n.avail_out=r-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(o)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(i!==Z_OK||0!==s){if(i===Z_STREAM_END)return i=inflate_1$2.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},Inflate$1.prototype.onData=function(e){this.chunks.push(e)},Inflate$1.prototype.onEnd=function(e){e===Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2};const{Inflate:Inflate,inflate:inflate}=inflate_1$1;var Inflate_1=Inflate,inflate_1=inflate;const crcTable=[];for(let Wp=0;Wp<256;Wp++){let e=Wp;for(let t=0;t<8;t++)1&e?e=3988292384^e>>>1:e>>>=1;crcTable[Wp]=e}const initialCrc=4294967295;function updateCrc(e,t,n){let r=e;for(let o=0;o<n;o++)r=crcTable[255&(r^t[o])]^r>>>8;return r}function crc(e,t){return(updateCrc(initialCrc,e,t)^initialCrc)>>>0}function checkCrc(e,t,n){const r=e.readUint32(),o=crc(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(o!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${o}`)}function unfilterNone(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}function unfilterSub(e,t,n,r){let o=0;for(;o<r;o++)t[o]=e[o];for(;o<n;o++)t[o]=e[o]+t[o-r]&255}function unfilterUp(e,t,n,r){let o=0;if(0===n.length)for(;o<r;o++)t[o]=e[o];else for(;o<r;o++)t[o]=e[o]+n[o]&255}function unfilterAverage(e,t,n,r,o){let i=0;if(0===n.length){for(;i<o;i++)t[i]=e[i];for(;i<r;i++)t[i]=e[i]+(t[i-o]>>1)&255}else{for(;i<o;i++)t[i]=e[i]+(n[i]>>1)&255;for(;i<r;i++)t[i]=e[i]+(t[i-o]+n[i]>>1)&255}}function unfilterPaeth(e,t,n,r,o){let i=0;if(0===n.length){for(;i<o;i++)t[i]=e[i];for(;i<r;i++)t[i]=e[i]+t[i-o]&255}else{for(;i<o;i++)t[i]=e[i]+n[i]&255;for(;i<r;i++)t[i]=e[i]+paethPredictor(t[i-o],n[i],n[i-o])&255}}function paethPredictor(e,t,n){const r=e+t-n,o=Math.abs(r-e),i=Math.abs(r-t),a=Math.abs(r-n);return o<=i&&o<=a?e:i<=a?t:n}function applyUnfilter(e,t,n,r,o,i){switch(e){case 0:unfilterNone(t,n,o);break;case 1:unfilterSub(t,n,o,i);break;case 2:unfilterUp(t,n,r,o);break;case 3:unfilterAverage(t,n,r,o,i);break;case 4:unfilterPaeth(t,n,r,o,i);break;default:throw new Error(`Unsupported filter: ${e}`)}}const uint16$1=new Uint16Array([255]),uint8$1=new Uint8Array(uint16$1.buffer),osIsLittleEndian$1=255===uint8$1[0];function decodeInterlaceAdam7(e){const{data:t,width:n,height:r,channels:o,depth:i}=e,a=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],s=Math.ceil(i/8)*o,l=new Uint8Array(r*n*s);let c=0;for(let u=0;u<7;u++){const e=a[u],o=Math.ceil((n-e.x)/e.xStep),i=Math.ceil((r-e.y)/e.yStep);if(o<=0||i<=0)continue;const d=o*s,p=new Uint8Array(d);for(let a=0;a<i;a++){const i=t[c++],u=t.subarray(c,c+d);c+=d;const h=new Uint8Array(d);applyUnfilter(i,u,h,p,d,s),p.set(h);for(let t=0;t<o;t++){const o=e.x+t*e.xStep,i=e.y+a*e.yStep;if(!(o>=n||i>=r))for(let e=0;e<s;e++)l[(i*n+o)*s+e]=h[t*s+e]}}}if(16===i){const e=new Uint16Array(l.buffer);if(osIsLittleEndian$1)for(let t=0;t<e.length;t++)e[t]=swap16$1(e[t]);return e}return l}function swap16$1(e){return(255&e)<<8|e>>8&255}const uint16=new Uint16Array([255]),uint8=new Uint8Array(uint16.buffer),osIsLittleEndian=255===uint8[0],empty$2=new Uint8Array(0);function decodeInterlaceNull(e){const{data:t,width:n,height:r,channels:o,depth:i}=e,a=Math.ceil(i/8)*o,s=Math.ceil(i/8*o*n),l=new Uint8Array(r*s);let c,u,d=empty$2,p=0;for(let h=0;h<r;h++){switch(c=t.subarray(p+1,p+1+s),u=l.subarray(h*s,(h+1)*s),t[p]){case 0:unfilterNone(c,u,s);break;case 1:unfilterSub(c,u,s,a);break;case 2:unfilterUp(c,u,d,s);break;case 3:unfilterAverage(c,u,d,s,a);break;case 4:unfilterPaeth(c,u,d,s,a);break;default:throw new Error(`Unsupported filter: ${t[p]}`)}d=u,p+=s+1}if(16===i){const e=new Uint16Array(l.buffer);if(osIsLittleEndian)for(let t=0;t<e.length;t++)e[t]=swap16(e[t]);return e}return l}function swap16(e){return(255&e)<<8|e>>8&255}const pngSignature=Uint8Array.of(137,80,78,71,13,10,26,10);function checkSignature(e){if(!hasPngSignature(e.readBytes(pngSignature.length)))throw new Error("wrong PNG signature")}function hasPngSignature(e){if(e.length<pngSignature.length)return!1;for(let t=0;t<pngSignature.length;t++)if(e[t]!==pngSignature[t])return!1;return!0}const textChunkName="tEXt",NULL=0,latin1Decoder=new TextDecoder("latin1");function validateKeyword(e){if(validateLatin1(e),0===e.length||e.length>79)throw new Error("keyword length must be between 1 and 79")}const latin1Regex=/^[\u0000-\u00FF]*$/;function validateLatin1(e){if(!latin1Regex.test(e))throw new Error("invalid latin1 text")}function decodetEXt(e,t,n){const r=readKeyword(t);e[r]=readLatin1(t,n-r.length-1)}function readKeyword(e){for(e.mark();e.readByte()!==NULL;);const t=e.offset;e.reset();const n=latin1Decoder.decode(e.readBytes(t-e.offset-1));return e.skip(1),validateKeyword(n),n}function readLatin1(e,t){return latin1Decoder.decode(e.readBytes(t))}const ColorType={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},CompressionMethod={UNKNOWN:-1,DEFLATE:0},FilterMethod={UNKNOWN:-1,ADAPTIVE:0},InterlaceMethod={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},DisposeOpType={NONE:0,BACKGROUND:1,PREVIOUS:2},BlendOpType={SOURCE:0,OVER:1};class PngDecoder extends IOBuffer{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(e,t={}){super(e);const{checkCrc:n=!1}=t;this._checkCrc=n,this._inflator=new Inflate_1,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=CompressionMethod.UNKNOWN,this._filterMethod=FilterMethod.UNKNOWN,this._interlaceMethod=InterlaceMethod.UNKNOWN,this._colorType=ColorType.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(checkSignature(this);!this._end;){const e=this.readUint32(),t=this.readChars(4);this.decodeChunk(e,t)}return this.decodeImage(),this._png}decodeApng(){for(checkSignature(this);!this._end;){const e=this.readUint32(),t=this.readChars(4);this.decodeApngChunk(e,t)}return this.decodeApngImage(),this._apng}decodeChunk(e,t){const n=this.offset;switch(t){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(e);break;case"IDAT":this.decodeIDAT(e);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(e);break;case"iCCP":this.decodeiCCP(e);break;case textChunkName:decodetEXt(this._png.text,this,e);break;case"pHYs":this.decodepHYs();break;default:this.skip(e)}if(this.offset-n!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?checkCrc(this,e+4,t):this.skip(4)}decodeApngChunk(e,t){const n=this.offset;switch("fdAT"!==t&&"IDAT"!==t&&this._writingDataChunks&&this.pushDataToFrame(),t){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(e);break;default:this.decodeChunk(e,t),this.offset=n+e}if(this.offset-n!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?checkCrc(this,e+4,t):this.skip(4)}decodeIHDR(){const e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=checkBitDepth(this.readUint8());const t=this.readUint8();let n;switch(this._colorType=t,t){case ColorType.GREYSCALE:n=1;break;case ColorType.TRUECOLOUR:n=3;break;case ColorType.INDEXED_COLOUR:n=1;break;case ColorType.GREYSCALE_ALPHA:n=2;break;case ColorType.TRUECOLOUR_ALPHA:n=4;break;case ColorType.UNKNOWN:default:throw new Error(`Unknown color type: ${t}`)}if(this._png.channels=n,this._compressionMethod=this.readUint8(),this._compressionMethod!==CompressionMethod.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const e={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(e)}decodePLTE(e){if(e%3!=0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);const t=e/3;this._hasPalette=!0;const n=[];this._palette=n;for(let r=0;r<t;r++)n.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(e){this._writingDataChunks=!0;const t=e,n=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,n,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodeFDAT(e){this._writingDataChunks=!0;let t=e,n=this.offset+this.byteOffset;if(n+=4,t-=4,this._inflator.push(new Uint8Array(this.buffer,n,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodetRNS(e){switch(this._colorType){case ColorType.GREYSCALE:case ColorType.TRUECOLOUR:if(e%2!=0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${e}`);if(e/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${e/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(e/2);for(let t=0;t<e/2;t++)this._transparency[t]=this.readUint16();break;case ColorType.INDEXED_COLOUR:{if(e>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);let t=0;for(;t<e;t++){const e=this.readByte();this._palette[t].push(e)}for(;t<this._palette.length;t++)this._palette[t].push(255);break}case ColorType.UNKNOWN:case ColorType.GREYSCALE_ALPHA:case ColorType.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(e){const t=readKeyword(this),n=this.readUint8();if(n!==CompressionMethod.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${n}`);const r=this.readBytes(e-t.length-2);this._png.iccEmbeddedProfile={name:t,profile:inflate_1(r)}}decodepHYs(){const e=this.readUint32(),t=this.readUint32(),n=this.readByte();this._png.resolution={x:e,y:t,unit:n}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let e=0;e<this._numberOfFrames;e++){const t={sequenceNumber:this._frames[e].sequenceNumber,delayNumber:this._frames[e].delayNumber,delayDenominator:this._frames[e].delayDenominator,data:8===this._apng.depth?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},n=this._frames.at(e);if(n){if(n.data=decodeInterlaceNull({data:n.data,width:n.width,height:n.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),0===e||0===n.xOffset&&0===n.yOffset&&n.width===this._png.width&&n.height===this._png.height)t.data=n.data;else{const r=this._apng.frames.at(e-1);this.disposeFrame(n,r,t),this.addFrameDataToCanvas(t,n)}this._apng.frames.push(t)}}return this._apng}disposeFrame(e,t,n){switch(e.disposeOp){case DisposeOpType.NONE:break;case DisposeOpType.BACKGROUND:for(let t=0;t<this._png.height;t++)for(let r=0;r<this._png.width;r++){const o=(t*e.width+r)*this._png.channels;for(let e=0;e<this._png.channels;e++)n.data[o+e]=0}break;case DisposeOpType.PREVIOUS:n.data.set(t.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(e,t){const n=1<<this._png.depth,r=(e,n)=>({index:((e+t.yOffset)*this._png.width+t.xOffset+n)*this._png.channels,frameIndex:(e*t.width+n)*this._png.channels});switch(t.blendOp){case BlendOpType.SOURCE:for(let n=0;n<t.height;n++)for(let o=0;o<t.width;o++){const{index:i,frameIndex:a}=r(n,o);for(let n=0;n<this._png.channels;n++)e.data[i+n]=t.data[a+n]}break;case BlendOpType.OVER:for(let o=0;o<t.height;o++)for(let i=0;i<t.width;i++){const{index:a,frameIndex:s}=r(o,i);for(let r=0;r<this._png.channels;r++){const o=t.data[s+this._png.channels-1]/n,i=r%(this._png.channels-1)==0?1:t.data[s+r],l=Math.floor(o*i+(1-o)*e.data[a+r]);e.data[a+r]+=l}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var e;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const t=this._isAnimated?(null==(e=this._frames)?void 0:e.at(0)).data:this._inflator.result;if(this._filterMethod!==FilterMethod.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===InterlaceMethod.NO_INTERLACE)this._png.data=decodeInterlaceNull({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else{if(this._interlaceMethod!==InterlaceMethod.ADAM7)throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._png.data=decodeInterlaceAdam7({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth})}this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const e=this._inflator.result,t=this._frames.at(-1);t?t.data=e:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:DisposeOpType.NONE,blendOp:BlendOpType.SOURCE,data:e}),this._inflator=new Inflate_1,this._writingDataChunks=!1}}function checkBitDepth(e){if(1!==e&&2!==e&&4!==e&&8!==e&&16!==e)throw new Error(`invalid bit depth: ${e}`);return e}var ResolutionUnitSpecifier,ResolutionUnitSpecifier2;function decodePng(e,t){return new PngDecoder(e,t).decode()}ResolutionUnitSpecifier2=ResolutionUnitSpecifier||(ResolutionUnitSpecifier={}),ResolutionUnitSpecifier2[ResolutionUnitSpecifier2.UNKNOWN=0]="UNKNOWN",ResolutionUnitSpecifier2[ResolutionUnitSpecifier2.METRE=1]="METRE";var i$2=function(){return"undefined"!=typeof window?window:void 0!==global$1?global$1:"undefined"!=typeof self?self:this}();function a$1(){i$2.console&&"function"==typeof i$2.console.log&&i$2.console.log.apply(i$2.console,arguments)}var o$2={log:a$1,warn:function(e){i$2.console&&("function"==typeof i$2.console.warn?i$2.console.warn.apply(i$2.console,arguments):a$1.call(null,arguments))},error:function(e){i$2.console&&("function"==typeof i$2.console.error?i$2.console.error.apply(i$2.console,arguments):a$1(e))}};function s$1(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){l$2(r.response,t,n)},r.onerror=function(){o$2.error("could not download file")},r.send()}function u$1(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(n){}return t.status>=200&&t.status<=299}function c$2(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var l$2=i$2.saveAs||("object"!==("undefined"==typeof window?"undefined":_typeof(window))||window!==i$2?function(){}:"undefined"!=typeof HTMLAnchorElement&&"download"in HTMLAnchorElement.prototype?function(e,t,n){var r=i$2.URL||i$2.webkitURL,o=document.createElement("a");t=t||e.name||"download",o.download=t,o.rel="noopener","string"==typeof e?(o.href=e,o.origin!==location.origin?u$1(o.href)?s$1(e,t,n):c$2(o,o.target="_blank"):c$2(o)):(o.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(o.href)},4e4),setTimeout(function(){c$2(o)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download","string"==typeof e)if(u$1(e))s$1(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){c$2(r)})}else navigator.msSaveOrOpenBlob((o=e,void 0===(i=n)?i={autoBom:!1}:"object"!==_typeof(i)&&(o$2.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(o.type)?new Blob([String.fromCharCode(65279),o],{type:o.type}):o),t);var o,i}:function(e,t,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return s$1(e,t,n);var o="application/octet-stream"===e.type,i=/constructor/i.test(i$2.HTMLElement)||i$2.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||o&&i)&&"object"===("undefined"==typeof FileReader?"undefined":_typeof(FileReader))){var s=new FileReader;s.onloadend=function(){var e=s.result;e=a?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},s.readAsDataURL(e)}else{var l=i$2.URL||i$2.webkitURL,c=l.createObjectURL(e);r?r.location=c:location.href=c,r=null,setTimeout(function(){l.revokeObjectURL(c)},4e4)}});
|
|
210
|
+
*/class Animator{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){const o=t.listeners[r],i=t.duration;o.forEach(r=>r({chart:e,initial:t.initial,numSteps:i,currentStep:Math.min(n-t.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;const o=n.items;let i,a=o.length-1,s=!1;for(;a>=0;--a)i=o[a],i._active?(i._total>n.duration&&(n.duration=i._total),i.tick(e),s=!0):(o[a]=o[o.length-1],o.pop());s&&(r.draw(),this._notify(r,n,e,"progress")),o.length||(n.running=!1,this._notify(r,n,e,"complete"),n.initial=!1),t+=o.length}),this._lastDate=e,0===t&&(this._running=!1)}_getAnims(e){const t=this._charts;let n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const n=t.items;let r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var animator=new Animator;const transparent="transparent",interpolators={boolean:(e,t,n)=>n>.5?t:e,color(e,t,n){const r=color(e||transparent),o=r.valid&&color(t||transparent);return o&&o.valid?o.mix(r,n).hexString():t},number:(e,t,n)=>e+(t-e)*n};class Animation{constructor(e,t,n,r){const o=t[n];r=resolve$3([e.to,r,o,e.from]);const i=resolve$3([e.from,o,r]);this._active=!0,this._fn=e.fn||interpolators[e.type||typeof i],this._easing=effects[e.easing]||effects.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=i,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);const r=this._target[this._prop],o=n-this._start,i=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(i,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=resolve$3([e.to,t,r,e.from]),this._from=resolve$3([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,n=this._duration,r=this._prop,o=this._from,i=this._loop,a=this._to;let s;if(this._active=o!==a&&(i||t<n),!this._active)return this._target[r]=a,void this._notify(!0);t<0?this._target[r]=o:(s=t/n%2,s=i&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(o,a,s))}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){const t=e?"res":"rej",n=this._promises||[];for(let r=0;r<n.length;r++)n[r][t]()}}class Animations{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!isObject$3(e))return;const t=Object.keys(defaults$2.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{const o=e[r];if(!isObject$3(o))return;const i={};for(const e of t)i[e]=o[e];(isArray$4(o.properties)&&o.properties||[r]).forEach(e=>{e!==r&&n.has(e)||n.set(e,i)})})}_animateOptions(e,t){const n=t.options,r=resolveTargetOptions(e,n);if(!r)return[];const o=this._createAnimations(r,n);return n.$shared&&awaitAll(e.options.$animations,n).then(()=>{e.options=n},()=>{}),o}_createAnimations(e,t){const n=this._properties,r=[],o=e.$animations||(e.$animations={}),i=Object.keys(t),a=Date.now();let s;for(s=i.length-1;s>=0;--s){const l=i[s];if("$"===l.charAt(0))continue;if("options"===l){r.push(...this._animateOptions(e,t));continue}const c=t[l];let u=o[l];const d=n.get(l);if(u){if(d&&u.active()){u.update(d,c,a);continue}u.cancel()}d&&d.duration?(o[l]=u=new Animation(d,e,l,c),r.push(u)):e[l]=c}return r}update(e,t){if(0===this._properties.size)return void Object.assign(e,t);const n=this._createAnimations(e,t);return n.length?(animator.add(this._chart,n),!0):void 0}}function awaitAll(e,t){const n=[],r=Object.keys(t);for(let o=0;o<r.length;o++){const t=e[r[o]];t&&t.active()&&n.push(t.wait())}return Promise.all(n)}function resolveTargetOptions(e,t){if(!t)return;let n=e.options;if(n)return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n;e.options=t}function scaleClip(e,t){const n=e&&e.options||{},r=n.reverse,o=void 0===n.min?t:0,i=void 0===n.max?t:0;return{start:r?i:o,end:r?o:i}}function defaultClip(e,t,n){if(!1===n)return!1;const r=scaleClip(e,n),o=scaleClip(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function toClip(e){let t,n,r,o;return isObject$3(e)?(t=e.top,n=e.right,r=e.bottom,o=e.left):t=n=r=o=e,{top:t,right:n,bottom:r,left:o,disabled:!1===e}}function getSortedDatasetIndices(e,t){const n=[],r=e._getSortedDatasetMetas(t);let o,i;for(o=0,i=r.length;o<i;++o)n.push(r[o].index);return n}function applyStack(e,t,n,r={}){const o=e.keys,i="single"===r.mode;let a,s,l,c;if(null!==t){for(a=0,s=o.length;a<s;++a){if(l=+o[a],l===n){if(r.all)continue;break}c=e.values[l],isNumberFinite(c)&&(i||0===t||sign$2(t)===sign$2(c))&&(t+=c)}return t}}function convertObjectDataToArray(e){const t=Object.keys(e),n=new Array(t.length);let r,o,i;for(r=0,o=t.length;r<o;++r)i=t[r],n[r]={x:i,y:e[i]};return n}function isStacked(e,t){const n=e&&e.options.stacked;return n||void 0===n&&void 0!==t.stack}function getStackKey(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function getUserBounds(e){const{min:t,max:n,minDefined:r,maxDefined:o}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}function getOrCreateStack(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function getLastIndexInStack(e,t,n,r){for(const o of t.getMatchingVisibleMetas(r).reverse()){const t=e[o.index];if(n&&t>0||!n&&t<0)return o.index}return null}function updateStacks(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:a,index:s}=r,l=i.axis,c=a.axis,u=getStackKey(i,a,r),d=t.length;let p;for(let h=0;h<d;++h){const e=t[h],{[l]:n,[c]:i}=e;p=(e._stacks||(e._stacks={}))[c]=getOrCreateStack(o,u,n),p[s]=i,p._top=getLastIndexInStack(p,a,!0,r.type),p._bottom=getLastIndexInStack(p,a,!1,r.type);(p._visualValues||(p._visualValues={}))[s]=i}}function getFirstScaleId(e,t){const n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function createDatasetContext(e,t){return createContext(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function createDataContext(e,t,n){return createContext(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function clearStacks(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const e of t){const t=e._stacks;if(!t||void 0===t[r]||void 0===t[r][n])return;delete t[r][n],void 0!==t[r]._visualValues&&void 0!==t[r]._visualValues[n]&&delete t[r]._visualValues[n]}}}const isDirectUpdateMode=e=>"reset"===e||"none"===e,cloneIfNotShared=(e,t)=>t?e:Object.assign({},e),createStack=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:getSortedDatasetIndices(n,!0),values:null};class DatasetController{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=isStacked(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&clearStacks(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>"x"===e?t:"r"===e?r:n,o=t.xAxisID=valueOrDefault(n.xAxisID,getFirstScaleId(e,"x")),i=t.yAxisID=valueOrDefault(n.yAxisID,getFirstScaleId(e,"y")),a=t.rAxisID=valueOrDefault(n.rAxisID,getFirstScaleId(e,"r")),s=t.indexAxis,l=t.iAxisID=r(s,o,i,a),c=t.vAxisID=r(s,i,o,a);t.xScale=this.getScaleForId(o),t.yScale=this.getScaleForId(i),t.rScale=this.getScaleForId(a),t.iScale=this.getScaleForId(l),t.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),e._stacked&&clearStacks(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),n=this._data;if(isObject$3(t))this._data=convertObjectDataToArray(t);else if(n!==t){if(n){unlistenArrayEvents(n,this);const e=this._cachedMeta;clearStacks(e),e._parsed=[]}t&&Object.isExtensible(t)&&listenArrayEvents(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,n=this.getDataset();let r=!1;this._dataCheck();const o=t._stacked;t._stacked=isStacked(t.vScale,t),t.stack!==n.stack&&(r=!0,clearStacks(t),t.stack=n.stack),this._resyncElements(e),(r||o!==t._stacked)&&updateStacks(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:n,_data:r}=this,{iScale:o,_stacked:i}=n,a=o.axis;let s,l,c,u=0===e&&t===r.length||n._sorted,d=e>0&&n._parsed[e-1];if(!1===this._parsing)n._parsed=r,n._sorted=!0,c=r;else{c=isArray$4(r[e])?this.parseArrayData(n,r,e,t):isObject$3(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);const o=()=>null===l[a]||d&&l[a]<d[a];for(s=0;s<t;++s)n._parsed[s+e]=l=c[s],u&&(o()&&(u=!1),d=l);n._sorted=u}i&&updateStacks(this,c)}parsePrimitiveData(e,t,n,r){const{iScale:o,vScale:i}=e,a=o.axis,s=i.axis,l=o.getLabels(),c=o===i,u=new Array(r);let d,p,h;for(d=0,p=r;d<p;++d)h=d+n,u[d]={[a]:c||o.parse(l[h],h),[s]:i.parse(t[h],h)};return u}parseArrayData(e,t,n,r){const{xScale:o,yScale:i}=e,a=new Array(r);let s,l,c,u;for(s=0,l=r;s<l;++s)c=s+n,u=t[c],a[s]={x:o.parse(u[0],c),y:i.parse(u[1],c)};return a}parseObjectData(e,t,n,r){const{xScale:o,yScale:i}=e,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=new Array(r);let c,u,d,p;for(c=0,u=r;c<u;++c)d=c+n,p=t[d],l[c]={x:o.parse(resolveObjectKey(p,a),d),y:i.parse(resolveObjectKey(p,s),d)};return l}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){const r=this.chart,o=this._cachedMeta,i=t[e.axis];return applyStack({keys:getSortedDatasetIndices(r,!0),values:t._stacks[e.axis]._visualValues},i,o.index,{mode:n})}updateRangeFromParsed(e,t,n,r){const o=n[t.axis];let i=null===o?NaN:o;const a=r&&n._stacks[t.axis];r&&a&&(r.values=a,i=applyStack(r,o,this._cachedMeta.index)),e.min=Math.min(e.min,i),e.max=Math.max(e.max,i)}getMinMax(e,t){const n=this._cachedMeta,r=n._parsed,o=n._sorted&&e===n.iScale,i=r.length,a=this._getOtherScale(e),s=createStack(t,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=getUserBounds(a);let d,p;function h(){p=r[d];const t=p[a.axis];return!isNumberFinite(p[e.axis])||c>t||u<t}for(d=0;d<i&&(h()||(this.updateRangeFromParsed(l,e,p,s),!o));++d);if(o)for(d=i-1;d>=0;--d)if(!h()){this.updateRangeFromParsed(l,e,p,s);break}return l}getAllParsedValues(e){const t=this._cachedMeta._parsed,n=[];let r,o,i;for(r=0,o=t.length;r<o;++r)i=t[r][e.axis],isNumberFinite(i)&&n.push(i);return n}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,n=t.iScale,r=t.vScale,o=this.getParsed(e);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:r?""+r.getLabelForValue(o[r.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=toClip(valueOrDefault(this.options.clip,defaultClip(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],o=t.chartArea,i=[],a=this._drawStart||0,s=this._drawCount||r.length-a,l=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(e,o,a,s),c=a;c<a+s;++c){const t=r[c];t.hidden||(t.active&&l?i.push(t):t.draw(e,o))}for(c=0;c<i.length;++c)i[c].draw(e,o)}getStyle(e,t){const n=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){const r=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const t=this._cachedMeta.data[e];o=t.$context||(t.$context=createDataContext(this.getContext(),e,t)),o.parsed=this.getParsed(e),o.raw=r.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=createDatasetContext(this.chart.getContext(),this.index)),o.dataset=r,o.index=o.datasetIndex=this.index;return o.active=!!t,o.mode=n,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",n){const r="active"===t,o=this._cachedDataOpts,i=e+"-"+t,a=o[i],s=this.enableOptionSharing&&defined(n);if(a)return cloneIfNotShared(a,s);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,e),u=r?[`${e}Hover`,"hover",e,""]:[e,""],d=l.getOptionScopes(this.getDataset(),c),p=Object.keys(defaults$2.elements[e]),h=l.resolveNamedOptions(d,p,()=>this.getContext(n,r,t),u);return h.$shared&&(h.$shared=s,o[i]=Object.freeze(cloneIfNotShared(h,s))),h}_resolveAnimations(e,t,n){const r=this.chart,o=this._cachedDataOpts,i=`animation-${t}`,a=o[i];if(a)return a;let s;if(!1!==r.options.animation){const r=this.chart.config,o=r.datasetAnimationScopeKeys(this._type,t),i=r.getOptionScopes(this.getDataset(),o);s=r.createResolver(i,this.getContext(e,n,t))}const l=new Animations(r,s&&s.animations);return s&&s._cacheable&&(o[i]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||isDirectUpdateMode(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,o=this.getSharedOptions(n),i=this.includeOptions(t,o)||o!==r;return this.updateSharedOptions(o,t,n),{sharedOptions:o,includeOptions:i}}updateElement(e,t,n,r){isDirectUpdateMode(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!isDirectUpdateMode(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;const o=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(o)||o})}removeHoverStyle(e,t,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,t,n){this._setStyle(e,n,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,n=this._cachedMeta.data;for(const[a,s,l]of this._syncList)this[a](s,l);this._syncList=[];const r=n.length,o=t.length,i=Math.min(o,r);i&&this.parse(0,i),o>r?this._insertElements(r,o-r,e):o<r&&this._removeElements(o,r-o)}_insertElements(e,t,n=!0){const r=this._cachedMeta,o=r.data,i=e+t;let a;const s=e=>{for(e.length+=t,a=e.length-1;a>=i;a--)e[a]=e[a-t]};for(s(o),a=e;a<i;++a)o[a]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(o,e,t,"reset")}updateElements(e,t,n,r){}_removeElements(e,t){const n=this._cachedMeta;if(this._parsing){const r=n._parsed.splice(e,t);n._stacked&&clearStacks(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function getAllScaleValues(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let t=0,o=n.length;t<o;t++)r=r.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=_arrayUnique(r.sort((e,t)=>e-t))}return e._cache.$bar}function computeMinSampleSize(e){const t=e.iScale,n=getAllScaleValues(t,e.type);let r,o,i,a,s=t._length;const l=()=>{32767!==i&&-32768!==i&&(defined(a)&&(s=Math.min(s,Math.abs(i-a)||s)),a=i)};for(r=0,o=n.length;r<o;++r)i=t.getPixelForValue(n[r]),l();for(a=void 0,r=0,o=t.ticks.length;r<o;++r)i=t.getPixelForTick(r),l();return s}function computeFitCategoryTraits(e,t,n,r){const o=n.barThickness;let i,a;return isNullOrUndef(o)?(i=t.min*n.categoryPercentage,a=n.barPercentage):(i=o*r,a=1),{chunk:i/r,ratio:a,start:t.pixels[e]-i/2}}function computeFlexCategoryTraits(e,t,n,r){const o=t.pixels,i=o[e];let a=e>0?o[e-1]:null,s=e<o.length-1?o[e+1]:null;const l=n.categoryPercentage;null===a&&(a=i-(null===s?t.end-t.start:s-i)),null===s&&(s=i+i-a);const c=i-(i-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/r,ratio:n.barPercentage,start:c}}function parseFloatBar(e,t,n,r){const o=n.parse(e[0],r),i=n.parse(e[1],r),a=Math.min(o,i),s=Math.max(o,i);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:o,end:i,min:a,max:s}}function parseValue(e,t,n,r){return isArray$4(e)?parseFloatBar(e,t,n,r):t[n.axis]=n.parse(e,r),t}function parseArrayOrPrimitive(e,t,n,r){const o=e.iScale,i=e.vScale,a=o.getLabels(),s=o===i,l=[];let c,u,d,p;for(c=n,u=n+r;c<u;++c)p=t[c],d={},d[o.axis]=s||o.parse(a[c],c),l.push(parseValue(p,d,i,c));return l}function isFloatBar(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function barSign(e,t,n){return 0!==e?sign$2(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function borderProps(e){let t,n,r,o,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(o="end",i="start"):(o="start",i="end"),{start:n,end:r,reverse:t,top:o,bottom:i}}function setBorderSkipped(e,t,n,r){let o=t.borderSkipped;const i={};if(!o)return void(e.borderSkipped=i);if(!0===o)return void(e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:s,reverse:l,top:c,bottom:u}=borderProps(e);"middle"===o&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[parseEdge(u,a,s,l)]=!0,o=c)),i[parseEdge(o,a,s,l)]=!0,e.borderSkipped=i}function parseEdge(e,t,n,r){return e=r?startEnd(e=swap(e,t,n),n,t):startEnd(e,t,n)}function swap(e,t,n){return e===t?n:e===n?t:e}function startEnd(e,t,n){return"start"===e?t:"end"===e?n:e}function setInflateAmount(e,{inflateAmount:t},n){e.inflateAmount="auto"===t?1===n?.33:0:t}class BarController extends DatasetController{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(e,t,n,r){return parseArrayOrPrimitive(e,t,n,r)}parseArrayData(e,t,n,r){return parseArrayOrPrimitive(e,t,n,r)}parseObjectData(e,t,n,r){const{iScale:o,vScale:i}=e,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l="x"===o.axis?a:s,c="x"===i.axis?a:s,u=[];let d,p,h,f;for(d=n,p=n+r;d<p;++d)f=t[d],h={},h[o.axis]=o.parse(resolveObjectKey(f,l),d),u.push(parseValue(resolveObjectKey(f,c),h,i,d));return u}updateRangeFromParsed(e,t,n,r){super.updateRangeFromParsed(e,t,n,r);const o=n._custom;o&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:n,vScale:r}=t,o=this.getParsed(e),i=o._custom,a=isFloatBar(i)?"["+i.start+", "+i.end+"]":""+r.getLabelForValue(o[r.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,r){const o="reset"===r,{index:i,_cachedMeta:{vScale:a}}=this,s=a.getBasePixel(),l=a.isHorizontal(),c=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(t,r);for(let p=t;p<t+n;p++){const t=this.getParsed(p),n=o||isNullOrUndef(t[a.axis])?{base:s,head:s}:this._calculateBarValuePixels(p),h=this._calculateBarIndexPixels(p,c),f=(t._stacks||{})[a.axis],A={horizontal:l,base:n.base,enableBorderRadius:!f||isFloatBar(t._custom)||i===f._top||i===f._bottom,x:l?n.head:h.center,y:l?h.center:n.head,height:l?h.size:Math.abs(n.size),width:l?Math.abs(n.size):h.size};d&&(A.options=u||this.resolveDataElementOptions(p,e[p].active?"active":r));const m=A.options||e[p].options;setBorderSkipped(A,m,f,i),setInflateAmount(A,m,c.ratio),this.updateElement(e[p],p,A,r)}}_getStacks(e,t){const{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),o=n.options.stacked,i=[],a=e=>{const n=e.controller.getParsed(t),r=n&&n[e.vScale.axis];if(isNullOrUndef(r)||isNaN(r))return!0};for(const s of r)if((void 0===t||!a(s))&&((!1===o||-1===i.indexOf(s.stack)||void 0===o&&void 0===s.stack)&&i.push(s.stack),s.index===e))break;return i.length||i.push(void 0),i}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,n){const r=this._getStacks(e,n),o=void 0!==t?r.indexOf(t):-1;return-1===o?r.length-1:o}_getRuler(){const e=this.options,t=this._cachedMeta,n=t.iScale,r=[];let o,i;for(o=0,i=t.data.length;o<i;++o)r.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const a=e.barThickness;return{min:a||computeMinSampleSize(t),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:n,index:r},options:{base:o,minBarLength:i}}=this,a=o||0,s=this.getParsed(e),l=s._custom,c=isFloatBar(l);let u,d,p=s[t.axis],h=0,f=n?this.applyStack(t,s,n):p;f!==p&&(h=f-p,f=p),c&&(p=l.barStart,f=l.barEnd-l.barStart,0!==p&&sign$2(p)!==sign$2(l.barEnd)&&(h=0),h+=p);const A=isNullOrUndef(o)||c?h:o;let m=t.getPixelForValue(A);if(u=this.chart.getDataVisibility(e)?t.getPixelForValue(h+f):m,d=u-m,Math.abs(d)<i){d=barSign(d,t,a)*i,p===a&&(m-=d/2);const e=t.getPixelForDecimal(0),o=t.getPixelForDecimal(1),l=Math.min(e,o),h=Math.max(e,o);m=Math.max(Math.min(m,h),l),u=m+d,n&&!c&&(s._stacks[t.axis]._visualValues[r]=t.getValueForPixel(u)-t.getValueForPixel(m))}if(m===t.getPixelForValue(a)){const e=sign$2(d)*t.getLineWidthForValue(a)/2;m+=e,d-=e}return{size:d,base:m,head:u,center:u+d/2}}_calculateBarIndexPixels(e,t){const n=t.scale,r=this.options,o=r.skipNull,i=valueOrDefault(r.maxBarThickness,1/0);let a,s;if(t.grouped){const n=o?this._getStackCount(e):t.stackCount,l="flex"===r.barThickness?computeFlexCategoryTraits(e,t,r,n):computeFitCategoryTraits(e,t,r,n),c=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);a=l.start+l.chunk*c+l.chunk/2,s=Math.min(i,l.chunk*l.ratio)}else a=n.getPixelForValue(this.getParsed(e)[n.axis],e),s=Math.min(i,t.min*t.ratio);return{base:a-s/2,head:a+s/2,center:a,size:s}}draw(){const e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length;let o=0;for(;o<r;++o)null!==this.getParsed(o)[t.axis]&&n[o].draw(this._ctx)}}class LineController extends DatasetController{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:n,data:r=[],_dataset:o}=t,i=this.chart._animationsDisabled;let{start:a,count:s}=_getStartAndCountOfVisiblePoints(t,r,i);this._drawStart=a,this._drawCount=s,_scaleRangesChanged(t)&&(a=0,s=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=r;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!i,options:l},e),this.updateElements(r,a,s,e)}updateElements(e,t,n,r){const o="reset"===r,{iScale:i,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(t,r),d=i.axis,p=a.axis,{spanGaps:h,segment:f}=this.options,A=isNumber$2(h)?h:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||o||"none"===r,g=t+n,y=e.length;let v=t>0&&this.getParsed(t-1);for(let b=0;b<y;++b){const n=e[b],h=m?n:{};if(b<t||b>=g){h.skip=!0;continue}const y=this.getParsed(b),x=isNullOrUndef(y[p]),w=h[d]=i.getPixelForValue(y[d],b),C=h[p]=o||x?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,y,s):y[p],b);h.skip=isNaN(w)||isNaN(C)||x,h.stop=b>0&&Math.abs(y[d]-v[d])>A,f&&(h.parsed=y,h.raw=l.data[b]),u&&(h.options=c||this.resolveDataElementOptions(b,n.active?"active":r)),m||this.updateElement(n,b,h,r),v=y}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;const o=r[0].size(this.resolveDataElementOptions(0)),i=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,o,i)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}function abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class DateAdapterBase{static override(e){Object.assign(DateAdapterBase.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return abstract()}parse(){return abstract()}format(){return abstract()}add(){return abstract()}diff(){return abstract()}startOf(){return abstract()}endOf(){return abstract()}}var adapters={_date:DateAdapterBase};function binarySearch(e,t,n,r){const{controller:o,data:i,_sorted:a}=e,s=o._cachedMeta.iScale;if(s&&t===s.axis&&"r"!==t&&a&&i.length){const e=s._reversePixels?_rlookupByKey:_lookupByKey;if(!r)return e(i,t,n);if(o._sharedOptions){const r=i[0],o="function"==typeof r.getRange&&r.getRange(t);if(o){const r=e(i,t,n-o),a=e(i,t,n+o);return{lo:r.lo,hi:a.hi}}}}return{lo:0,hi:i.length-1}}function evaluateInteractionItems(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),a=n[t];for(let s=0,l=i.length;s<l;++s){const{index:e,data:n}=i[s],{lo:l,hi:c}=binarySearch(i[s],t,a,o);for(let t=l;t<=c;++t){const o=n[t];o.skip||r(o,e,t)}}}function getDistanceMetricForAxis(e){const t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,r){const o=t?Math.abs(e.x-r.x):0,i=n?Math.abs(e.y-r.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(i,2))}}function getIntersectItems(e,t,n,r,o){const i=[];if(!o&&!e.isPointInArea(t))return i;return evaluateInteractionItems(e,n,t,function(n,a,s){(o||_isPointInArea(n,e.chartArea,0))&&n.inRange(t.x,t.y,r)&&i.push({element:n,datasetIndex:a,index:s})},!0),i}function getNearestRadialItems(e,t,n,r){let o=[];return evaluateInteractionItems(e,n,t,function(e,n,i){const{startAngle:a,endAngle:s}=e.getProps(["startAngle","endAngle"],r),{angle:l}=getAngleFromPoint(e,{x:t.x,y:t.y});_angleBetween(l,a,s)&&o.push({element:e,datasetIndex:n,index:i})}),o}function getNearestCartesianItems(e,t,n,r,o,i){let a=[];const s=getDistanceMetricForAxis(n);let l=Number.POSITIVE_INFINITY;return evaluateInteractionItems(e,n,t,function(n,c,u){const d=n.inRange(t.x,t.y,o);if(r&&!d)return;const p=n.getCenterPoint(o);if(!(!!i||e.isPointInArea(p))&&!d)return;const h=s(t,p);h<l?(a=[{element:n,datasetIndex:c,index:u}],l=h):h===l&&a.push({element:n,datasetIndex:c,index:u})}),a}function getNearestItems(e,t,n,r,o,i){return i||e.isPointInArea(t)?"r"!==n||r?getNearestCartesianItems(e,t,n,r,o,i):getNearestRadialItems(e,t,n,o):[]}function getAxisItems(e,t,n,r,o){const i=[],a="x"===n?"inXRange":"inYRange";let s=!1;return evaluateInteractionItems(e,n,t,(e,r,l)=>{e[a](t[n],o)&&(i.push({element:e,datasetIndex:r,index:l}),s=s||e.inRange(t.x,t.y,o))}),r&&!s?[]:i}var Interaction={modes:{index(e,t,n,r){const o=getRelativePosition(t,e),i=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?getIntersectItems(e,o,i,r,a):getNearestItems(e,o,i,!1,r,a),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{const t=s[0].index,n=e.data[t];n&&!n.skip&&l.push({element:n,datasetIndex:e.index,index:t})}),l):[]},dataset(e,t,n,r){const o=getRelativePosition(t,e),i=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?getIntersectItems(e,o,i,r,a):getNearestItems(e,o,i,!1,r,a);if(s.length>0){const t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point:(e,t,n,r)=>getIntersectItems(e,getRelativePosition(t,e),n.axis||"xy",r,n.includeInvisible||!1),nearest(e,t,n,r){const o=getRelativePosition(t,e),i=n.axis||"xy",a=n.includeInvisible||!1;return getNearestItems(e,o,i,n.intersect,r,a)},x:(e,t,n,r)=>getAxisItems(e,getRelativePosition(t,e),"x",n.intersect,r),y:(e,t,n,r)=>getAxisItems(e,getRelativePosition(t,e),"y",n.intersect,r)}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(e,t){return e.filter(e=>e.pos===t)}function filterDynamicPositionByAxis(e,t){return e.filter(e=>-1===STATIC_POSITIONS.indexOf(e.pos)&&e.box.axis===t)}function sortByWeight(e,t){return e.sort((e,n)=>{const r=t?n:e,o=t?e:n;return r.weight===o.weight?r.index-o.index:r.weight-o.weight})}function wrapBoxes(e){const t=[];let n,r,o,i,a,s;for(n=0,r=(e||[]).length;n<r;++n)o=e[n],({position:i,options:{stack:a,stackWeight:s=1}}=o),t.push({index:n,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:a&&i+a,stackWeight:s});return t}function buildStacks(e){const t={};for(const n of e){const{stack:e,pos:r,stackWeight:o}=n;if(!e||!STATIC_POSITIONS.includes(r))continue;const i=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=o}return t}function setLayoutDims(e,t){const n=buildStacks(e),{vBoxMaxWidth:r,hBoxMaxHeight:o}=t;let i,a,s;for(i=0,a=e.length;i<a;++i){s=e[i];const{fullSize:a}=s.box,l=n[s.stack],c=l&&s.stackWeight/l.weight;s.horizontal?(s.width=c?c*r:a&&t.availableWidth,s.height=o):(s.width=r,s.height=c?c*o:a&&t.availableHeight)}return n}function buildLayoutBoxes(e){const t=wrapBoxes(e),n=sortByWeight(t.filter(e=>e.box.fullSize),!0),r=sortByWeight(filterByPosition(t,"left"),!0),o=sortByWeight(filterByPosition(t,"right")),i=sortByWeight(filterByPosition(t,"top"),!0),a=sortByWeight(filterByPosition(t,"bottom")),s=filterDynamicPositionByAxis(t,"x"),l=filterDynamicPositionByAxis(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(a).concat(s),chartArea:filterByPosition(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(a).concat(s)}}function getCombinedMax(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function updateMaxPadding(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 updateDims(e,t,n,r){const{pos:o,box:i}=n,a=e.maxPadding;if(!isObject$3(o)){n.size&&(e[o]-=n.size);const t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?i.height:i.width),n.size=t.size/t.count,e[o]+=n.size}i.getPadding&&updateMaxPadding(a,i.getPadding());const s=Math.max(0,t.outerWidth-getCombinedMax(a,e,"left","right")),l=Math.max(0,t.outerHeight-getCombinedMax(a,e,"top","bottom")),c=s!==e.w,u=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function handleMaxPadding(e){const t=e.maxPadding;function n(n){const r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function getMargins(e,t){const n=t.maxPadding;function r(e){const r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?["left","right"]:["top","bottom"])}function fitBoxes(e,t,n,r){const o=[];let i,a,s,l,c,u;for(i=0,a=e.length,c=0;i<a;++i){s=e[i],l=s.box,l.update(s.width||t.w,s.height||t.h,getMargins(s.horizontal,t));const{same:a,other:d}=updateDims(t,n,s,r);c|=a&&o.length,u=u||d,l.fullSize||o.push(s)}return c&&fitBoxes(o,t,n,r)||u}function setBoxDims(e,t,n,r,o){e.top=n,e.left=t,e.right=t+r,e.bottom=n+o,e.width=r,e.height=o}function placeBoxes(e,t,n,r){const o=n.padding;let{x:i,y:a}=t;for(const s of e){const e=s.box,l=r[s.stack]||{placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){const r=t.w*c,i=l.size||e.height;defined(l.start)&&(a=l.start),e.fullSize?setBoxDims(e,o.left,a,n.outerWidth-o.right-o.left,i):setBoxDims(e,t.left+l.placed,a,r,i),l.start=a,l.placed+=r,a=e.bottom}else{const r=t.h*c,a=l.size||e.width;defined(l.start)&&(i=l.start),e.fullSize?setBoxDims(e,i,o.top,a,n.outerHeight-o.bottom-o.top):setBoxDims(e,i,t.top+l.placed,a,r),l.start=i,l.placed+=r,i=e.right}}t.x=i,t.y=a}var layouts={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(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&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 o=toPadding(e.options.layout.padding),i=Math.max(t-o.width,0),a=Math.max(n-o.height,0),s=buildLayoutBoxes(e.boxes),l=s.vertical,c=s.horizontal;each$1(e.boxes,e=>{"function"==typeof e.beforeLayout&&e.beforeLayout()});const u=l.reduce((e,t)=>t.box.options&&!1===t.box.options.display?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:a,vBoxMaxWidth:i/2/u,hBoxMaxHeight:a/2}),p=Object.assign({},o);updateMaxPadding(p,toPadding(r));const h=Object.assign({maxPadding:p,w:i,h:a,x:o.left,y:o.top},o),f=setLayoutDims(l.concat(c),d);fitBoxes(s.fullSize,h,d,f),fitBoxes(l,h,d,f),fitBoxes(c,h,d,f)&&fitBoxes(l,h,d,f),handleMaxPadding(h),placeBoxes(s.leftAndTop,h,d,f),h.x+=h.w,h.y+=h.h,placeBoxes(s.rightAndBottom,h,d,f),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},each$1(s.chartArea,t=>{const n=t.box;Object.assign(n,e.chartArea),n.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}}class BasicPlatform extends BasePlatform{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const EXPANDO_KEY="$chartjs",EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=e=>null===e||""===e;function initCanvas(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[EXPANDO_KEY]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",isNullOrEmpty(o)){const t=readUsedSize(e,"width");void 0!==t&&(e.width=t)}if(isNullOrEmpty(r))if(""===e.style.height)e.height=e.width/(t||2);else{const t=readUsedSize(e,"height");void 0!==t&&(e.height=t)}return e}const eventListenerOptions=!!supportsEventListenerOptions&&{passive:!0};function addListener(e,t,n){e.addEventListener(t,n,eventListenerOptions)}function removeListener(e,t,n){e.canvas.removeEventListener(t,n,eventListenerOptions)}function fromNativeEvent(e,t){const n=EVENT_TYPES[e.type]||e.type,{x:r,y:o}=getRelativePosition(e,t);return{type:n,chart:t,native:e,x:void 0!==r?r:null,y:void 0!==o?o:null}}function nodeListContains(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function createAttachObserver(e,t,n){const r=e.canvas,o=new MutationObserver(e=>{let t=!1;for(const n of e)t=t||nodeListContains(n.addedNodes,r),t=t&&!nodeListContains(n.removedNodes,r);t&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function createDetachObserver(e,t,n){const r=e.canvas,o=new MutationObserver(e=>{let t=!1;for(const n of e)t=t||nodeListContains(n.removedNodes,r),t=t&&!nodeListContains(n.addedNodes,r);t&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const e=window.devicePixelRatio;e!==oldDevicePixelRatio&&(oldDevicePixelRatio=e,drpListeningCharts.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function listenDevicePixelRatioChanges(e,t){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(e,t)}function unlistenDevicePixelRatioChanges(e){drpListeningCharts.delete(e),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(e,t,n){const r=e.canvas,o=r&&_getParentNode(r);if(!o)return;const i=throttled((e,t)=>{const r=o.clientWidth;n(e,t),r<o.clientWidth&&n()},window),a=new ResizeObserver(e=>{const t=e[0],n=t.contentRect.width,r=t.contentRect.height;0===n&&0===r||i(n,r)});return a.observe(o),listenDevicePixelRatioChanges(e,i),a}function releaseObserver(e,t,n){n&&n.disconnect(),"resize"===t&&unlistenDevicePixelRatioChanges(e)}function createProxyAndListen(e,t,n){const r=e.canvas,o=throttled(t=>{null!==e.ctx&&n(fromNativeEvent(t,e))},e);return addListener(r,t,o),o}class DomPlatform extends BasePlatform{acquireContext(e,t){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(initCanvas(e,t),n):null}releaseContext(e){const t=e.canvas;if(!t[EXPANDO_KEY])return!1;const n=t[EXPANDO_KEY].initial;["height","width"].forEach(e=>{const r=n[e];isNullOrUndef(r)?t.removeAttribute(e):t.setAttribute(e,r)});const r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[EXPANDO_KEY],!0}addEventListener(e,t,n){this.removeEventListener(e,t);const r=e.$proxies||(e.$proxies={}),o={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[t]||createProxyAndListen;r[t]=o(e,t,n)}removeEventListener(e,t){const n=e.$proxies||(e.$proxies={}),r=n[t];if(!r)return;({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[t]||removeListener)(e,t,r),n[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return getMaximumSize(e,t,n,r)}isAttached(e){const t=_getParentNode(e);return!(!t||!t.isConnected)}}function _detectPlatform(e){return!_isDomSupported()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?BasicPlatform:DomPlatform}let Element$2=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}hasValue(){return isNumber$2(this.x)&&isNumber$2(this.y)}getProps(e,t){const n=this.$animations;if(!t||!n)return this;const r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function autoSkip(e,t){const n=e.options.ticks,r=determineMaxTicks(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?getMajorIndices(t):[],a=i.length,s=i[0],l=i[a-1],c=[];if(a>o)return skipMajors(t,c,i,a/o),c;const u=calculateSpacing(i,t,o);if(a>0){let e,n;const r=a>1?Math.round((l-s)/(a-1)):null;for(skip(t,c,u,isNullOrUndef(r)?0:s-r,s),e=0,n=a-1;e<n;e++)skip(t,c,u,i[e],i[e+1]);return skip(t,c,u,l,isNullOrUndef(r)?t.length:l+r),c}return skip(t,c,u),c}function determineMaxTicks(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),o=e._maxLength/n;return Math.floor(Math.min(r,o))}function calculateSpacing(e,t,n){const r=getEvenSpacing(e),o=t.length/n;if(!r)return Math.max(o,1);const i=_factorize(r);for(let a=0,s=i.length-1;a<s;a++){const e=i[a];if(e>o)return e}return Math.max(o,1)}function getMajorIndices(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function skipMajors(e,t,n,r){let o,i=0,a=n[0];for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function skip(e,t,n,r,o){const i=valueOrDefault(r,0),a=Math.min(valueOrDefault(o,e.length),e.length);let s,l,c,u=0;for(n=Math.ceil(n),o&&(s=o-r,n=s/Math.floor(s/n)),c=i;c<0;)u++,c=Math.round(i+u*n);for(l=Math.max(i,0);l<a;l++)l===c&&(t.push(e[l]),u++,c=Math.round(i+u*n))}function getEvenSpacing(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 reverseAlign=e=>"left"===e?"right":"right"===e?"left":e,offsetFromEdge=(e,t,n)=>"top"===t||"left"===t?e[t]+n:e[t]-n,getTicksLimit=(e,t)=>Math.min(t||e,e);function sample(e,t){const n=[],r=e.length/t,o=e.length;let i=0;for(;i<o;i+=r)n.push(e[Math.floor(i)]);return n}function getPixelForGridLine(e,t,n){const r=e.ticks.length,o=Math.min(t,r-1),i=e._startPixel,a=e._endPixel,s=1e-6;let l,c=e.getPixelForTick(o);if(!(n&&(l=1===r?Math.max(c-i,a-c):0===t?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(o-1))/2,c+=o<t?l:-l,c<i-s||c>a+s)))return c}function garbageCollect(e,t){each$1(e,e=>{const n=e.gc,r=n.length/2;let o;if(r>t){for(o=0;o<r;++o)delete e.data[n[o]];n.splice(0,r)}})}function getTickMarkLength(e){return e.drawTicks?e.tickLength:0}function getTitleHeight(e,t){if(!e.display)return 0;const n=toFont(e.font,t),r=toPadding(e.padding);return(isArray$4(e.text)?e.text.length:1)*n.lineHeight+r.height}function createScaleContext(e,t){return createContext(e,{scale:t,type:"scale"})}function createTickContext(e,t,n){return createContext(e,{tick:n,index:t,type:"tick"})}function titleAlign(e,t,n){let r=_toLeftRightCenter(e);return(n&&"right"!==t||!n&&"right"===t)&&(r=reverseAlign(r)),r}function titleArgs(e,t,n,r){const{top:o,left:i,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:u}=l;let d,p,h,f=0;const A=a-o,m=s-i;if(e.isHorizontal()){if(p=_alignStartEnd(r,i,s),isObject$3(n)){const e=Object.keys(n)[0],r=n[e];h=u[e].getPixelForValue(r)+A-t}else h="center"===n?(c.bottom+c.top)/2+A-t:offsetFromEdge(e,n,t);d=s-i}else{if(isObject$3(n)){const e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)-m+t}else p="center"===n?(c.left+c.right)/2-m+t:offsetFromEdge(e,n,t);h=_alignStartEnd(r,a,o),f="left"===n?-HALF_PI:HALF_PI}return{titleX:p,titleY:h,maxWidth:d,rotation:f}}class Scale extends Element$2{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=finiteOrDefault(e,Number.POSITIVE_INFINITY),t=finiteOrDefault(t,Number.NEGATIVE_INFINITY),n=finiteOrDefault(n,Number.POSITIVE_INFINITY),r=finiteOrDefault(r,Number.NEGATIVE_INFINITY),{min:finiteOrDefault(e,n),max:finiteOrDefault(t,r),minDefined:isNumberFinite(e),maxDefined:isNumberFinite(t)}}getMinMax(e){let t,{min:n,max:r,minDefined:o,maxDefined:i}=this.getUserBounds();if(o&&i)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let s=0,l=a.length;s<l;++s)t=a[s].controller.getMinMax(this,e),o||(n=Math.min(n,t.min)),i||(r=Math.max(r,t.max));return n=i&&n>r?r:n,r=o&&n>r?n:r,{min:finiteOrDefault(n,finiteOrDefault(r,n)),max:finiteOrDefault(r,finiteOrDefault(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 e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(e,t,n){const{beginAtZero:r,grace:o,ticks:i}=this.options,a=i.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,o,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=a<this.ticks.length;this._convertTicksToLabels(s?sample(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||"auto"===i.source)&&(this.ticks=autoSkip(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e,t,n=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,n=!n),this._startPixel=e,this._endPixel=t,this._reversePixels=n,this._length=t-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){callback(this.options.afterUpdate,[this])}beforeSetDimensions(){callback(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(){callback(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),callback(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){callback(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let n,r,o;for(n=0,r=e.length;n<r;n++)o=e[n],o.label=callback(t.callback,[o.value,n,e],this)}afterTickToLabelConversion(){callback(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){callback(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,n=getTicksLimit(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,o=t.maxRotation;let i,a,s,l=r;if(!this._isVisible()||!t.display||r>=o||n<=1||!this.isHorizontal())return void(this.labelRotation=r);const c=this._getLabelSizes(),u=c.widest.width,d=c.highest.height,p=_limitValue(this.chart.width-u,0,this.maxWidth);i=e.offset?this.maxWidth/n:p/(n-1),u+6>i&&(i=p/(n-(e.offset?.5:1)),a=this.maxHeight-getTickMarkLength(e.grid)-t.padding-getTitleHeight(e.title,this.chart.options.font),s=Math.sqrt(u*u+d*d),l=toDegrees(Math.min(Math.asin(_limitValue((c.highest.height+6)/i,-1,1)),Math.asin(_limitValue(a/s,-1,1))-Math.asin(_limitValue(d/s,-1,1)))),l=Math.max(r,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:o}}=this,i=this._isVisible(),a=this.isHorizontal();if(i){const i=getTitleHeight(r,t.options.font);if(a?(e.width=this.maxWidth,e.height=getTickMarkLength(o)+i):(e.height=this.maxHeight,e.width=getTickMarkLength(o)+i),n.display&&this.ticks.length){const{first:t,last:r,widest:o,highest:i}=this._getLabelSizes(),s=2*n.padding,l=toRadians(this.labelRotation),c=Math.cos(l),u=Math.sin(l);if(a){const t=n.mirror?0:u*o.width+c*i.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{const t=n.mirror?0:c*o.width+u*i.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,c)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){const{ticks:{align:o,padding:i},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,d=0;s?l?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):"start"===o?d=t.width:"end"===o?u=e.width:"inner"!==o&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-a+i)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-c+i)*this.width/(this.width-c),0)}else{let n=t.height/2,r=e.height/2;"start"===o?(n=0,r=e.height):"end"===o&&(n=t.height,r=0),this.paddingTop=n+i,this.paddingBottom=r+i}}_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(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return"top"===t||"bottom"===t||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let t,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,n=e.length;t<n;t++)isNullOrUndef(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let n=this.ticks;t<n.length&&(n=sample(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){const{ctx:r,_longestTextCache:o}=this,i=[],a=[],s=Math.floor(t/getTicksLimit(t,n));let l,c,u,d,p,h,f,A,m,g,y,v=0,b=0;for(l=0;l<t;l+=s){if(d=e[l].label,p=this._resolveTickFontOptions(l),r.font=h=p.string,f=o[h]=o[h]||{data:{},gc:[]},A=p.lineHeight,m=g=0,isNullOrUndef(d)||isArray$4(d)){if(isArray$4(d))for(c=0,u=d.length;c<u;++c)y=d[c],isNullOrUndef(y)||isArray$4(y)||(m=_measureText(r,f.data,f.gc,m,y),g+=A)}else m=_measureText(r,f.data,f.gc,m,d),g=A;i.push(m),a.push(g),v=Math.max(m,v),b=Math.max(g,b)}garbageCollect(o,t);const x=i.indexOf(v),w=a.indexOf(b),C=e=>({width:i[e]||0,height:a[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(w),widths:i,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const n=t[e];return n.$context||(n.$context=createTickContext(this.getContext(),e,n))}return this.$context||(this.$context=createScaleContext(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=toRadians(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),o=this._getLabelSizes(),i=e.autoSkipPadding||0,a=o?o.widest.width+i:0,s=o?o.highest.height+i:0;return this.isHorizontal()?s*n>a*r?a/n:s/r:s*r<a*n?s/n:a/r}_isVisible(){const e=this.options.display;return"auto"!==e?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,n=this.chart,r=this.options,{grid:o,position:i,border:a}=r,s=o.offset,l=this.isHorizontal(),c=this.ticks.length+(s?1:0),u=getTickMarkLength(o),d=[],p=a.setContext(this.getContext()),h=p.display?p.width:0,f=h/2,A=function(e){return _alignPixel(n,e,h)};let m,g,y,v,b,x,w,C,$,_,S,E;if("top"===i)m=A(this.bottom),x=this.bottom-u,C=m-f,_=A(e.top)+f,E=e.bottom;else if("bottom"===i)m=A(this.top),_=e.top,E=A(e.bottom)-f,x=m+f,C=this.top+u;else if("left"===i)m=A(this.right),b=this.right-u,w=m-f,$=A(e.left)+f,S=e.right;else if("right"===i)m=A(this.left),$=e.left,S=A(e.right)-f,b=m+f,w=this.left+u;else if("x"===t){if("center"===i)m=A((e.top+e.bottom)/2+.5);else if(isObject$3(i)){const e=Object.keys(i)[0],t=i[e];m=A(this.chart.scales[e].getPixelForValue(t))}_=e.top,E=e.bottom,x=m+f,C=x+u}else if("y"===t){if("center"===i)m=A((e.left+e.right)/2);else if(isObject$3(i)){const e=Object.keys(i)[0],t=i[e];m=A(this.chart.scales[e].getPixelForValue(t))}b=m-f,w=b-u,$=e.left,S=e.right}const k=valueOrDefault(r.ticks.maxTicksLimit,c),B=Math.max(1,Math.ceil(c/k));for(g=0;g<c;g+=B){const e=this.getContext(g),t=o.setContext(e),r=a.setContext(e),i=t.lineWidth,c=t.color,u=r.dash||[],p=r.dashOffset,h=t.tickWidth,f=t.tickColor,A=t.tickBorderDash||[],m=t.tickBorderDashOffset;y=getPixelForGridLine(this,g,s),void 0!==y&&(v=_alignPixel(n,y,i),l?b=w=$=S=v:x=C=_=E=v,d.push({tx1:b,ty1:x,tx2:w,ty2:C,x1:$,y1:_,x2:S,y2:E,width:i,color:c,borderDash:u,borderDashOffset:p,tickWidth:h,tickColor:f,tickBorderDash:A,tickBorderDashOffset:m}))}return this._ticksLength=c,this._borderValue=m,d}_computeLabelItems(e){const t=this.axis,n=this.options,{position:r,ticks:o}=n,i=this.isHorizontal(),a=this.ticks,{align:s,crossAlign:l,padding:c,mirror:u}=o,d=getTickMarkLength(n.grid),p=d+c,h=u?-c:p,f=-toRadians(this.labelRotation),A=[];let m,g,y,v,b,x,w,C,$,_,S,E,k="middle";if("top"===r)x=this.bottom-h,w=this._getXAxisLabelAlignment();else if("bottom"===r)x=this.top+h,w=this._getXAxisLabelAlignment();else if("left"===r){const e=this._getYAxisLabelAlignment(d);w=e.textAlign,b=e.x}else if("right"===r){const e=this._getYAxisLabelAlignment(d);w=e.textAlign,b=e.x}else if("x"===t){if("center"===r)x=(e.top+e.bottom)/2+p;else if(isObject$3(r)){const e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)+p}w=this._getXAxisLabelAlignment()}else if("y"===t){if("center"===r)b=(e.left+e.right)/2-p;else if(isObject$3(r)){const e=Object.keys(r)[0],t=r[e];b=this.chart.scales[e].getPixelForValue(t)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===t&&("start"===s?k="top":"end"===s&&(k="bottom"));const B=this._getLabelSizes();for(m=0,g=a.length;m<g;++m){y=a[m],v=y.label;const e=o.setContext(this.getContext(m));C=this.getPixelForTick(m)+o.labelOffset,$=this._resolveTickFontOptions(m),_=$.lineHeight,S=isArray$4(v)?v.length:1;const t=S/2,n=e.color,s=e.textStrokeColor,c=e.textStrokeWidth;let d,p=w;if(i?(b=C,"inner"===w&&(p=m===g-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),E="top"===r?"near"===l||0!==f?-S*_+_/2:"center"===l?-B.highest.height/2-t*_+_:-B.highest.height+_/2:"near"===l||0!==f?_/2:"center"===l?B.highest.height/2-t*_:B.highest.height-S*_,u&&(E*=-1),0===f||e.showLabelBackdrop||(b+=_/2*Math.sin(f))):(x=C,E=(1-S)*_/2),e.showLabelBackdrop){const t=toPadding(e.backdropPadding),n=B.heights[m],r=B.widths[m];let o=E-t.top,i=0-t.left;switch(k){case"middle":o-=n/2;break;case"bottom":o-=n}switch(w){case"center":i-=r/2;break;case"right":i-=r;break;case"inner":m===g-1?i-=r:m>0&&(i-=r/2)}d={left:i,top:o,width:r+t.width,height:n+t.height,color:e.backdropColor}}A.push({label:v,font:$,textOffset:E,options:{rotation:f,color:n,strokeColor:s,strokeWidth:c,textAlign:p,textBaseline:k,translation:[b,x],backdrop:d}})}return A}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-toRadians(this.labelRotation))return"top"===e?"left":"right";let n="center";return"start"===t.align?n="left":"end"===t.align?n="right":"inner"===t.align&&(n="inner"),n}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:n,mirror:r,padding:o}}=this.options,i=e+o,a=this._getLabelSizes().widest.width;let s,l;return"left"===t?r?(l=this.right+o,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l+=a)):(l=this.right-i,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l=this.left)):"right"===t?r?(l=this.left+o,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l-=a)):(l=this.left+i,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l=this.right)):s="right",{textAlign:s,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;return"left"===t||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:n,top:r,width:o,height:i}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,o,i),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const n=this.ticks.findIndex(t=>t.value===e);if(n>=0){return t.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(e){const t=this.options.grid,n=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,i;const a=(e,t,r)=>{r.width&&r.color&&(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(o=0,i=r.length;o<i;++o){const e=r[o];t.drawOnChartArea&&a({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&a({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:n,grid:r}}=this,o=n.setContext(this.getContext()),i=n.display?o.width:0;if(!i)return;const a=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue;let l,c,u,d;this.isHorizontal()?(l=_alignPixel(e,this.left,i)-i/2,c=_alignPixel(e,this.right,a)+a/2,u=d=s):(u=_alignPixel(e,this.top,i)-i/2,d=_alignPixel(e,this.bottom,a)+a/2,l=c=s),t.save(),t.lineWidth=o.width,t.strokeStyle=o.color,t.beginPath(),t.moveTo(l,u),t.lineTo(c,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const t=this.ctx,n=this._computeLabelArea();n&&clipArea(t,n);const r=this.getLabelItems(e);for(const o of r){const e=o.options,n=o.font;renderText$1(t,o.label,0,o.textOffset,n,e)}n&&unclipArea(t)}drawTitle(){const{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;const o=toFont(n.font),i=toPadding(n.padding),a=n.align;let s=o.lineHeight/2;"bottom"===t||"center"===t||isObject$3(t)?(s+=i.bottom,isArray$4(n.text)&&(s+=o.lineHeight*(n.text.length-1))):s+=i.top;const{titleX:l,titleY:c,maxWidth:u,rotation:d}=titleArgs(this,s,t,a);renderText$1(e,n.text,0,0,o,{color:n.color,maxWidth:u,rotation:d,textAlign:titleAlign(a,t,r),textBaseline:"middle",translation:[l,c]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,n=valueOrDefault(e.grid&&e.grid.z,-1),r=valueOrDefault(e.border&&e.border.z,0);return this._isVisible()&&this.draw===Scale.prototype.draw?[{z:n,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:t,draw:e=>{this.drawLabels(e)}}]:[{z:t,draw:e=>{this.draw(e)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",r=[];let o,i;for(o=0,i=t.length;o<i;++o){const i=t[o];i[n]!==this.id||e&&i.type!==e||r.push(i)}return r}_resolveTickFontOptions(e){return toFont(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class TypedRegistry{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let n;isIChartComponent(t)&&(n=this.register(t));const r=this.items,o=e.id,i=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in r||(r[o]=e,registerDefaults(e,i,n),this.override&&defaults$2.override(e.id,e.overrides)),i}get(e){return this.items[e]}unregister(e){const t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in defaults$2[r]&&(delete defaults$2[r][n],this.override&&delete overrides[n])}}function registerDefaults(e,t,n){const r=merge$1(Object.create(null),[n?defaults$2.get(n):{},defaults$2.get(t),e.defaults]);defaults$2.set(t,r),e.defaultRoutes&&routeDefaults(t,e.defaultRoutes),e.descriptors&&defaults$2.describe(t,e.descriptors)}function routeDefaults(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),o=r.pop(),i=[e].concat(r).join("."),a=t[n].split("."),s=a.pop(),l=a.join(".");defaults$2.route(i,o,l,s)})}function isIChartComponent(e){return"id"in e&&"defaults"in e}class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element$2,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,n){[...t].forEach(t=>{const r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):each$1(t,t=>{const r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){const r=_capitalize(e);callback(n["before"+r],[],n),t[e](n),callback(n["after"+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){const r=t.get(e);if(void 0===r)throw new Error('"'+e+'" is not a registered '+n+".");return r}}var registry=new Registry;class PluginService{constructor(){this._init=[]}notify(e,t,n,r){"beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=r?this._descriptors(e).filter(r):this._descriptors(e),i=this._notify(o,e,t,n);return"afterDestroy"===t&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),i}_notify(e,t,n,r){r=r||{};for(const o of e){const e=o.plugin;if(!1===callback(e[n],[t,r,o.options],e)&&r.cancelable)return!1}return!0}invalidate(){isNullOrUndef(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const n=e&&e.config,r=valueOrDefault(n.options&&n.options.plugins,{}),o=allPlugins(n);return!1!==r||t?createDescriptors(e,o,r,t):[]}_notifyStateChanges(e){const t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,"stop"),this._notify(r(n,t),e,"start")}}function allPlugins(e){const t={},n=[],r=Object.keys(registry.plugins.items);for(let i=0;i<r.length;i++)n.push(registry.getPlugin(r[i]));const o=e.plugins||[];for(let i=0;i<o.length;i++){const e=o[i];-1===n.indexOf(e)&&(n.push(e),t[e.id]=!0)}return{plugins:n,localIds:t}}function getOpts(e,t){return t||!1!==e?!0===e?{}:e:null}function createDescriptors(e,{plugins:t,localIds:n},r,o){const i=[],a=e.getContext();for(const s of t){const t=s.id,l=getOpts(r[t],o);null!==l&&i.push({plugin:s,options:pluginOpts(e.config,{plugin:s,local:n[t]},l,a)})}return i}function pluginOpts(e,{plugin:t,local:n},r,o){const i=e.pluginScopeKeys(t),a=e.getOptionScopes(r,i);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function getIndexAxis(e,t){const n=defaults$2.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function getAxisFromDefaultScaleID(e,t){let n=e;return"_index_"===e?n=t:"_value_"===e&&(n="x"===t?"y":"x"),n}function getDefaultScaleIDFromAxis(e,t){return e===t?"_index_":"_value_"}function idMatchesAxis(e){if("x"===e||"y"===e||"r"===e)return e}function axisFromPosition(e){return"top"===e||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0}function determineAxis(e,...t){if(idMatchesAxis(e))return e;for(const n of t){const t=n.axis||axisFromPosition(n.position)||e.length>1&&idMatchesAxis(e[0].toLowerCase());if(t)return t}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function getAxisFromDataset(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function retrieveAxisFromDatasets(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return getAxisFromDataset(e,"x",n[0])||getAxisFromDataset(e,"y",n[0])}return{}}function mergeScaleConfig(e,t){const n=overrides[e.type]||{scales:{}},r=t.scales||{},o=getIndexAxis(e.type,t),i=Object.create(null);return Object.keys(r).forEach(t=>{const a=r[t];if(!isObject$3(a))return console.error(`Invalid scale configuration for scale: ${t}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const s=determineAxis(t,a,retrieveAxisFromDatasets(t,e),defaults$2.scales[a.type]),l=getDefaultScaleIDFromAxis(s,o),c=n.scales||{};i[t]=mergeIf(Object.create(null),[{axis:s},a,c[s],c[l]])}),e.data.datasets.forEach(n=>{const o=n.type||e.type,a=n.indexAxis||getIndexAxis(o,t),s=(overrides[o]||{}).scales||{};Object.keys(s).forEach(e=>{const t=getAxisFromDefaultScaleID(e,a),o=n[t+"AxisID"]||t;i[o]=i[o]||Object.create(null),mergeIf(i[o],[{axis:t},r[o],s[e]])})}),Object.keys(i).forEach(e=>{const t=i[e];mergeIf(t,[defaults$2.scales[t.type],defaults$2.scale])}),i}function initOptions(e){const t=e.options||(e.options={});t.plugins=valueOrDefault(t.plugins,{}),t.scales=mergeScaleConfig(e,t)}function initData(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}function initConfig(e){return(e=e||{}).data=initData(e.data),initOptions(e),e}const keyCache=new Map,keysCached=new Set;function cachedKeys(e,t){let n=keyCache.get(e);return n||(n=t(),keyCache.set(e,n),keysCached.add(n)),n}const addIfFound=(e,t,n)=>{const r=resolveObjectKey(t,n);void 0!==r&&e.add(r)};class Config{constructor(e){this._config=initConfig(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=initData(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),initOptions(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return cachedKeys(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return cachedKeys(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return cachedKeys(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id;return cachedKeys(`${this.type}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const n=this._scopeCache;let r=n.get(e);return r&&!t||(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){const{options:r,type:o}=this,i=this._cachedScopes(e,n),a=i.get(t);if(a)return a;const s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>addIfFound(s,e,t))),t.forEach(e=>addIfFound(s,r,e)),t.forEach(e=>addIfFound(s,overrides[o]||{},e)),t.forEach(e=>addIfFound(s,defaults$2,e)),t.forEach(e=>addIfFound(s,descriptors,e))});const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),keysCached.has(t)&&i.set(t,l),l}chartOptionScopes(){const{options:e,type:t}=this;return[e,overrides[t]||{},defaults$2.datasets[t]||{},{type:t},defaults$2,descriptors]}resolveNamedOptions(e,t,n,r=[""]){const o={$shared:!0},{resolver:i,subPrefixes:a}=getResolver(this._resolverCache,e,r);let s=i;if(needContext(i,t)){o.$shared=!1;s=_attachContext(i,n=isFunction$1(n)?n():n,this.createResolver(e,n,a))}for(const l of t)o[l]=s[l];return o}createResolver(e,t,n=[""],r){const{resolver:o}=getResolver(this._resolverCache,e,n);return isObject$3(t)?_attachContext(o,t,void 0,r):o}}function getResolver(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const o=n.join();let i=r.get(o);if(!i){i={resolver:_createResolver(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes("hover"))},r.set(o,i)}return i}const hasFunction=e=>isObject$3(e)&&Object.getOwnPropertyNames(e).some(t=>isFunction$1(e[t]));function needContext(e,t){const{isScriptable:n,isIndexable:r}=_descriptors(e);for(const o of t){const t=n(o),i=r(o),a=(i||t)&&e[o];if(t&&(isFunction$1(a)||hasFunction(a))||i&&isArray$4(a))return!0}return!1}var version$1="4.4.1";const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(e,t){return"top"===e||"bottom"===e||-1===KNOWN_POSITIONS.indexOf(e)&&"x"===t}function compare2Level(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function onAnimationsComplete(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),callback(n&&n.onComplete,[e],t)}function onAnimationProgress(e){const t=e.chart,n=t.options.animation;callback(n&&n.onProgress,[e],t)}function getCanvas(e){return _isDomSupported()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const instances={},getChart=e=>{const t=getCanvas(e);return Object.values(instances).filter(e=>e.canvas===t).pop()};function moveNumericKeys(e,t,n){const r=Object.keys(e);for(const o of r){const r=+o;if(r>=t){const i=e[o];delete e[o],(n>0||r>t)&&(e[r+n]=i)}}}function determineLastEvent(e,t,n,r){return n&&"mouseout"!==e.type?r?t:e:null}function getSizeForArea(e,t,n){return e.options.clip?e[n]:t[n]}function getDatasetArea(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:getSizeForArea(n,t,"left"),right:getSizeForArea(n,t,"right"),top:getSizeForArea(r,t,"top"),bottom:getSizeForArea(r,t,"bottom")}:t}let Chart$1=class{static defaults=defaults$2;static instances=instances;static overrides=overrides;static registry=registry;static version=version$1;static getChart=getChart;static register(...e){registry.add(...e),invalidatePlugins()}static unregister(...e){registry.remove(...e),invalidatePlugins()}constructor(e,t){const n=this.config=new Config(t),r=getCanvas(e),o=getChart(r);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const i=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||_detectPlatform(r)),this.platform.updateConfig(n);const a=this.platform.acquireContext(r,i.aspectRatio),s=a&&a.canvas,l=s&&s.height,c=s&&s.width;this.id=uid(),this.ctx=a,this.canvas=s,this.width=c,this.height=l,this._options=i,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 PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce(e=>this.update(e),i.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,a&&s?(animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:o}=this;return isNullOrUndef(e)?t&&o?o:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return registry}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(e,t){animator.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const n=this.options,r=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(r,e,t,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,retinaScale(this,a,!0)&&(this.notifyPlugins("resize",{size:i}),callback(n.onResize,[this,i],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){each$1(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){const e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{});let o=[];t&&(o=o.concat(Object.keys(t).map(e=>{const n=t[e],r=determineAxis(e,n),o="r"===r,i="x"===r;return{options:n,dposition:o?"chartArea":i?"bottom":"left",dtype:o?"radialLinear":i?"category":"linear"}}))),each$1(o,t=>{const o=t.options,i=o.id,a=determineAxis(i,o),s=valueOrDefault(o.type,t.dtype);void 0!==o.position&&positionIsHorizontal(o.position,a)===positionIsHorizontal(t.dposition)||(o.position=t.dposition),r[i]=!0;let l=null;if(i in n&&n[i].type===s)l=n[i];else{l=new(registry.getScale(s))({id:i,type:s,ctx:this.ctx,chart:this}),n[l.id]=l}l.init(o,e)}),each$1(r,(e,t)=>{e||delete n[t]}),each$1(n,e=>{layouts.configure(this,e,e.options),layouts.addBox(this,e)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(compare2Level("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{0===t.filter(t=>t===e._dataset).length&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){const r=t[n];let o=this.getDatasetMeta(n);const i=r.type||this.config.type;if(o.type&&o.type!==i&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=i,o.indexAxis=r.indexAxis||getIndexAxis(i,this.options),o.order=r.order||0,o.index=n,o.label=""+r.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const t=registry.getController(i),{datasetElementType:r,dataElementType:a}=defaults$2.datasets[i];Object.assign(t,{dataElementType:registry.getElement(a),datasetElementType:r&®istry.getElement(r)}),o.controller=new t(this,n),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){each$1(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let l=0,c=this.data.datasets.length;l<c;l++){const{controller:e}=this.getDatasetMeta(l),t=!r&&-1===o.indexOf(e);e.buildOrUpdateElements(t),i=Math.max(+e.getMaxOverflow(),i)}i=this._minPadding=n.layout.autoPadding?i:0,this._updateLayout(i),r||each$1(o,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(compare2Level("z","_idx"));const{_active:a,_lastEvent:s}=this;s?this._eventHandler(s,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){each$1(this.scales,e=>{layouts.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),n=new Set(e.events);setsEqual(t,n)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:n,start:r,count:o}of t){moveNumericKeys(e,r,"_removeElements"===n?-o:o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+","+e.splice(1).join(","))),r=n(0);for(let o=1;o<t;o++)if(!setsEqual(r,n(o)))return;return Array.from(r).map(e=>e.split(",")).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;layouts.update(this,this.width,this.height,e);const t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],each$1(this.boxes,e=>{n&&"chartArea"===e.position||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,isFunction$1(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",r)&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(animator.has(this)?this.attached&&!animator.running(this)&&animator.start(this):(this.draw(),onAnimationsComplete({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:e,height:t}=this._resizeBeforeDraw;this._resize(e,t),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,n=[];let r,o;for(r=0,o=t.length;r<o;++r){const o=t[r];e&&!o.visible||n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,n=e._clip,r=!n.disabled,o=getDatasetArea(e,this.chartArea),i={meta:e,index:e.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(r&&clipArea(t,{left:!1===n.left?0:o.left-n.left,right:!1===n.right?this.width:o.right+n.right,top:!1===n.top?0:o.top-n.top,bottom:!1===n.bottom?this.height:o.bottom+n.bottom}),e.controller.draw(),r&&unclipArea(t),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(e){return _isPointInArea(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){const o=Interaction.modes[t];return"function"==typeof o?o(this,e,n,r):[]}getDatasetMeta(e){const t=this.data.datasets[e],n=this._metasets;let r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const n=this.getDatasetMeta(e);return"boolean"==typeof n.hidden?!n.hidden:!t.hidden}setDatasetVisibility(e,t){this.getDatasetMeta(e).hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){const r=n?"show":"hide",o=this.getDatasetMeta(e),i=o.controller._resolveAnimations(void 0,r);defined(t)?(o.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),i.update(o,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),animator.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),clearCanvas(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete instances[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};each$1(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},o=(e,t)=>{this.canvas&&this.resize(e,t)};let i;const a=()=>{r("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",i)};i=()=>{this.attached=!1,r("resize",o),this._stop(),this._resize(0,0),n("attach",a)},t.isAttached(this.canvas)?a():i()}unbindEvents(){each$1(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},each$1(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){const r=n?"set":"remove";let o,i,a,s;for("dataset"===t&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+r+"DatasetHoverStyle"]()),a=0,s=e.length;a<s;++a){i=e[a];const t=i&&this.getDatasetMeta(i.datasetIndex).controller;t&&t[r+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{const n=this.getDatasetMeta(e);if(!n)throw new Error("No dataset found at index "+e);return{datasetIndex:e,element:n.data[t],index:t}});!_elementsEqual(n,t)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return 1===this._plugins._cache.filter(t=>t.plugin.id===e).length}_updateHoverStyles(e,t,n){const r=this.options.hover,o=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),i=o(t,e),a=n?e:o(e,t);i.length&&this.updateHoverStyle(i,r.mode,!1),a.length&&r.mode&&this.updateHoverStyle(a,r.mode,!0)}_eventHandler(e,t){const n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",n,r))return;const o=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,r),(o||n.changed)&&this.render(),this}_handleEvent(e,t,n){const{_active:r=[],options:o}=this,i=t,a=this._getActiveElements(e,r,n,i),s=_isClickEvent(e),l=determineLastEvent(e,this._lastEvent,n,s);n&&(this._lastEvent=null,callback(o.onHover,[e,a,this],this),s&&callback(o.onClick,[e,a,this],this));const c=!_elementsEqual(a,r);return(c||t)&&(this._active=a,this._updateHoverStyles(a,r,t)),this._lastEvent=l,c}_getActiveElements(e,t,n,r){if("mouseout"===e.type)return[];if(!n)return t;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,r)}};function invalidatePlugins(){return each$1(Chart$1.instances,e=>e._plugins.invalidate())}function clipArc(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:a,outerRadius:s,innerRadius:l}=t;let c=o/s;e.beginPath(),e.arc(i,a,s,r-c,n+c),l>o?(c=o/l,e.arc(i,a,l,n+c,r-c,!0)):e.arc(i,a,o,n+HALF_PI,r-HALF_PI),e.closePath(),e.clip()}function toRadiusCorners(e){return _readValueToProps(e,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(e,t,n,r){const o=toRadiusCorners(e.options.borderRadius),i=(n-t)/2,a=Math.min(i,r*t/2),s=e=>{const t=(n-Math.min(i,e))*r/2;return _limitValue(e,0,Math.min(i,t))};return{outerStart:s(o.outerStart),outerEnd:s(o.outerEnd),innerStart:_limitValue(o.innerStart,0,a),innerEnd:_limitValue(o.innerEnd,0,a)}}function rThetaToXY(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function pathArc(e,t,n,r,o,i){const{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),p=u>0?u+r+n+c:0;let h=0;const f=o-l;if(r){const e=((u>0?u-r:0)+(d>0?d-r:0))/2;h=(f-(0!==e?f*e/(e+r):f))/2}const A=(f-Math.max(.001,f*d-n/PI)/d)/2,m=l+A+h,g=o-A-h,{outerStart:y,outerEnd:v,innerStart:b,innerEnd:x}=parseBorderRadius$1(t,p,d,g-m),w=d-y,C=d-v,$=m+y/w,_=g-v/C,S=p+b,E=p+x,k=m+b/S,B=g-x/E;if(e.beginPath(),i){const t=($+_)/2;if(e.arc(a,s,d,$,t),e.arc(a,s,d,t,_),v>0){const t=rThetaToXY(C,_,a,s);e.arc(t.x,t.y,v,_,g+HALF_PI)}const n=rThetaToXY(E,g,a,s);if(e.lineTo(n.x,n.y),x>0){const t=rThetaToXY(E,B,a,s);e.arc(t.x,t.y,x,g+HALF_PI,B+Math.PI)}const r=(g-x/p+(m+b/p))/2;if(e.arc(a,s,p,g-x/p,r,!0),e.arc(a,s,p,r,m+b/p,!0),b>0){const t=rThetaToXY(S,k,a,s);e.arc(t.x,t.y,b,k+Math.PI,m-HALF_PI)}const o=rThetaToXY(w,m,a,s);if(e.lineTo(o.x,o.y),y>0){const t=rThetaToXY(w,$,a,s);e.arc(t.x,t.y,y,m-HALF_PI,$)}}else{e.moveTo(a,s);const t=Math.cos($)*d+a,n=Math.sin($)*d+s;e.lineTo(t,n);const r=Math.cos(_)*d+a,o=Math.sin(_)*d+s;e.lineTo(r,o)}e.closePath()}function drawArc(e,t,n,r,o){const{fullCircles:i,startAngle:a,circumference:s}=t;let l=t.endAngle;if(i){pathArc(e,t,n,r,l,o);for(let t=0;t<i;++t)e.fill();isNaN(s)||(l=a+(s%TAU||TAU))}return pathArc(e,t,n,r,l,o),e.fill(),l}function drawBorder(e,t,n,r,o){const{fullCircles:i,startAngle:a,circumference:s,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:p}=l,h="inner"===l.borderAlign;if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=p,h?(e.lineWidth=2*c,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let f=t.endAngle;if(i){pathArc(e,t,n,r,f,o);for(let t=0;t<i;++t)e.stroke();isNaN(s)||(f=a+(s%TAU||TAU))}h&&clipArc(e,t,f),i||(pathArc(e,t,n,r,f,o),e.stroke())}class ArcElement extends Element$2{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){const r=this.getProps(["x","y"],n),{angle:o,distance:i}=getAngleFromPoint(r,{x:e,y:t}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=(this.options.spacing+this.options.borderWidth)/2,p=valueOrDefault(u,s-a)>=TAU||_angleBetween(o,a,s),h=_isBetween(i,l+d,c+d);return p&&h}getCenterPoint(e){const{x:t,y:n,startAngle:r,endAngle:o,innerRadius:i,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:s,spacing:l}=this.options,c=(r+o)/2,u=(i+a+l+s)/2;return{x:t+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:n}=this,r=(t.offset||0)/4,o=(t.spacing||0)/2,i=t.circular;if(this.pixelMargin="inner"===t.borderAlign?.33:0,this.fullCircles=n>TAU?Math.floor(n/TAU):0,0===n||this.innerRadius<0||this.outerRadius<0)return;e.save();const a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*r,Math.sin(a)*r);const s=r*(1-Math.sin(Math.min(PI,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,drawArc(e,this,s,o,i),drawBorder(e,this,s,o,i),e.restore()}}function setStyle(e,t,n=t){e.lineCap=valueOrDefault(n.borderCapStyle,t.borderCapStyle),e.setLineDash(valueOrDefault(n.borderDash,t.borderDash)),e.lineDashOffset=valueOrDefault(n.borderDashOffset,t.borderDashOffset),e.lineJoin=valueOrDefault(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=valueOrDefault(n.borderWidth,t.borderWidth),e.strokeStyle=valueOrDefault(n.borderColor,t.borderColor)}function lineTo(e,t,n){e.lineTo(n.x,n.y)}function getLineMethod(e){return e.stepped?_steppedLineTo:e.tension||"monotone"===e.cubicInterpolationMode?_bezierCurveTo:lineTo}function pathVars(e,t,n={}){const r=e.length,{start:o=0,end:i=r-1}=n,{start:a,end:s}=t,l=Math.max(o,a),c=Math.min(i,s),u=o<a&&i<a||o>s&&i>s;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function pathSegment(e,t,n,r){const{points:o,options:i}=t,{count:a,start:s,loop:l,ilen:c}=pathVars(o,n,r),u=getLineMethod(i);let d,p,h,{move:f=!0,reverse:A}=r||{};for(d=0;d<=c;++d)p=o[(s+(A?c-d:d))%a],p.skip||(f?(e.moveTo(p.x,p.y),f=!1):u(e,h,p,A,i.stepped),h=p);return l&&(p=o[(s+(A?c:0))%a],u(e,h,p,A,i.stepped)),!!l}function fastPathSegment(e,t,n,r){const o=t.points,{count:i,start:a,ilen:s}=pathVars(o,n,r),{move:l=!0,reverse:c}=r||{};let u,d,p,h,f,A,m=0,g=0;const y=e=>(a+(c?s-e:e))%i,v=()=>{h!==f&&(e.lineTo(m,f),e.lineTo(m,h),e.lineTo(m,A))};for(l&&(d=o[y(0)],e.moveTo(d.x,d.y)),u=0;u<=s;++u){if(d=o[y(u)],d.skip)continue;const t=d.x,n=d.y,r=0|t;r===p?(n<h?h=n:n>f&&(f=n),m=(g*m+t)/++g):(v(),e.lineTo(t,n),p=r,g=0,h=f=n),A=n}v()}function _getSegmentMethod(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!(e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||n)?fastPathSegment:pathSegment}function _getInterpolationMethod(e){return e.stepped?_steppedInterpolation:e.tension||"monotone"===e.cubicInterpolationMode?_bezierInterpolation:_pointInLine}function strokePathWithCache(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),setStyle(e,t.options),e.stroke(o)}function strokePathDirect(e,t,n,r){const{segments:o,options:i}=t,a=_getSegmentMethod(t);for(const s of o)setStyle(e,i,s.style),e.beginPath(),a(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const usePath2D="function"==typeof Path2D;function draw(e,t,n,r){usePath2D&&!t.options.segment?strokePathWithCache(e,t,n,r):strokePathDirect(e,t,n,r)}class LineElement extends Element$2{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e&&"fill"!==e};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const r=n.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){const n=this.options,r=e[t],o=this.points,i=_boundSegments(this,{property:t,start:r,end:r});if(!i.length)return;const a=[],s=_getInterpolationMethod(n);let l,c;for(l=0,c=i.length;l<c;++l){const{start:c,end:u}=i[l],d=o[c],p=o[u];if(d===p){a.push(d);continue}const h=s(d,p,Math.abs((r-d[t])/(p[t]-d[t])),n.stepped);h[t]=e[t],a.push(h)}return 1===a.length?a[0]:a}pathSegment(e,t,n){return _getSegmentMethod(this)(e,this,t,n)}path(e,t,n){const r=this.segments,o=_getSegmentMethod(this);let i=this._loop;t=t||0,n=n||this.points.length-t;for(const a of r)i&=o(e,this,a,{start:t,end:t+n-1});return!!i}draw(e,t,n,r){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),draw(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function inRange$1(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class PointElement extends Element$2{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){const r=this.options,{x:o,y:i}=this.getProps(["x","y"],n);return Math.pow(e-o,2)+Math.pow(t-i,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,t){return inRange$1(this,e,"x",t)}inYRange(e,t){return inRange$1(this,e,"y",t)}getCenterPoint(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}size(e){let t=(e=e||this.options||{}).radius||0;t=Math.max(t,t&&e.hoverRadius||0);return 2*(t+(t&&e.borderWidth||0))}draw(e,t){const n=this.options;this.skip||n.radius<.1||!_isPointInArea(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,drawPoint(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}function getBarBounds(e,t){const{x:n,y:r,base:o,width:i,height:a}=e.getProps(["x","y","base","width","height"],t);let s,l,c,u,d;return e.horizontal?(d=a/2,s=Math.min(n,o),l=Math.max(n,o),c=r-d,u=r+d):(d=i/2,s=n-d,l=n+d,c=Math.min(r,o),u=Math.max(r,o)),{left:s,top:c,right:l,bottom:u}}function skipOrLimit(e,t,n,r){return e?0:_limitValue(t,n,r)}function parseBorderWidth(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=toTRBL(r);return{t:skipOrLimit(o.top,i.top,0,n),r:skipOrLimit(o.right,i.right,0,t),b:skipOrLimit(o.bottom,i.bottom,0,n),l:skipOrLimit(o.left,i.left,0,t)}}function parseBorderRadius(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=toTRBLCorners(o),a=Math.min(t,n),s=e.borderSkipped,l=r||isObject$3(o);return{topLeft:skipOrLimit(!l||s.top||s.left,i.topLeft,0,a),topRight:skipOrLimit(!l||s.top||s.right,i.topRight,0,a),bottomLeft:skipOrLimit(!l||s.bottom||s.left,i.bottomLeft,0,a),bottomRight:skipOrLimit(!l||s.bottom||s.right,i.bottomRight,0,a)}}function boundingRects(e){const t=getBarBounds(e),n=t.right-t.left,r=t.bottom-t.top,o=parseBorderWidth(e,n/2,r/2),i=parseBorderRadius(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:i},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function inRange(e,t,n,r){const o=null===t,i=null===n,a=e&&!(o&&i)&&getBarBounds(e,r);return a&&(o||_isBetween(t,a.left,a.right))&&(i||_isBetween(n,a.top,a.bottom))}function hasRadius(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function addNormalRectPath(e,t){e.rect(t.x,t.y,t.w,t.h)}function inflateRect(e,t,n={}){const r=e.x!==n.x?-t:0,o=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,a=(e.y+e.h!==n.y+n.h?t:0)-o;return{x:e.x+r,y:e.y+o,w:e.w+i,h:e.h+a,radius:e.radius}}class BarElement extends Element$2{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:n,backgroundColor:r}}=this,{inner:o,outer:i}=boundingRects(this),a=hasRadius(i.radius)?addRoundedRectPath:addNormalRectPath;e.save(),i.w===o.w&&i.h===o.h||(e.beginPath(),a(e,inflateRect(i,t,o)),e.clip(),a(e,inflateRect(o,-t,i)),e.fillStyle=n,e.fill("evenodd")),e.beginPath(),a(e,inflateRect(o,t)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,t,n){return inRange(this,e,t,n)}inXRange(e,t){return inRange(this,e,null,t)}inYRange(e,t){return inRange(this,null,e,t)}getCenterPoint(e){const{x:t,y:n,base:r,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(t+r)/2:t,y:o?n:(n+r)/2}}getRange(e){return"x"===e?this.width/2:this.height/2}}const getBoxSize=(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)}},itemsEqual=(e,t)=>null!==e&&null!==t&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Legend extends Element$2{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=callback(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display)return void(this.width=this.height=0);const n=e.labels,r=toFont(n.font),o=r.size,i=this._computeTitleHeight(),{boxWidth:a,itemHeight:s}=getBoxSize(n,o);let l,c;t.font=r.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(i,o,a,s)+10):(c=this.maxHeight,l=this._fitCols(i,r,a,s)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){const{ctx:o,maxWidth:i,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],c=r+a;let u=e;o.textAlign="left",o.textBaseline="middle";let d=-1,p=-c;return this.legendItems.forEach((e,h)=>{const f=n+t/2+o.measureText(e.text).width;(0===h||l[l.length-1]+f+2*a>i)&&(u+=c,l[l.length-(h>0?0:1)]=0,p+=c,d++),s[h]={left:0,top:p,row:d,width:f,height:r},l[l.length-1]+=f+a}),u}_fitCols(e,t,n,r){const{ctx:o,maxHeight:i,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],c=i-e;let u=a,d=0,p=0,h=0,f=0;return this.legendItems.forEach((e,i)=>{const{itemWidth:A,itemHeight:m}=calculateItemSize(n,t,o,e,r);i>0&&p+m+2*a>c&&(u+=d+a,l.push({width:d,height:p}),h+=d+a,f++,d=p=0),s[i]={left:h,top:p,col:f,width:A,height:m},d=Math.max(d,A),p+=m+a}),u+=d,l.push({width:d,height:p}),u}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:o}}=this,i=getRtlAdapter(o,this.left,this.width);if(this.isHorizontal()){let o=0,a=_alignStartEnd(n,this.left+r,this.right-this.lineWidths[o]);for(const s of t)o!==s.row&&(o=s.row,a=_alignStartEnd(n,this.left+r,this.right-this.lineWidths[o])),s.top+=this.top+e+r,s.left=i.leftForLtr(i.x(a),s.width),a+=s.width+r}else{let o=0,a=_alignStartEnd(n,this.top+e+r,this.bottom-this.columnSizes[o].height);for(const s of t)s.col!==o&&(o=s.col,a=_alignStartEnd(n,this.top+e+r,this.bottom-this.columnSizes[o].height)),s.top=a,s.left+=this.left+r,s.left=i.leftForLtr(i.x(s.left),s.width),a+=s.height+r}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const e=this.ctx;clipArea(e,this),this._draw(),unclipArea(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:o,labels:i}=e,a=defaults$2.color,s=getRtlAdapter(e.rtl,this.left,this.width),l=toFont(i.font),{padding:c}=i,u=l.size,d=u/2;let p;this.drawTitle(),r.textAlign=s.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=l.string;const{boxWidth:h,boxHeight:f,itemHeight:A}=getBoxSize(i,u),m=this.isHorizontal(),g=this._computeTitleHeight();p=m?{x:_alignStartEnd(o,this.left+c,this.right-n[0]),y:this.top+c+g,line:0}:{x:this.left+c,y:_alignStartEnd(o,this.top+g+c,this.bottom-t[0].height),line:0},overrideTextDirection(this.ctx,e.textDirection);const y=A+c;this.legendItems.forEach((v,b)=>{r.strokeStyle=v.fontColor,r.fillStyle=v.fontColor;const x=r.measureText(v.text).width,w=s.textAlign(v.textAlign||(v.textAlign=i.textAlign)),C=h+d+x;let $=p.x,_=p.y;s.setWidth(this.width),m?b>0&&$+C+c>this.right&&(_=p.y+=y,p.line++,$=p.x=_alignStartEnd(o,this.left+c,this.right-n[p.line])):b>0&&_+y>this.bottom&&($=p.x=$+t[p.line].width+c,p.line++,_=p.y=_alignStartEnd(o,this.top+g+c,this.bottom-t[p.line].height));if(function(e,t,n){if(isNaN(h)||h<=0||isNaN(f)||f<0)return;r.save();const o=valueOrDefault(n.lineWidth,1);if(r.fillStyle=valueOrDefault(n.fillStyle,a),r.lineCap=valueOrDefault(n.lineCap,"butt"),r.lineDashOffset=valueOrDefault(n.lineDashOffset,0),r.lineJoin=valueOrDefault(n.lineJoin,"miter"),r.lineWidth=o,r.strokeStyle=valueOrDefault(n.strokeStyle,a),r.setLineDash(valueOrDefault(n.lineDash,[])),i.usePointStyle){const a={radius:f*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:o},l=s.xPlus(e,h/2);drawPointLegend(r,a,l,t+d,i.pointStyleWidth&&h)}else{const i=t+Math.max((u-f)/2,0),a=s.leftForLtr(e,h),l=toTRBLCorners(n.borderRadius);r.beginPath(),Object.values(l).some(e=>0!==e)?addRoundedRectPath(r,{x:a,y:i,w:h,h:f,radius:l}):r.rect(a,i,h,f),r.fill(),0!==o&&r.stroke()}r.restore()}(s.x($),_,v),$=_textX(w,$+h+d,m?$+C:this.right,e.rtl),function(e,t,n){renderText$1(r,n.text,e,t+A/2,l,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})}(s.x($),_,v),m)p.x+=C+c;else if("string"!=typeof v.text){const e=l.lineHeight;p.y+=calculateLegendItemHeight(v,e)+c}else p.y+=y}),restoreTextDirection(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,n=toFont(t.font),r=toPadding(t.padding);if(!t.display)return;const o=getRtlAdapter(e.rtl,this.left,this.width),i=this.ctx,a=t.position,s=n.size/2,l=r.top+s;let c,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,u=_alignStartEnd(e.align,u,this.right-d);else{const t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);c=l+_alignStartEnd(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}const p=_alignStartEnd(a,u,u+d);i.textAlign=o.textAlign(_toLeftRightCenter(a)),i.textBaseline="middle",i.strokeStyle=t.color,i.fillStyle=t.color,i.font=n.string,renderText$1(i,t.text,p,c,n)}_computeTitleHeight(){const e=this.options.title,t=toFont(e.font),n=toPadding(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,o;if(_isBetween(e,this.left,this.right)&&_isBetween(t,this.top,this.bottom))for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(r=o[n],_isBetween(e,r.left,r.left+r.width)&&_isBetween(t,r.top,r.top+r.height))return this.legendItems[n];return null}handleEvent(e){const t=this.options;if(!isListened(e.type,t))return;const n=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){const r=this._hoveredItem,o=itemsEqual(r,n);r&&!o&&callback(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!o&&callback(t.onHover,[e,n,this],this)}else n&&callback(t.onClick,[e,n,this],this)}}function calculateItemSize(e,t,n,r,o){return{itemWidth:calculateItemWidth(r,e,t,n),itemHeight:calculateItemHeight(o,r,t.lineHeight)}}function calculateItemWidth(e,t,n,r){let o=e.text;return o&&"string"!=typeof o&&(o=o.reduce((e,t)=>e.length>t.length?e:t)),t+n.size/2+r.measureText(o).width}function calculateItemHeight(e,t,n){let r=e;return"string"!=typeof t.text&&(r=calculateLegendItemHeight(t,n)),r}function calculateLegendItemHeight(e,t){return t*(e.text?e.text.length:0)}function isListened(e,t){return!("mousemove"!==e&&"mouseout"!==e||!t.onHover&&!t.onLeave)||!(!t.onClick||"click"!==e&&"mouseup"!==e)}var plugin_legend={id:"legend",_element:Legend,start(e,t,n){const r=e.legend=new Legend({ctx:e.ctx,options:n,chart:e});layouts.configure(e,r,n),layouts.addBox(e,r)},stop(e){layouts.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;layouts.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,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),t.hidden=!0):(o.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:o,color:i,useBorderRadius:a,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{const l=e.controller.getStyle(n?0:void 0),c=toPadding(l.borderWidth);return{text:t[e.index].label,fillStyle:l.backgroundColor,fontColor:i,hidden:!e.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:o||l.textAlign,borderRadius:a&&(s||l.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Title extends Element$2{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t){const n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=e,this.height=this.bottom=t;const r=isArray$4(n.text)?n.text.length:1;this._padding=toPadding(n.padding);const o=r*toFont(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return"top"===e||"bottom"===e}_drawArgs(e){const{top:t,left:n,bottom:r,right:o,options:i}=this,a=i.align;let s,l,c,u=0;return this.isHorizontal()?(l=_alignStartEnd(a,n,o),c=t+e,s=o-n):("left"===i.position?(l=n+e,c=_alignStartEnd(a,r,t),u=-.5*PI):(l=o-e,c=_alignStartEnd(a,t,r),u=.5*PI),s=r-t),{titleX:l,titleY:c,maxWidth:s,rotation:u}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const n=toFont(t.font),r=n.lineHeight/2+this._padding.top,{titleX:o,titleY:i,maxWidth:a,rotation:s}=this._drawArgs(r);renderText$1(e,t.text,0,0,n,{color:t.color,maxWidth:a,rotation:s,textAlign:_toLeftRightCenter(t.align),textBaseline:"middle",translation:[o,i]})}}function createTitle(e,t){const n=new Title({ctx:e.ctx,options:t,chart:e});layouts.configure(e,n,t),layouts.addBox(e,n),e.titleBlock=n}var plugin_title={id:"title",_element:Title,start(e,t,n){createTitle(e,n)},stop(e){const t=e.titleBlock;layouts.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;layouts.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 positioners={average(e){if(!e.length)return!1;let t,n,r=0,o=0,i=0;for(t=0,n=e.length;t<n;++t){const n=e[t].element;if(n&&n.hasValue()){const e=n.tooltipPosition();r+=e.x,o+=e.y,++i}}return{x:r/i,y:o/i}},nearest(e,t){if(!e.length)return!1;let n,r,o,i=t.x,a=t.y,s=Number.POSITIVE_INFINITY;for(n=0,r=e.length;n<r;++n){const r=e[n].element;if(r&&r.hasValue()){const e=distanceBetweenPoints(t,r.getCenterPoint());e<s&&(s=e,o=r)}}if(o){const e=o.tooltipPosition();i=e.x,a=e.y}return{x:i,y:a}}};function pushOrConcat(e,t){return t&&(isArray$4(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function splitNewlines(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function createTooltipItem(e,t){const{element:n,datasetIndex:r,index:o}=t,i=e.getDatasetMeta(r).controller,{label:a,value:s}=i.getLabelAndValue(o);return{chart:e,label:a,parsed:i.getParsed(o),raw:e.data.datasets[r].data[o],formattedValue:s,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function getTooltipSize(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:a,boxHeight:s}=t,l=toFont(t.bodyFont),c=toFont(t.titleFont),u=toFont(t.footerFont),d=i.length,p=o.length,h=r.length,f=toPadding(t.padding);let A=f.height,m=0,g=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(g+=e.beforeBody.length+e.afterBody.length,d&&(A+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),g){A+=h*(t.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(g-h)*l.lineHeight+(g-1)*t.bodySpacing}p&&(A+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let y=0;const v=function(e){m=Math.max(m,n.measureText(e).width+y)};return n.save(),n.font=c.string,each$1(e.title,v),n.font=l.string,each$1(e.beforeBody.concat(e.afterBody),v),y=t.displayColors?a+2+t.boxPadding:0,each$1(r,e=>{each$1(e.before,v),each$1(e.lines,v),each$1(e.after,v)}),y=0,n.font=u.string,each$1(e.footer,v),n.restore(),m+=f.width,{width:m,height:A}}function determineYAlign(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function doesNotFitWithAlign(e,t,n,r){const{x:o,width:i}=r,a=n.caretSize+n.caretPadding;return"left"===e&&o+i+a>t.width||("right"===e&&o-i-a<0||void 0)}function determineXAlign(e,t,n,r){const{x:o,width:i}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return"center"===r?c=o<=(s+l)/2?"left":"right":o<=i/2?c="left":o>=a-i/2&&(c="right"),doesNotFitWithAlign(c,e,t,n)&&(c="center"),c}function determineAlignment(e,t,n){const r=n.yAlign||t.yAlign||determineYAlign(e,n);return{xAlign:n.xAlign||t.xAlign||determineXAlign(e,t,n,r),yAlign:r}}function alignX(e,t){let{x:n,width:r}=e;return"right"===t?n-=r:"center"===t&&(n-=r/2),n}function alignY(e,t,n){let{y:r,height:o}=e;return"top"===t?r+=n:r-="bottom"===t?o+n:o/2,r}function getBackgroundPoint(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=o+i,{topLeft:u,topRight:d,bottomLeft:p,bottomRight:h}=toTRBLCorners(a);let f=alignX(t,s);const A=alignY(t,l,c);return"center"===l?"left"===s?f+=c:"right"===s&&(f-=c):"left"===s?f-=Math.max(u,p)+o:"right"===s&&(f+=Math.max(d,h)+o),{x:_limitValue(f,0,r.width-t.width),y:_limitValue(A,0,r.height-t.height)}}function getAlignedX(e,t,n){const r=toPadding(n.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-r.right:e.x+r.left}function getBeforeAfterBodyLines(e){return pushOrConcat([],splitNewlines(e))}function createTooltipContext(e,t,n){return createContext(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function overrideCallbacks(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const defaultCallbacks={beforeTitle:noop$5,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:noop$5,beforeBody:noop$5,beforeLabel:noop$5,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return isNullOrUndef(n)||(t+=n),t},labelColor(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:noop$5,afterBody:noop$5,beforeFooter:noop$5,footer:noop$5,afterFooter:noop$5};function invokeCallbackWithFallback(e,t,n,r){const o=e[t].call(n,r);return void 0===o?defaultCallbacks[t].call(n,r):o}let Tooltip$1=class extends Element$2{static positioners=positioners;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,o=new Animations(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:n}=t,r=invokeCallbackWithFallback(n,"beforeTitle",this,e),o=invokeCallbackWithFallback(n,"title",this,e),i=invokeCallbackWithFallback(n,"afterTitle",this,e);let a=[];return a=pushOrConcat(a,splitNewlines(r)),a=pushOrConcat(a,splitNewlines(o)),a=pushOrConcat(a,splitNewlines(i)),a}getBeforeBody(e,t){return getBeforeAfterBodyLines(invokeCallbackWithFallback(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:n}=t,r=[];return each$1(e,e=>{const t={before:[],lines:[],after:[]},o=overrideCallbacks(n,e);pushOrConcat(t.before,splitNewlines(invokeCallbackWithFallback(o,"beforeLabel",this,e))),pushOrConcat(t.lines,invokeCallbackWithFallback(o,"label",this,e)),pushOrConcat(t.after,splitNewlines(invokeCallbackWithFallback(o,"afterLabel",this,e))),r.push(t)}),r}getAfterBody(e,t){return getBeforeAfterBodyLines(invokeCallbackWithFallback(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:n}=t,r=invokeCallbackWithFallback(n,"beforeFooter",this,e),o=invokeCallbackWithFallback(n,"footer",this,e),i=invokeCallbackWithFallback(n,"afterFooter",this,e);let a=[];return a=pushOrConcat(a,splitNewlines(r)),a=pushOrConcat(a,splitNewlines(o)),a=pushOrConcat(a,splitNewlines(i)),a}_createItems(e){const t=this._active,n=this.chart.data,r=[],o=[],i=[];let a,s,l=[];for(a=0,s=t.length;a<s;++a)l.push(createTooltipItem(this.chart,t[a]));return e.filter&&(l=l.filter((t,r,o)=>e.filter(t,r,o,n))),e.itemSort&&(l=l.sort((t,r)=>e.itemSort(t,r,n))),each$1(l,t=>{const n=overrideCallbacks(e.callbacks,t);r.push(invokeCallbackWithFallback(n,"labelColor",this,t)),o.push(invokeCallbackWithFallback(n,"labelPointStyle",this,t)),i.push(invokeCallbackWithFallback(n,"labelTextColor",this,t))}),this.labelColors=r,this.labelPointStyles=o,this.labelTextColors=i,this.dataPoints=l,l}update(e,t){const n=this.options.setContext(this.getContext()),r=this._active;let o,i=[];if(r.length){const e=positioners[n.position].call(this,r,this._eventPosition);i=this._createItems(n),this.title=this.getTitle(i,n),this.beforeBody=this.getBeforeBody(i,n),this.body=this.getBody(i,n),this.afterBody=this.getAfterBody(i,n),this.footer=this.getFooter(i,n);const t=this._size=getTooltipSize(this,n),a=Object.assign({},e,t),s=determineAlignment(this.chart,n,a),l=getBackgroundPoint(n,a,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,o={opacity:1,x:l.x,y:l.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}else 0!==this.opacity&&(o={opacity:0});this._tooltipItems=i,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){const o=this.getCaretPosition(e,n,r);t.lineTo(o.x1,o.y1),t.lineTo(o.x2,o.y2),t.lineTo(o.x3,o.y3)}getCaretPosition(e,t,n){const{xAlign:r,yAlign:o}=this,{caretSize:i,cornerRadius:a}=n,{topLeft:s,topRight:l,bottomLeft:c,bottomRight:u}=toTRBLCorners(a),{x:d,y:p}=e,{width:h,height:f}=t;let A,m,g,y,v,b;return"center"===o?(v=p+f/2,"left"===r?(A=d,m=A-i,y=v+i,b=v-i):(A=d+h,m=A+i,y=v-i,b=v+i),g=A):(m="left"===r?d+Math.max(s,c)+i:"right"===r?d+h-Math.max(l,u)-i:this.caretX,"top"===o?(y=p,v=y-i,A=m-i,g=m+i):(y=p+f,v=y+i,A=m+i,g=m-i),b=y),{x1:A,x2:m,x3:g,y1:y,y2:v,y3:b}}drawTitle(e,t,n){const r=this.title,o=r.length;let i,a,s;if(o){const l=getRtlAdapter(n.rtl,this.x,this.width);for(e.x=getAlignedX(this,n.titleAlign,n),t.textAlign=l.textAlign(n.titleAlign),t.textBaseline="middle",i=toFont(n.titleFont),a=n.titleSpacing,t.fillStyle=n.titleColor,t.font=i.string,s=0;s<o;++s)t.fillText(r[s],l.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+a,s+1===o&&(e.y+=n.titleMarginBottom-a)}}_drawColorBox(e,t,n,r,o){const i=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:s,boxWidth:l}=o,c=toFont(o.bodyFont),u=getAlignedX(this,"left",o),d=r.x(u),p=s<c.lineHeight?(c.lineHeight-s)/2:0,h=t.y+p;if(o.usePointStyle){const t={radius:Math.min(l,s)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},n=r.leftForLtr(d,l)+l/2,c=h+s/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,drawPoint(e,t,n,c),e.strokeStyle=i.borderColor,e.fillStyle=i.backgroundColor,drawPoint(e,t,n,c)}else{e.lineWidth=isObject$3(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,e.strokeStyle=i.borderColor,e.setLineDash(i.borderDash||[]),e.lineDashOffset=i.borderDashOffset||0;const t=r.leftForLtr(d,l),n=r.leftForLtr(r.xPlus(d,1),l-2),a=toTRBLCorners(i.borderRadius);Object.values(a).some(e=>0!==e)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,addRoundedRectPath(e,{x:t,y:h,w:l,h:s,radius:a}),e.fill(),e.stroke(),e.fillStyle=i.backgroundColor,e.beginPath(),addRoundedRectPath(e,{x:n,y:h+1,w:l-2,h:s-2,radius:a}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(t,h,l,s),e.strokeRect(t,h,l,s),e.fillStyle=i.backgroundColor,e.fillRect(n,h+1,l-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){const{body:r}=this,{bodySpacing:o,bodyAlign:i,displayColors:a,boxHeight:s,boxWidth:l,boxPadding:c}=n,u=toFont(n.bodyFont);let d=u.lineHeight,p=0;const h=getRtlAdapter(n.rtl,this.x,this.width),f=function(n){t.fillText(n,h.x(e.x+p),e.y+d/2),e.y+=d+o},A=h.textAlign(i);let m,g,y,v,b,x,w;for(t.textAlign=i,t.textBaseline="middle",t.font=u.string,e.x=getAlignedX(this,A,n),t.fillStyle=n.bodyColor,each$1(this.beforeBody,f),p=a&&"right"!==A?"center"===i?l/2+c:l+2+c:0,v=0,x=r.length;v<x;++v){for(m=r[v],g=this.labelTextColors[v],t.fillStyle=g,each$1(m.before,f),y=m.lines,a&&y.length&&(this._drawColorBox(t,e,v,h,n),d=Math.max(u.lineHeight,s)),b=0,w=y.length;b<w;++b)f(y[b]),d=u.lineHeight;each$1(m.after,f)}p=0,d=u.lineHeight,each$1(this.afterBody,f),e.y-=o}drawFooter(e,t,n){const r=this.footer,o=r.length;let i,a;if(o){const s=getRtlAdapter(n.rtl,this.x,this.width);for(e.x=getAlignedX(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline="middle",i=toFont(n.footerFont),t.fillStyle=n.footerColor,t.font=i.string,a=0;a<o;++a)t.fillText(r[a],s.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){const{xAlign:o,yAlign:i}=this,{x:a,y:s}=e,{width:l,height:c}=n,{topLeft:u,topRight:d,bottomLeft:p,bottomRight:h}=toTRBLCorners(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(a+u,s),"top"===i&&this.drawCaret(e,t,n,r),t.lineTo(a+l-d,s),t.quadraticCurveTo(a+l,s,a+l,s+d),"center"===i&&"right"===o&&this.drawCaret(e,t,n,r),t.lineTo(a+l,s+c-h),t.quadraticCurveTo(a+l,s+c,a+l-h,s+c),"bottom"===i&&this.drawCaret(e,t,n,r),t.lineTo(a+p,s+c),t.quadraticCurveTo(a,s+c,a,s+c-p),"center"===i&&"left"===o&&this.drawCaret(e,t,n,r),t.lineTo(a,s+u),t.quadraticCurveTo(a,s,a+u,s),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,n=this.$animations,r=n&&n.x,o=n&&n.y;if(r||o){const n=positioners[e.position].call(this,this._active,this._eventPosition);if(!n)return;const i=this._size=getTooltipSize(this,e),a=Object.assign({},n,this._size),s=determineAlignment(t,e,a),l=getBackgroundPoint(e,a,s,t);r._to===l.x&&o._to===l.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=i.width,this.height=i.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(t);const r={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const i=toPadding(t.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&a&&(e.save(),e.globalAlpha=n,this.drawBackground(o,e,r,t),overrideTextDirection(e,t.textDirection),o.y+=i.top,this.drawTitle(o,e,t),this.drawBody(o,e,t),this.drawFooter(o,e,t),restoreTextDirection(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const n=this._active,r=e.map(({datasetIndex:e,index:t})=>{const n=this.chart.getDatasetMeta(e);if(!n)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:n.data[t],index:t}}),o=!_elementsEqual(n,r),i=this._positionChanged(r,t);(o||i)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,o=this._active||[],i=this._getActiveElements(e,o,t,n),a=this._positionChanged(i,e),s=t||!_elementsEqual(i,o)||a;return s&&(this._active=i,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){const o=this.options;if("mouseout"===e.type)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&void 0!==this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index));const i=this.chart.getElementsAtEventForMode(e,o.mode,o,n);return o.reverse&&i.reverse(),i}_positionChanged(e,t){const{caretX:n,caretY:r,options:o}=this,i=positioners[o.position].call(this,e,t);return!1!==i&&(n!==i.x||r!==i.y)}};var plugin_tooltip={id:"tooltip",_element:Tooltip$1,positioners:positioners,afterInit(e,t,n){n&&(e.tooltip=new Tooltip$1({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(!1===e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0}))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:defaultCallbacks},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>"filter"!==e&&"itemSort"!==e&&"external"!==e,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=(e,t,n,r)=>("string"==typeof t?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function findOrAddLabel(e,t,n,r){const o=e.indexOf(t);if(-1===o)return addIfString(e,t,n,r);return o!==e.lastIndexOf(t)?n:o}const validIndex=(e,t)=>null===e?null:_limitValue(Math.round(e),0,t);function _getLabelForValue(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class CategoryScale extends Scale{static id="category";static defaults={ticks:{callback:_getLabelForValue}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const e=this.getLabels();for(const{index:n,label:r}of t)e[n]===r&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(isNullOrUndef(e))return null;const n=this.getLabels();return t=isFinite(t)&&n[t]===e?t:findOrAddLabel(n,e,valueOrDefault(t,e),this._addedLabels),validIndex(t,n.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:n,max:r}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(n=0),t||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){const e=this.min,t=this.max,n=this.options.offset,r=[];let o=this.getLabels();o=0===e&&t===o.length-1?o:o.slice(e,t+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let i=e;i<=t;i++)r.push({value:i});return r}getLabelForValue(e){return _getLabelForValue.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return"number"!=typeof e&&(e=this.parse(e)),null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function generateTicks$1(e,t){const n=[],{bounds:r,step:o,min:i,max:a,precision:s,count:l,maxTicks:c,maxDigits:u,includeBounds:d}=e,p=o||1,h=c-1,{min:f,max:A}=t,m=!isNullOrUndef(i),g=!isNullOrUndef(a),y=!isNullOrUndef(l),v=(A-f)/(u+1);let b,x,w,C,$=niceNum((A-f)/h/p)*p;if($<1e-14&&!m&&!g)return[{value:f},{value:A}];C=Math.ceil(A/$)-Math.floor(f/$),C>h&&($=niceNum(C*$/h/p)*p),isNullOrUndef(s)||(b=Math.pow(10,s),$=Math.ceil($*b)/b),"ticks"===r?(x=Math.floor(f/$)*$,w=Math.ceil(A/$)*$):(x=f,w=A),m&&g&&o&&almostWhole((a-i)/o,$/1e3)?(C=Math.round(Math.min((a-i)/$,c)),$=(a-i)/C,x=i,w=a):y?(x=m?i:x,w=g?a:w,C=l-1,$=(w-x)/C):(C=(w-x)/$,C=almostEquals(C,Math.round(C),$/1e3)?Math.round(C):Math.ceil(C));const _=Math.max(_decimalPlaces($),_decimalPlaces(x));b=Math.pow(10,isNullOrUndef(s)?_:s),x=Math.round(x*b)/b,w=Math.round(w*b)/b;let S=0;for(m&&(d&&x!==i?(n.push({value:i}),x<i&&S++,almostEquals(Math.round((x+S*$)*b)/b,i,relativeLabelSize(i,v,e))&&S++):x<i&&S++);S<C;++S){const e=Math.round((x+S*$)*b)/b;if(g&&e>a)break;n.push({value:e})}return g&&d&&w!==a?n.length&&almostEquals(n[n.length-1].value,a,relativeLabelSize(a,v,e))?n[n.length-1].value=a:n.push({value:a}):g&&w!==a||n.push({value:w}),n}function relativeLabelSize(e,t,{horizontal:n,minRotation:r}){const o=toRadians(r),i=(n?Math.sin(o):Math.cos(o))||.001,a=.75*t*(""+e).length;return Math.min(t/i,a)}class LinearScaleBase extends Scale{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return isNullOrUndef(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this;const i=e=>r=t?r:e,a=e=>o=n?o:e;if(e){const e=sign$2(r),t=sign$2(o);e<0&&t<0?a(0):e>0&&t>0&&i(0)}if(r===o){let t=0===o?1:Math.abs(.05*o);a(o+t),e||i(r-t)}this.min=r,this.max=o}getTickLimit(){const e=this.options.ticks;let t,{maxTicksLimit:n,stepSize:r}=e;return r?(t=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,t>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3)):(t=this.computeTickLimit(),n=n||11),n&&(t=Math.min(n,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let n=this.getTickLimit();n=Math.max(2,n);const r=generateTicks$1({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&_setMinAndMaxByKey(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const e=this.ticks;let t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){const r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return formatNumber(e,this.chart.options.locale,this.options.ticks.format)}}class LinearScale extends LinearScaleBase{static id="linear";static defaults={ticks:{callback:Ticks.formatters.numeric}};determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=isNumberFinite(e)?e:0,this.max=isNumberFinite(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,n=toRadians(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/r))}getPixelForValue(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const INTERVALS={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}},UNITS=Object.keys(INTERVALS);function sorter(e,t){return e-t}function parse$a(e,t){if(isNullOrUndef(t))return null;const n=e._adapter,{parser:r,round:o,isoWeekday:i}=e._parseOpts;let a=t;return"function"==typeof r&&(a=r(a)),isNumberFinite(a)||(a="string"==typeof r?n.parse(a,r):n.parse(a)),null===a?null:(o&&(a="week"!==o||!isNumber$2(i)&&!0!==i?n.startOf(a,o):n.startOf(a,"isoWeek",i)),+a)}function determineUnitForAutoTicks(e,t,n,r){const o=UNITS.length;for(let i=UNITS.indexOf(e);i<o-1;++i){const e=INTERVALS[UNITS[i]],o=e.steps?e.steps:Number.MAX_SAFE_INTEGER;if(e.common&&Math.ceil((n-t)/(o*e.size))<=r)return UNITS[i]}return UNITS[o-1]}function determineUnitForFormatting(e,t,n,r,o){for(let i=UNITS.length-1;i>=UNITS.indexOf(n);i--){const n=UNITS[i];if(INTERVALS[n].common&&e._adapter.diff(o,r,n)>=t-1)return n}return UNITS[n?UNITS.indexOf(n):0]}function determineMajorUnit(e){for(let t=UNITS.indexOf(e)+1,n=UNITS.length;t<n;++t)if(INTERVALS[UNITS[t]].common)return UNITS[t]}function addTick(e,t,n){if(n){if(n.length){const{lo:r,hi:o}=_lookup(n,t);e[n[r]>=t?n[r]:n[o]]=!0}}else e[t]=!0}function setMajorTicks(e,t,n,r){const o=e._adapter,i=+o.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=i;s<=a;s=+o.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function ticksFromTimestamps(e,t,n){const r=[],o={},i=t.length;let a,s;for(a=0;a<i;++a)s=t[a],o[s]=a,r.push({value:s,major:!1});return 0!==i&&n?setMajorTicks(e,r,o,n):r}class TimeScale extends Scale{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){const n=e.time||(e.time={}),r=this._adapter=new adapters._date(e.adapters.date);r.init(t),mergeIf(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return void 0===e?null:parse$a(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,n=e.time.unit||"day";let{min:r,max:o,minDefined:i,maxDefined:a}=this.getUserBounds();function s(e){i||isNaN(e.min)||(r=Math.min(r,e.min)),a||isNaN(e.max)||(o=Math.max(o,e.max))}i&&a||(s(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||s(this.getMinMax(!1))),r=isNumberFinite(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),o=isNumberFinite(o)&&!isNaN(o)?o:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,o-1),this.max=Math.max(r+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){const e=this.options,t=e.time,n=e.ticks,r="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const o=this.min,i=_filterBetween(r,o,this.max);return this._unit=t.unit||(n.autoSkip?determineUnitForAutoTicks(t.minUnit,this.min,this.max,this._getLabelCapacity(o)):determineUnitForFormatting(this,i.length,t.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?determineMajorUnit(this._unit):void 0,this.initOffsets(r),e.reverse&&i.reverse(),ticksFromTimestamps(this,i,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t,n,r=0,o=0;this.options.offset&&e.length&&(t=this.getDecimalForValue(e[0]),r=1===e.length?1-t:(this.getDecimalForValue(e[1])-t)/2,n=this.getDecimalForValue(e[e.length-1]),o=1===e.length?n:(n-this.getDecimalForValue(e[e.length-2]))/2);const i=e.length<3?.5:.25;r=_limitValue(r,0,i),o=_limitValue(o,0,i),this._offsets={start:r,end:o,factor:1/(r+1+o)}}_generate(){const e=this._adapter,t=this.min,n=this.max,r=this.options,o=r.time,i=o.unit||determineUnitForAutoTicks(o.minUnit,t,n,this._getLabelCapacity(t)),a=valueOrDefault(r.ticks.stepSize,1),s="week"===i&&o.isoWeekday,l=isNumber$2(s)||!0===s,c={};let u,d,p=t;if(l&&(p=+e.startOf(p,"isoWeek",s)),p=+e.startOf(p,l?"day":i),e.diff(n,t,i)>1e5*a)throw new Error(t+" and "+n+" are too far apart with stepSize of "+a+" "+i);const h="data"===r.ticks.source&&this.getDataTimestamps();for(u=p,d=0;u<n;u=+e.add(u,a,i),d++)addTick(c,u,h);return u!==n&&"ticks"!==r.bounds&&1!==d||addTick(c,u,h),Object.keys(c).sort(sorter).map(e=>+e)}getLabelForValue(e){const t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){const n=this.options.time.displayFormats,r=this._unit,o=t||n[r];return this._adapter.format(e,o)}_tickFormatFunction(e,t,n,r){const o=this.options,i=o.ticks.callback;if(i)return callback(i,[e,t,n],this);const a=o.time.displayFormats,s=this._unit,l=this._majorUnit,c=s&&a[s],u=l&&a[l],d=n[t],p=l&&u&&d&&d.major;return this._adapter.format(e,r||(p?u:c))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return null===e?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,n=this.ctx.measureText(e).width,r=toRadians(this.isHorizontal()?t.maxRotation:t.minRotation),o=Math.cos(r),i=Math.sin(r),a=this._resolveTickFontOptions(0).size;return{w:n*o+a*i,h:n*i+a*o}}_getLabelCapacity(e){const t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,o=this._tickFormatFunction(e,0,ticksFromTimestamps(this,[e],this._majorUnit),r),i=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return a>0?a:1}getDataTimestamps(){let e,t,n=this._cache.data||[];if(n.length)return n;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,t=r.length;e<t;++e)n=n.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const e=this._cache.labels||[];let t,n;if(e.length)return e;const r=this.getLabels();for(t=0,n=r.length;t<n;++t)e.push(parse$a(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return _arrayUnique(e.sort(sorter))}}function interpolate(e,t,n){let r,o,i,a,s=0,l=e.length-1;n?(t>=e[s].pos&&t<=e[l].pos&&({lo:s,hi:l}=_lookupByKey(e,"pos",t)),({pos:r,time:i}=e[s]),({pos:o,time:a}=e[l])):(t>=e[s].time&&t<=e[l].time&&({lo:s,hi:l}=_lookupByKey(e,"time",t)),({time:r,pos:i}=e[s]),({time:o,pos:a}=e[l]));const c=o-r;return c?i+(a-i)*(t-r)/c:i}class TimeSeriesScale extends TimeScale{static id="timeseries";static defaults=TimeScale.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=interpolate(t,this.min),this._tableRange=interpolate(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:n}=this,r=[],o=[];let i,a,s,l,c;for(i=0,a=e.length;i<a;++i)l=e[i],l>=t&&l<=n&&r.push(l);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(i=0,a=r.length;i<a;++i)c=r[i+1],s=r[i-1],l=r[i],Math.round((c+s)/2)!==l&&o.push({time:l,pos:i/(a-1)});return o}_generate(){const e=this.min,t=this.max;let n=super.getDataTimestamps();return n.includes(e)&&n.length||n.splice(0,0,e),n.includes(t)&&1!==n.length||n.push(t),n.sort((e,t)=>e-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(interpolate(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return interpolate(this._table,n*this._tableRange+this._minPos,!0)}}var isToday$1={exports:{}};isToday$1.exports=function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}};var isTodayExports=isToday$1.exports;const isToday=getDefaultExportFromCjs$1(isTodayExports);var localeData$1={exports:{}};localeData$1.exports=function(e,t,n){var r=t.prototype,o=function(e){return e&&(e.indexOf?e:e.s)},i=function(e,t,n,r,i){var a=e.name?e:e.$locale(),s=o(a[t]),l=o(a[n]),c=s||l.map(function(e){return e.slice(0,r)});if(!i)return c;var u=a.weekStart;return c.map(function(e,t){return c[(t+(u||0))%7]})},a=function(){return n.Ls[n.locale()]},s=function(e,t){return e.formats[t]||e.formats[t.toUpperCase()].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,n){return t||n.slice(1)})},l=function(){var e=this;return{months:function(t){return t?t.format("MMMM"):i(e,"months")},monthsShort:function(t){return t?t.format("MMM"):i(e,"monthsShort","months",3)},firstDayOfWeek:function(){return e.$locale().weekStart||0},weekdays:function(t){return t?t.format("dddd"):i(e,"weekdays")},weekdaysMin:function(t){return t?t.format("dd"):i(e,"weekdaysMin","weekdays",2)},weekdaysShort:function(t){return t?t.format("ddd"):i(e,"weekdaysShort","weekdays",3)},longDateFormat:function(t){return s(e.$locale(),t)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return l.bind(this)()},n.localeData=function(){var e=a();return{firstDayOfWeek:function(){return e.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(t){return s(e,t)},meridiem:e.meridiem,ordinal:e.ordinal}},n.months=function(){return i(a(),"months")},n.monthsShort=function(){return i(a(),"monthsShort","months",3)},n.weekdays=function(e){return i(a(),"weekdays",null,null,e)},n.weekdaysShort=function(e){return i(a(),"weekdaysShort","weekdays",3,e)},n.weekdaysMin=function(e){return i(a(),"weekdaysMin","weekdays",2,e)}};var localeDataExports=localeData$1.exports;const localeData=getDefaultExportFromCjs$1(localeDataExports);var ru={exports:{}},dayjs_min={exports:{}};dayjs_min.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",o="second",i="minute",a="hour",s="day",l="week",c="month",u="quarter",d="year",p="date",h="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,A=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(o,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),o=t.clone().add(r,c),i=n-o<0,a=t.clone().add(r+(i?-1:1),c);return+(-(r+(n-o)/(i?o-a:a-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:d,w:l,d:s,D:p,h:a,m:i,s:o,ms:r,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",b={};b[v]=m;var x="$isDayjsObject",w=function(e){return e instanceof S||!(!e||!e[x])},C=function e(t,n,r){var o;if(!t)return v;if("string"==typeof t){var i=t.toLowerCase();b[i]&&(o=i),n&&(b[i]=n,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var s=t.name;b[s]=t,o=s}return!r&&o&&(v=o),o||!r&&v},$=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new S(n)},_=y;_.l=C,_.i=w,_.w=function(e,t){return $(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function m(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var g=m.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(_.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(f);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return _},g.isValid=function(){return!(this.$d.toString()===h)},g.isSame=function(e,t){var n=$(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return $(e)<this.startOf(t)},g.isBefore=function(e,t){return this.endOf(t)<$(e)},g.$g=function(e,t,n){return _.u(e)?this[t]:this.set(n,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,t){var n=this,r=!!_.u(t)||t,u=_.p(e),h=function(e,t){var o=_.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?o:o.endOf(s)},f=function(e,t){return _.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},A=this.$W,m=this.$M,g=this.$D,y="set"+(this.$u?"UTC":"");switch(u){case d:return r?h(1,0):h(31,11);case c:return r?h(1,m):h(0,m+1);case l:var v=this.$locale().weekStart||0,b=(A<v?A+7:A)-v;return h(r?g-b:g+(6-b),m);case s:case p:return f(y+"Hours",0);case a:return f(y+"Minutes",1);case i:return f(y+"Seconds",2);case o:return f(y+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,t){var n,l=_.p(e),u="set"+(this.$u?"UTC":""),h=(n={},n[s]=u+"Date",n[p]=u+"Date",n[c]=u+"Month",n[d]=u+"FullYear",n[a]=u+"Hours",n[i]=u+"Minutes",n[o]=u+"Seconds",n[r]=u+"Milliseconds",n)[l],f=l===s?this.$D+(t-this.$W):t;if(l===c||l===d){var A=this.clone().set(p,1);A.$d[h](f),A.init(),this.$d=A.set(p,Math.min(this.$D,A.daysInMonth())).$d}else h&&this.$d[h](f);return this.init(),this},g.set=function(e,t){return this.clone().$set(e,t)},g.get=function(e){return this[_.p(e)]()},g.add=function(r,u){var p,h=this;r=Number(r);var f=_.p(u),A=function(e){var t=$(h);return _.w(t.date(t.date()+Math.round(e*r)),h)};if(f===c)return this.set(c,this.$M+r);if(f===d)return this.set(d,this.$y+r);if(f===s)return A(1);if(f===l)return A(7);var m=(p={},p[i]=t,p[a]=n,p[o]=e,p)[f]||1,g=this.$d.getTime()+r*m;return _.w(g,this)},g.subtract=function(e,t){return this.add(-1*e,t)},g.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var r=e||"YYYY-MM-DDTHH:mm:ssZ",o=_.z(this),i=this.$H,a=this.$m,s=this.$M,l=n.weekdays,c=n.months,u=n.meridiem,d=function(e,n,o,i){return e&&(e[n]||e(t,r))||o[n].slice(0,i)},p=function(e){return _.s(i%12||12,e,"0")},f=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(A,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return _.s(t.$y,4,"0");case"M":return s+1;case"MM":return _.s(s+1,2,"0");case"MMM":return d(n.monthsShort,s,c,3);case"MMMM":return d(c,s);case"D":return t.$D;case"DD":return _.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,l,2);case"ddd":return d(n.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(i);case"HH":return _.s(i,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return f(i,a,!0);case"A":return f(i,a,!1);case"m":return String(a);case"mm":return _.s(a,2,"0");case"s":return String(t.$s);case"ss":return _.s(t.$s,2,"0");case"SSS":return _.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")})},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(r,p,h){var f,A=this,m=_.p(p),g=$(r),y=(g.utcOffset()-this.utcOffset())*t,v=this-g,b=function(){return _.m(A,g)};switch(m){case d:f=b()/12;break;case c:f=b();break;case u:f=b()/3;break;case l:f=(v-y)/6048e5;break;case s:f=(v-y)/864e5;break;case a:f=v/n;break;case i:f=v/t;break;case o:f=v/e;break;default:f=v}return h?f:_.a(f)},g.daysInMonth=function(){return this.endOf(c).$D},g.$locale=function(){return b[this.$L]},g.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},g.clone=function(){return _.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},m}(),E=S.prototype;return $.prototype=E,[["$ms",r],["$s",o],["$m",i],["$H",a],["$W",s],["$M",c],["$y",d],["$D",p]].forEach(function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),$.extend=function(e,t){return e.$i||(e(t,S,$),e.$i=!0),$},$.locale=C,$.isDayjs=w,$.unix=function(e){return $(1e3*e)},$.en=b[v],$.Ls=b,$.p={},$}();var dayjs_minExports=dayjs_min.exports;const J$2=getDefaultExportFromCjs$1(dayjs_minExports);ru.exports=function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e),r="января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),o="январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),i="янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),a="янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"),s=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function l(e,t,n){var r,o;return"m"===n?t?"минута":"минуту":e+" "+(r=+e,o={mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}var c=function(e,t){return s.test(t)?r[e.month()]:o[e.month()]};c.s=o,c.f=r;var u=function(e,t){return s.test(t)?i[e.month()]:a[e.month()]};u.s=a,u.f=i;var d={name:"ru",weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),months:c,monthsShort:u,weekStart:1,yearStart:4,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:l,mm:l,h:"час",hh:l,d:"день",dd:l,M:"месяц",MM:l,y:"год",yy:l},ordinal:function(e){return e},meridiem:function(e){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"}};return n.default.locale(d,null,!0),d}(dayjs_minExports);var ruExports=ru.exports;const ruLocale=getDefaultExportFromCjs$1(ruExports);var utc={exports:{}};utc.exports=function(){var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,o,i){var a=o.prototype;i.utc=function(e){return new o({date:e,utc:!0,args:arguments})},a.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=a.utcOffset;a.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&null===(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var o=(""+r[0]).match(n)||["-",0,0],i=o[0],a=60*+o[1]+ +o[2];return 0===a?0:"+"===i?a:-a}(r)))return this;var a=Math.abs(r)<=16?60*r:r;if(0===a)return this.utc(o);var s=this.clone();if(o)return s.$offset=a,s.$u=!1,s;var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(a+l,e)).$offset=a,s.$x.$localOffset=l,s};var u=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var p=a.diff;a.diff=function(e,t,n){if(e&&this.$u===e.$u)return p.call(this,e,t,n);var r=this.local(),o=i(e).local();return p.call(r,o,t,n)}}}();var utcExports=utc.exports;const utcPlugin=getDefaultExportFromCjs$1(utcExports);Chart$1.register(CategoryScale,LinearScale,BarElement,BarController,LineElement,LineController,PointElement,plugin_title,plugin_tooltip,plugin_legend),dayjs.extend(localeData),dayjs.extend(utcPlugin),dayjs.extend(isToday),dayjs.locale(ruLocale);var uzLatn={exports:{}};uzLatn.exports=function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e),r={name:"uz-latn",weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),weekStart:1,weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},relativeTime:{future:"Yaqin %s ichida",past:"%s oldin",s:"soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"}};return n.default.locale(r,null,!0),r}(dayjs_minExports);var uzLatnExports=uzLatn.exports;const uzLocale=getDefaultExportFromCjs$1(uzLatnExports);var define_process_env_default$3={};const CC_ENABLE_MOCK=!!define_process_env_default$3.CC_ENABLE_MOCK||!1,CC_LIST_BUFFER_SIZE=parseInt(define_process_env_default$3.CC_LIST_BUFFER_SIZE)||25,CC_FORCE_BROWSER_HISTORY=!!define_process_env_default$3.CC_FORCE_BROWSER_HISTORY||!1,CC_FULLSCREEN_SIZE_REQUEST=({height:e,width:t})=>({height:e-50,width:t-50,sx:{maxHeight:"720px",maxWidth:"1280px"}}),CC_DAYJS_LOCALE=define_process_env_default$3.CC_DAYJS_LOCALE||"RU",CC_SERVICE_NAME="backtest-kit",CC_USER_ID=Gr(),CC_CLIENT_ID="ui";function fallbackCopyTextToClipboard(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{const e=document.execCommand("copy")?"successful":"unsuccessful";console.log(`Fallback: Copying text command was ${e}`)}catch(n){console.error("Fallback: Oops, unable to copy",n)}document.body.removeChild(t)}J$2.extend(localeData),J$2.extend(utcPlugin),J$2.extend(isToday),"RU"===CC_DAYJS_LOCALE?J$2.locale(ruLocale):"UZ"===CC_DAYJS_LOCALE?J$2.locale(uzLocale):J$2.locale(ruLocale),ak.override(e=>{const t=document.createElement("a");t.href=e,t.target="_blank",t.click()}),oS.override(async e=>{try{if("copyToClipboard"in navigator)return void(await navigator.copyToClipboard(e));await navigator.clipboard.writeText(e)}catch{fallbackCopyTextToClipboard(e)}}),rp.override(async()=>{if("caches"in window)for(const e of await window.caches.keys())await caches.delete(e);CC_FORCE_BROWSER_HISTORY?window.location.href="/":window.location.reload(!0)});const{makeStyles:makeStyles}=createMakeAndWithStyles({useTheme:useTheme}),useStyles$x=makeStyles()({root:{position:"relative",width:48,maxWidth:48}}),MobileCheckboxBodyCell=e=>{const{classes:t}=useStyles$x();return factory$1(TableCell,{className:t.root,padding:"checkbox",children:factory$1(_h.CheckboxCell,{...e})})},COMPONENT_MIN_HEIGHT=70,CONTENT_CELL="react_declarative_listMobileCell",useStyles$w=makeStyles()({root:{position:"relative"},noGutters:{paddingLeft:"0 !important",paddingRight:"0 !important"},container:{minHeight:"100%",width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",flexWrap:"wrap"},content:{position:"relative",overflow:"clip",overflowWrap:"break-word",fontWeight:"bold",flex:1},shrinkWidth:{width:48,maxWidth:48}}),MobileCommonCell=({className:e,colSpan:t,withLabel:n,fullWidth:r,disableGutters:o,...i})=>{const{classes:a}=useStyles$w(),{column:s}=i,l=reactExports.useMemo(()=>{const{minHeight:e}=s;return e||(s.type===Mm.Component?COMPONENT_MIN_HEIGHT:void 0)},[]),c=reactExports.useMemo(()=>Math.max(r-35,0),[r]),{headerName:u=s.field||"Unknown"}=s;return factory$1(TableCell,{className:clsx$2(a.root,e,{[a.noGutters]:o,[a.shrinkWidth]:s.type===Mm.Action}),colSpan:t,children:factory$1(Box$1,{className:a.container,children:[n&&factory$1(Typography,{variant:"body1",children:`${tM.bullet} ${u}`}),factory$1(Box$1,{className:clsx$2(a.content,CONTENT_CELL),style:{minHeight:l,maxWidth:c},children:factory$1(_h.CommonCell,{...i,fullWidth:r})})]})})},useStyles$v=makeStyles()(e=>({root:{"&:nth-of-type(2n)":{background:alpha$2(e.palette.getContrastText(e.palette.background.paper),.04)},"& > .MuiTableCell-root":{borderBottom:`1px solid ${e.palette.divider}`},overflow:"clip"},row:{"& .MuiTableCell-root":{padding:"6px",overflow:"clip"},marginBottom:16},noBorder:{"& .MuiTableCell-root":{borderBottom:"0 !important"}},disabled:{pointerEvents:"none",opacity:.5},hideIfEmpty:{[`&:has(.${CONTENT_CELL} > :empty)`]:{display:"none"},[`&:has(.${CONTENT_CELL}:empty)`]:{display:"none"}}})),MobileBodyRow=({row:e,mode:t,disabled:n,columns:r,fullWidth:o})=>{const i=Bp(e.id),[a,s]=reactExports.useState(!1),{classes:l}=useStyles$v(),c=fm(),u=Zm(),{selection:d,setSelection:p}=pm(),{onRowClick:h,onRowAction:f,rowColor:A=()=>"inherit"}=c,m=e=>{s(e)},g=t=>{f&&f(t,e,u)},[y,v,b]=reactExports.useMemo(()=>{const i=(r,i,a,s)=>(i,u)=>factory$1(MobileCommonCell,{column:i,disabled:n,row:e,className:clsx$2({[l.hideIfEmpty]:i.type!==Mm.Component&&c.withHideIfEmpty}),idx:u,mode:t,colSpan:r,fullWidth:o,onAction:g,withLabel:a,disableGutters:s,onMenuToggle:m}),a=r.filter(({type:e})=>e!==Mm.Action),[s=null]=r.filter(({type:e})=>e===Mm.Action).map(i(1,0,!1,!0)),u=a.slice(0,1).map(i(1,0,!0,!0)).pop(),d=a.filter(({primary:e})=>e).map(i(1,0,!0,!0)).pop();return[d||u,s,(d?a:a.slice(1)).map(i(s?3:2,0,!0,!1))]},[o]),x=reactExports.useMemo(()=>Math.max(o-35,0),[o]);return factory$1(TableRow,{ref:i,"data-testId":e.id,className:l.root,selected:d.has(e.id),sx:{maxWidth:x},onClick:()=>{a||(c.withSelectOnRowClick&&c.selectionMode!==gi$1.None?(c.selectionMode===gi$1.Single?d.has(e.id)&&1===d.size?d.delete(e.id):(d.clear(),d.add(e.id)):d.has(e.id)?d.delete(e.id):d.add(e.id),p(d)):h&&h(e,u))},children:factory$1(TableCell,{padding:"none",sx:{background:A(e),maxWidth:x},children:factory$1(Table,{className:clsx$2(l.row,{[l.disabled]:n}),children:factory$1(TableBody,{children:[factory$1(TableRow,{children:[factory$1(MobileCheckboxBodyCell,{disabled:n,row:e}),y,v]}),b.map((e,t)=>factory$1(TableRow,{className:clsx$2(t===b.length-1&&l.noBorder),children:e},t))]})})})})};function keys(e){return Object.keys(e)}function isObject$2(e){return e&&"object"==typeof e&&!Array.isArray(e)}function deepMerge(e,t){const n={...e},r=t;return isObject$2(e)&&isObject$2(t)&&Object.keys(t).forEach(t=>{isObject$2(r[t])?n[t]=t in e?deepMerge(n[t],r[t]):r[t]:n[t]=r[t]}),n}function camelToKebabCase(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function getTransformedScaledValue(e){var t;return"string"==typeof e&&e.includes("var(--mantine-scale)")?null==(t=e.match(/^calc\((.*?)\)$/))?void 0:t[1].split("*")[0].trim():e}function px(e){const t=getTransformedScaledValue(e);return"number"==typeof t?t:"string"==typeof t?t.includes("calc")||t.includes("var")?t:t.includes("px")?Number(t.replace("px","")):t.includes("rem")?16*Number(t.replace("rem","")):t.includes("em")?16*Number(t.replace("em","")):Number(t):NaN}function scaleRem(e){return"0rem"===e?"0rem":`calc(${e} * var(--mantine-scale))`}function createConverter(e,{shouldScale:t=!1}={}){return function n(r){if(0===r||"0"===r)return`0${e}`;if("number"==typeof r){const n=`${r/16}${e}`;return t?scaleRem(n):n}if("string"==typeof r){if(""===r)return r;if(r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(e=>n(e)).join(",");if(r.includes(" "))return r.split(" ").map(e=>n(e)).join(" ");if(r.includes(e))return t?scaleRem(r):r;const o=r.replace("px","");if(!Number.isNaN(Number(o))){const n=`${Number(o)/16}${e}`;return t?scaleRem(n):n}}return r}}const rem=createConverter("rem",{shouldScale:!0}),em=createConverter("em");function filterProps(e){return Object.keys(e).reduce((t,n)=>(void 0!==e[n]&&(t[n]=e[n]),t),{})}function isNumberLike(e){return"number"==typeof e||"string"==typeof e&&(!!(e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&""!==e.trim())||/[0-9]/.test(e.trim().replace("-","")[0]))}function isElement$2(e){return!Array.isArray(e)&&null!==e&&("object"==typeof e&&e.type!==reactExports.Fragment)}function createSafeContext(e){const t=reactExports.createContext(null);return[({children:e,value:n})=>factory$1(t.Provider,{value:n,children:e}),()=>{const n=reactExports.useContext(t);if(null===n)throw new Error(e);return n}]}function createOptionalContext(e=null){const t=reactExports.createContext(e);return[({children:e,value:n})=>factory$1(t.Provider,{value:n,children:e}),()=>reactExports.useContext(t)]}const elevations={app:100,modal:200,popover:300,overlay:400,max:9999};function getDefaultZIndex(e){return elevations[e]}const noop$4=()=>{};function closeOnEscape(e,t={active:!0}){return"function"==typeof e&&t.active?n=>{var r;"Escape"===n.key&&(e(n),null==(r=t.onTrigger)||r.call(t))}:t.onKeyDown||noop$4}function getSize(e,t="size",n=!0){if(void 0!==e)return isNumberLike(e)?n?rem(e):e:`var(--${t}-${e})`}function getSpacing(e){return getSize(e,"mantine-spacing")}function getRadius(e){return void 0===e?"var(--mantine-radius-default)":getSize(e,"mantine-radius")}function getFontSize(e){return getSize(e,"mantine-font-size")}function getShadow(e){if(e)return getSize(e,"mantine-shadow",!1)}function clamp$2(e,t,n){return void 0===t&&void 0===n?e:void 0!==t&&void 0===n?Math.max(e,t):void 0===t&&void 0!==n?Math.min(e,n):Math.min(Math.max(e,t),n)}function randomId(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function useCallbackRef(e){const t=reactExports.useRef(e);return reactExports.useEffect(()=>{t.current=e}),reactExports.useMemo(()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)},[])}function useDebouncedCallback(e,t){const n=useCallbackRef(e),r=reactExports.useRef(0);return reactExports.useEffect(()=>()=>window.clearTimeout(r.current),[]),reactExports.useCallback((...e)=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>n(...e),t)},[n,t])}const DEFAULT_EVENTS=["mousedown","touchstart"];function useClickOutside(e,t,n){const r=reactExports.useRef();return reactExports.useEffect(()=>{const o=t=>{const{target:o}=t??{};if(Array.isArray(n)){const r=(null==o?void 0:o.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(o)&&"HTML"!==o.tagName;n.every(e=>!!e&&!t.composedPath().includes(e))&&!r&&e()}else r.current&&!r.current.contains(o)&&e()};return(t||DEFAULT_EVENTS).forEach(e=>document.addEventListener(e,o)),()=>{(t||DEFAULT_EVENTS).forEach(e=>document.removeEventListener(e,o))}},[r,e,n]),r}function attachMediaListener(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch(e2){return e.addListener(t),()=>e.removeListener(t)}}function getInitialValue(e,t){return"undefined"!=typeof window&&"matchMedia"in window&&window.matchMedia(e).matches}function useMediaQuery(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=reactExports.useState(n?t:getInitialValue(e)),i=reactExports.useRef();return reactExports.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),attachMediaListener(i.current,e=>o(e.matches))},[e]),r}const useIsomorphicEffect="undefined"!=typeof document?reactExports.useLayoutEffect:reactExports.useEffect;function useDidUpdate(e,t){const n=reactExports.useRef(!1);reactExports.useEffect(()=>()=>{n.current=!1},[]),reactExports.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function useFocusReturn({opened:e,shouldReturnFocus:t=!0}){const n=reactExports.useRef(),r=()=>{var e;n.current&&"focus"in n.current&&"function"==typeof n.current.focus&&(null==(e=n.current)||e.focus({preventScroll:!0}))};return useDidUpdate(()=>{let o=-1;const i=e=>{"Tab"===e.key&&window.clearTimeout(o)};return document.addEventListener("keydown",i),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",i)}},[e,t]),r}function createAriaHider(e,t="body > :not(script)"){const n=randomId(),r=Array.from(document.querySelectorAll(t)).map(t=>{var r;if((null==(r=null==t?void 0:t.shadowRoot)?void 0:r.contains(e))||t.contains(e))return;const o=t.getAttribute("aria-hidden"),i=t.getAttribute("data-hidden"),a=t.getAttribute("data-focus-id");return t.setAttribute("data-focus-id",n),null===o||"false"===o?t.setAttribute("aria-hidden","true"):i||a||t.setAttribute("data-hidden",o),{node:t,ariaHidden:i||null}});return()=>{r.forEach(e=>{e&&n===e.node.getAttribute("data-focus-id")&&(null===e.ariaHidden?e.node.removeAttribute("aria-hidden"):e.node.setAttribute("aria-hidden",e.ariaHidden),e.node.removeAttribute("data-focus-id"),e.node.removeAttribute("data-hidden"))})}}const TABBABLE_NODES=/input|select|textarea|button|object/,FOCUS_SELECTOR="a, input, select, textarea, button, object, [tabindex]";function hidden(e){return"none"===e.style.display}function visible(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||"hidden"===e.getAttribute("type"))return!1;let t=e;for(;t&&t!==document.body&&11!==t.nodeType;){if(hidden(t))return!1;t=t.parentNode}return!0}function getElementTabIndex(e){let t=e.getAttribute("tabindex");return null===t&&(t=void 0),parseInt(t,10)}function focusable(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(getElementTabIndex(e));return(TABBABLE_NODES.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&visible(e)}function tabbable(e){const t=getElementTabIndex(e);return(Number.isNaN(t)||t>=0)&&focusable(e)}function findTabbableDescendants(e){return Array.from(e.querySelectorAll(FOCUS_SELECTOR)).filter(tabbable)}function scopeTab(e,t){const n=findTabbableDescendants(e);if(!n.length)return void t.preventDefault();const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let i=r===o.activeElement||e===o.activeElement;const a=o.activeElement;if("INPUT"===a.tagName&&"radio"===a.getAttribute("type")){i=n.filter(e=>"radio"===e.getAttribute("type")&&e.getAttribute("name")===a.getAttribute("name")).includes(r)}if(!i)return;t.preventDefault();const s=n[t.shiftKey?n.length-1:0];s&&s.focus()}function useFocusTrap(e=!0){const t=reactExports.useRef(),n=reactExports.useRef(null),r=e=>{let t=e.querySelector("[data-autofocus]");if(!t){const n=Array.from(e.querySelectorAll(FOCUS_SELECTOR));t=n.find(tabbable)||n.find(focusable)||null,!t&&focusable(e)&&(t=e)}t&&t.focus({preventScroll:!0})},o=reactExports.useCallback(o=>{e&&(null!==o?(n.current=createAriaHider(o),t.current!==o&&(o?(setTimeout(()=>{o.getRootNode()&&r(o)}),t.current=o):t.current=null)):n.current&&(n.current(),n.current=null))},[e]);return reactExports.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const o=e=>{"Tab"===e.key&&t.current&&scopeTab(t.current,e)};return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o),n.current&&n.current()}},[e]),o}const __useId=React["useId".toString()]||(()=>{});function useReactId$1(){const e=__useId();return e?`mantine-${e.replace(/:/g,"")}`:""}function useId$1(e){const t=useReactId$1(),[n,r]=reactExports.useState(t);return useIsomorphicEffect(()=>{r(randomId())},[]),"string"==typeof e?e:"undefined"==typeof window?t:n}function assignRef(e,t){"function"==typeof e?e(t):"object"==typeof e&&null!==e&&"current"in e&&(e.current=t)}function mergeRefs(...e){return t=>{e.forEach(e=>assignRef(e,t))}}function useMergedRef(...e){return reactExports.useCallback(mergeRefs(...e),e)}function useMove(e,t,n="ltr"){const r=reactExports.useRef(null),o=reactExports.useRef(!1),i=reactExports.useRef(!1),a=reactExports.useRef(0),[s,l]=reactExports.useState(!1);return reactExports.useEffect(()=>{o.current=!0},[]),reactExports.useEffect(()=>{var s,c;const u=({x:t,y:i})=>{cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{if(o.current&&r.current){r.current.style.userSelect="none";const o=r.current.getBoundingClientRect();if(o.width&&o.height){const r=clamp$2((t-o.left)/o.width,0,1);e({x:"ltr"===n?r:1-r,y:clamp$2((i-o.top)/o.height,0,1)})}}})},d=()=>{!i.current&&o.current&&(i.current=!0,"function"==typeof(null==t?void 0:t.onScrubStart)&&t.onScrubStart(),l(!0),document.addEventListener("mousemove",f),document.addEventListener("mouseup",p),document.addEventListener("touchmove",m),document.addEventListener("touchend",p))},p=()=>{i.current&&o.current&&(i.current=!1,l(!1),document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",p),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",p),setTimeout(()=>{"function"==typeof(null==t?void 0:t.onScrubEnd)&&t.onScrubEnd()},0))},h=e=>{d(),e.preventDefault(),f(e)},f=e=>u({x:e.clientX,y:e.clientY}),A=e=>{e.cancelable&&e.preventDefault(),d(),m(e)},m=e=>{e.cancelable&&e.preventDefault(),u({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY})};return null==(s=r.current)||s.addEventListener("mousedown",h),null==(c=r.current)||c.addEventListener("touchstart",A,{passive:!1}),()=>{r.current&&(r.current.removeEventListener("mousedown",h),r.current.removeEventListener("touchstart",A))}},[n,e]),{ref:r,active:s}}function useUncontrolled({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,i]=reactExports.useState(void 0!==t?t:n);return void 0!==e?[e,r,!0]:[o,(e,...t)=>{i(e),null==r||r(e,...t)},!1]}function useReducedMotion(e,t){return useMediaQuery("(prefers-reduced-motion: reduce)",e,t)}function usePrevious(e){const t=reactExports.useRef();return reactExports.useEffect(()=>{t.current=e},[e]),t.current}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var browser={exports:{}},process=browser.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(e2){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(e2){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e2){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e2){cachedClearTimeout=defaultClearTimeout}}();var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop$3(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop$3,process.addListener=noop$3,process.once=noop$3,process.off=noop$3,process.removeListener=noop$3,process.removeAllListeners=noop$3,process.emit=noop$3,process.prependListener=noop$3,process.prependOnceListener=noop$3,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var browserExports=browser.exports;const process$1=getDefaultExportFromCjs(browserExports);var define_process_env_default$2={};function getEnv(){return void 0!==process$1&&define_process_env_default$2?"production":"development"}function createVarsResolver(e){return e}const EMPTY_CLASS_NAMES={};function mergeClassNames(e){const t={};return e.forEach(e=>{Object.entries(e).forEach(([e,n])=>{t[e]?t[e]=clsx$2(t[e],n):t[e]=n})}),t}function resolveClassNames({theme:e,classNames:t,props:n,stylesCtx:r}){return mergeClassNames((Array.isArray(t)?t:[t]).map(t=>"function"==typeof t?t(e,n,r):t||EMPTY_CLASS_NAMES))}function resolveStyles({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((t,o)=>"function"==typeof o?{...t,...o(e,n,r)}:{...t,...o},{})}const MantineContext=reactExports.createContext(null);function useMantineContext(){const e=reactExports.useContext(MantineContext);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function useMantineCssVariablesResolver(){return useMantineContext().cssVariablesResolver}function useMantineClassNamesPrefix(){return useMantineContext().classNamesPrefix}function useMantineStyleNonce(){return useMantineContext().getStyleNonce}function useMantineWithStaticClasses(){return useMantineContext().withStaticClasses}function useMantineIsHeadless(){return useMantineContext().headless}function useMantineSxTransform(){var e;return null==(e=useMantineContext().stylesTransform)?void 0:e.sx}function useMantineStylesTransform(){var e;return null==(e=useMantineContext().stylesTransform)?void 0:e.styles}function isHexColor(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function hexToRgba(e){let t=e.replace("#","");if(3===t.length){const e=t.split("");t=[e[0],e[0],e[1],e[1],e[2],e[2]].join("")}if(8===t.length){const e=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:e}}const n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:255&n,a:1}}function rgbStringToRgba(e){const[t,n,r,o]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:o||1}}function hslStringToRgba(e){const t=e.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);if(!t)return{r:0,g:0,b:0,a:1};const n=parseInt(t[1],10),r=parseInt(t[2],10)/100,o=parseInt(t[3],10)/100,i=t[5]?parseFloat(t[5]):void 0,a=(1-Math.abs(2*o-1))*r,s=n/60,l=a*(1-Math.abs(s%2-1)),c=o-a/2;let u,d,p;return s>=0&&s<1?(u=a,d=l,p=0):s>=1&&s<2?(u=l,d=a,p=0):s>=2&&s<3?(u=0,d=a,p=l):s>=3&&s<4?(u=0,d=l,p=a):s>=4&&s<5?(u=l,d=0,p=a):(u=a,d=0,p=l),{r:Math.round(255*(u+c)),g:Math.round(255*(d+c)),b:Math.round(255*(p+c)),a:i||1}}function toRgba(e){return isHexColor(e)?hexToRgba(e):e.startsWith("rgb")?rgbStringToRgba(e):e.startsWith("hsl")?hslStringToRgba(e):{r:0,g:0,b:0,a:1}}function darken(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${100*t}%)`;const{r:n,g:r,b:o,a:i}=toRgba(e),a=1-t,s=e=>Math.round(e*a);return`rgba(${s(n)}, ${s(r)}, ${s(o)}, ${i})`}function getPrimaryShade(e,t){return"number"==typeof e.primaryShade?e.primaryShade:"dark"===t?e.primaryShade.dark:e.primaryShade.light}function gammaCorrect(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function getLightnessFromOklch(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function luminance(e){if(e.startsWith("oklch("))return(getLightnessFromOklch(e)||0)/100;const{r:t,g:n,b:r}=toRgba(e),o=n/255,i=r/255;return.2126*gammaCorrect(t/255)+.7152*gammaCorrect(o)+.0722*gammaCorrect(i)}function isLightColor$1(e,t=.179){return!e.startsWith("var(")&&luminance(e)>t}function parseThemeColor({color:e,theme:t,colorScheme:n}){if("string"!=typeof e)throw new Error("[@mantine/core] Failed to parse color. Expected color to be a string, instead got "+typeof e);if("bright"===e)return{color:e,value:"dark"===n?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:isLightColor$1("dark"===n?t.white:t.black,t.luminanceThreshold),variable:"--mantine-color-bright"};if("dimmed"===e)return{color:e,value:"dark"===n?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:isLightColor$1("dark"===n?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:"--mantine-color-dimmed"};if("white"===e||"black"===e)return{color:e,value:"white"===e?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:isLightColor$1("white"===e?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),i=o?Number(o):void 0,a=r in t.colors;if(a){const e=void 0!==i?t.colors[r][i]:t.colors[r][getPrimaryShade(t,n||"light")];return{color:r,value:e,shade:i,isThemeColor:a,isLight:isLightColor$1(e,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${i}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:a,isLight:isLightColor$1(e,t.luminanceThreshold),shade:i,variable:void 0}}function getThemeColor(e,t){const n=parseThemeColor({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function getGradient(e,t){const n={from:(null==e?void 0:e.from)||t.defaultGradient.from,to:(null==e?void 0:e.to)||t.defaultGradient.to,deg:(null==e?void 0:e.deg)||t.defaultGradient.deg||0},r=getThemeColor(n.from,t),o=getThemeColor(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function rgba(e,t){if("string"!=typeof e||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){return`color-mix(in srgb, ${e}, transparent ${100*(1-t)}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:o}=toRgba(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const alpha=rgba,defaultVariantColorsResolver=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const i=parseThemeColor({color:e,theme:t}),a="boolean"==typeof o?o:t.autoContrast;if("filled"===n){const t=a&&i.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return i.isThemeColor?void 0===i.shade?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:t,border:`${rem(1)} solid transparent`}:{background:`var(--mantine-color-${i.color}-${i.shade})`,hover:`var(--mantine-color-${i.color}-${9===i.shade?8:i.shade+1})`,color:t,border:`${rem(1)} solid transparent`}:{background:e,hover:darken(e,.1),color:t,border:`${rem(1)} solid transparent`}}if("light"===n){if(i.isThemeColor){if(void 0===i.shade)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${rem(1)} solid transparent`};const n=t.colors[i.color][i.shade];return{background:rgba(n,.1),hover:rgba(n,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${rem(1)} solid transparent`}}return{background:rgba(e,.1),hover:rgba(e,.12),color:e,border:`${rem(1)} solid transparent`}}if("outline"===n)return i.isThemeColor?void 0===i.shade?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${rem(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:rgba(t.colors[i.color][i.shade],.05),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${rem(1)} solid var(--mantine-color-${i.color}-${i.shade})`}:{background:"transparent",hover:rgba(e,.05),color:e,border:`${rem(1)} solid ${e}`};if("subtle"===n){if(i.isThemeColor){if(void 0===i.shade)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${rem(1)} solid transparent`};return{background:"transparent",hover:rgba(t.colors[i.color][i.shade],.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${rem(1)} solid transparent`}}return{background:"transparent",hover:rgba(e,.12),color:e,border:`${rem(1)} solid transparent`}}return"transparent"===n?i.isThemeColor?void 0===i.shade?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${rem(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${rem(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${rem(1)} solid transparent`}:"white"===n?i.isThemeColor?void 0===i.shade?{background:"var(--mantine-color-white)",hover:darken(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${rem(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:darken(t.white,.01),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${rem(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:darken(t.white,.01),color:e,border:`${rem(1)} solid transparent`}:"gradient"===n?{background:getGradient(r,t),hover:getGradient(r,t),color:"var(--mantine-color-white)",border:"none"}:"default"===n?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${rem(1)} solid var(--mantine-color-default-border)`}:{}},DEFAULT_COLORS={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},DEFAULT_FONT_FAMILY="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",DEFAULT_THEME={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:DEFAULT_COLORS,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:defaultVariantColorsResolver,autoContrast:!1,luminanceThreshold:.3,fontFamily:DEFAULT_FONT_FAMILY,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:DEFAULT_FONT_FAMILY,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:rem(34),lineHeight:"1.3"},h2:{fontSize:rem(26),lineHeight:"1.35"},h3:{fontSize:rem(22),lineHeight:"1.4"},h4:{fontSize:rem(18),lineHeight:"1.45"},h5:{fontSize:rem(16),lineHeight:"1.5"},h6:{fontSize:rem(14),lineHeight:"1.5"}}},fontSizes:{xs:rem(12),sm:rem(14),md:rem(16),lg:rem(18),xl:rem(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:rem(2),sm:rem(4),md:rem(8),lg:rem(16),xl:rem(32)},spacing:{xs:rem(10),sm:rem(12),md:rem(16),lg:rem(20),xl:rem(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), 0 ${rem(1)} ${rem(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${rem(10)} ${rem(15)} ${rem(-5)}, rgba(0, 0, 0, 0.04) 0 ${rem(7)} ${rem(7)} ${rem(-5)}`,md:`0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${rem(20)} ${rem(25)} ${rem(-5)}, rgba(0, 0, 0, 0.04) 0 ${rem(10)} ${rem(10)} ${rem(-5)}`,lg:`0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${rem(28)} ${rem(23)} ${rem(-7)}, rgba(0, 0, 0, 0.04) 0 ${rem(12)} ${rem(12)} ${rem(-7)}`,xl:`0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${rem(36)} ${rem(28)} ${rem(-7)}, rgba(0, 0, 0, 0.04) 0 ${rem(17)} ${rem(17)} ${rem(-7)}`},other:{},components:{}};function isMantineColorScheme(e){return"auto"===e||"dark"===e||"light"===e}function localStorageColorSchemeManager({key:e="mantine-color-scheme-value"}={}){let t;return{get:t=>{if("undefined"==typeof window)return t;try{const n=window.localStorage.getItem(e);return isMantineColorScheme(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(n){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",n)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&isMantineColorScheme(t.newValue)&&n(t.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const INVALID_PRIMARY_COLOR_ERROR="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",INVALID_PRIMARY_SHADE_ERROR="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function isValidPrimaryShade(e){return!(e<0||e>9)&&parseInt(e.toString(),10)===e}function validateMantineTheme(e){if(!(e.primaryColor in e.colors))throw new Error(INVALID_PRIMARY_COLOR_ERROR);if(!("object"!=typeof e.primaryShade||isValidPrimaryShade(e.primaryShade.dark)&&isValidPrimaryShade(e.primaryShade.light)))throw new Error(INVALID_PRIMARY_SHADE_ERROR);if("number"==typeof e.primaryShade&&!isValidPrimaryShade(e.primaryShade))throw new Error(INVALID_PRIMARY_SHADE_ERROR)}function mergeMantineTheme(e,t){var n;if(!t)return validateMantineTheme(e),e;const r=deepMerge(e,t);return t.fontFamily&&!(null==(n=t.headings)?void 0:n.fontFamily)&&(r.headings.fontFamily=t.fontFamily),validateMantineTheme(r),r}const MantineThemeContext=reactExports.createContext(null),useSafeMantineTheme=()=>reactExports.useContext(MantineThemeContext)||DEFAULT_THEME;function useMantineTheme(){const e=reactExports.useContext(MantineThemeContext);if(!e)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function MantineThemeProvider({theme:e,children:t,inherit:n=!0}){const r=useSafeMantineTheme(),o=reactExports.useMemo(()=>mergeMantineTheme(n?r:DEFAULT_THEME,e),[e,r,n]);return factory$1(MantineThemeContext.Provider,{value:o,children:t})}function MantineClasses(){const e=useMantineTheme(),t=useMantineStyleNonce(),n=keys(e.breakpoints).reduce((t,n)=>{const r=e.breakpoints[n].includes("px"),o=px(e.breakpoints[n]);return`${t}@media (max-width: ${r?o-.1+"px":em(o-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${o}px`:em(o)}) {.mantine-hidden-from-${n} {display: none !important;}}`},"");return factory$1("style",{"data-mantine-styles":"classes",nonce:null==t?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function cssVariablesObjectToString(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join("")}function wrapWithSelector(e,t){return(Array.isArray(e)?e:[e]).reduce((e,t)=>`${t}{${e}}`,t)}function convertCssVariables(e,t){const n=cssVariablesObjectToString(e.variables),r=n?wrapWithSelector(t,n):"",o=cssVariablesObjectToString(e.dark),i=cssVariablesObjectToString(e.light);return`${r}${o?wrapWithSelector(":host"===t?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,o):""}${i?wrapWithSelector(":host"===t?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,i):""}`}function getContrastColor({color:e,theme:t,autoContrast:n}){if(!("boolean"==typeof n?n:t.autoContrast))return"var(--mantine-color-white)";return parseThemeColor({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function getPrimaryContrastColor(e,t){return getContrastColor({color:e.colors[e.primaryColor][getPrimaryShade(e,t)],theme:e,autoContrast:null})}function getCSSColorVariables({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if("light"===n){const n=getPrimaryShade(e,"light"),i={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${9===n?8:n+1})`,[`--mantine-color-${r}-light`]:alpha(e.colors[t][n],.1),[`--mantine-color-${r}-light-hover`]:alpha(e.colors[t][n],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline-hover`]:alpha(e.colors[t][n],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...i}:i}const i=getPrimaryShade(e,"dark"),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${i})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${9===i?8:i+1})`,[`--mantine-color-${r}-light`]:alpha(e.colors[t][Math.max(0,i-2)],.15),[`--mantine-color-${r}-light-hover`]:alpha(e.colors[t][Math.max(0,i-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(i-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(i-4,0)})`,[`--mantine-color-${r}-outline-hover`]:alpha(e.colors[t][Math.max(i-4,0)],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...a}:a}function isVirtualColor(e){return!!e&&"object"==typeof e&&"mantine-virtual-color"in e}function assignSizeVariables(e,t,n){keys(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}MantineThemeProvider.displayName="@mantine/core/MantineThemeProvider";const defaultCssVariablesResolver=e=>{const t=getPrimaryShade(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:rem(e.defaultRadius),r={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-color-scheme":"light dark","--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-primary-color-contrast":getPrimaryContrastColor(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)"},dark:{"--mantine-primary-color-contrast":getPrimaryContrastColor(e,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)"}};assignSizeVariables(r.variables,e.breakpoints,"breakpoint"),assignSizeVariables(r.variables,e.spacing,"spacing"),assignSizeVariables(r.variables,e.fontSizes,"font-size"),assignSizeVariables(r.variables,e.lineHeights,"line-height"),assignSizeVariables(r.variables,e.shadows,"shadow"),assignSizeVariables(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((t,n)=>{r.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}),keys(e.colors).forEach(t=>{const n=e.colors[t];if(isVirtualColor(n))return Object.assign(r.light,getCSSColorVariables({theme:e,name:n.name,color:n.light,colorScheme:"light",withColorValues:!0})),void Object.assign(r.dark,getCSSColorVariables({theme:e,name:n.name,color:n.dark,colorScheme:"dark",withColorValues:!0}));n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,getCSSColorVariables({theme:e,color:t,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,getCSSColorVariables({theme:e,color:t,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return keys(o).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=o[t].fontSize,r.variables[`--mantine-${t}-line-height`]=o[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=o[t].fontWeight||e.headings.fontWeight}),r};function getMergedVariables({theme:e,generator:t}){const n=defaultCssVariablesResolver(e),r=null==t?void 0:t(e);return r?deepMerge(n,r):n}const defaultCssVariables=defaultCssVariablesResolver(DEFAULT_THEME);function removeDefaultVariables(e){const t={variables:{},light:{},dark:{}};return keys(e.variables).forEach(n=>{defaultCssVariables.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),keys(e.light).forEach(n=>{defaultCssVariables.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),keys(e.dark).forEach(n=>{defaultCssVariables.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function getColorSchemeCssVariables(e){return`\n ${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }\n ${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }\n`}function MantineCssVariables({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=useMantineTheme(),r=useMantineStyleNonce(),o=getMergedVariables({theme:n,generator:useMantineCssVariablesResolver()}),i=":root"===e&&t,a=convertCssVariables(i?removeDefaultVariables(o):o,e);return a?factory$1("style",{"data-mantine-styles":!0,nonce:null==r?void 0:r(),dangerouslySetInnerHTML:{__html:`${a}${i?"":getColorSchemeCssVariables(e)}`}}):null}function suppressNextjsWarning(){const e=console.error;console.error=(...t)=>{t.length>1&&"string"==typeof t[0]&&t[0].toLowerCase().includes("extra attributes from the server")&&"string"==typeof t[1]&&t[1].toLowerCase().includes("data-mantine-color-scheme")||e(...t)}}function setColorSchemeAttribute(e,t){var n;const r="auto"!==e?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";null==(n=t())||n.setAttribute("data-mantine-color-scheme",r)}function useProviderColorScheme({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=reactExports.useRef(),[i,a]=reactExports.useState(()=>e.get(t)),s=r||i,l=reactExports.useCallback(t=>{r||(setColorSchemeAttribute(t,n),a(t),e.set(t))},[e.set,s,r]),c=reactExports.useCallback(()=>{a(t),setColorSchemeAttribute(t,n),e.clear()},[e.clear,t]);return reactExports.useEffect(()=>(e.subscribe(l),e.unsubscribe),[e.subscribe,e.unsubscribe]),useIsomorphicEffect(()=>{setColorSchemeAttribute(e.get(t),n)},[]),reactExports.useEffect(()=>{var e;if(r)return setColorSchemeAttribute(r,n),()=>{};void 0===r&&setColorSchemeAttribute(i,n),o.current=window.matchMedia("(prefers-color-scheme: dark)");const t=e=>{"auto"===i&&setColorSchemeAttribute(e.matches?"dark":"light",n)};return null==(e=o.current)||e.addEventListener("change",t),()=>{var e;return null==(e=o.current)?void 0:e.removeEventListener("change",t)}},[i,r]),{colorScheme:s,setColorScheme:l,clearColorScheme:c}}function useRespectReduceMotion({respectReducedMotion:e,getRootElement:t}){useIsomorphicEffect(()=>{var n;e&&(null==(n=t())||n.setAttribute("data-respect-reduced-motion","true"))},[e])}function MantineProvider({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:i=!0,withCssVariables:a=!0,cssVariablesSelector:s=":root",classNamesPrefix:l="mantine",colorSchemeManager:c=localStorageColorSchemeManager(),defaultColorScheme:u="light",getRootElement:d=()=>document.documentElement,cssVariablesResolver:p,forceColorScheme:h,stylesTransform:f}){const{colorScheme:A,setColorScheme:m,clearColorScheme:g}=useProviderColorScheme({defaultColorScheme:u,forceColorScheme:h,manager:c,getRootElement:d});return useRespectReduceMotion({respectReducedMotion:(null==e?void 0:e.respectReducedMotion)||!1,getRootElement:d}),factory$1(MantineContext.Provider,{value:{colorScheme:A,setColorScheme:m,clearColorScheme:g,getRootElement:d,classNamesPrefix:l,getStyleNonce:n,cssVariablesResolver:p,cssVariablesSelector:s,withStaticClasses:r,stylesTransform:f},children:factory$1(MantineThemeProvider,{theme:e,children:[a&&factory$1(MantineCssVariables,{cssVariablesSelector:s,deduplicateCssVariables:i}),o&&factory$1(MantineClasses,{}),t]})})}function useResolvedStylesApi({classNames:e,styles:t,props:n,stylesCtx:r}){const o=useMantineTheme();return{resolvedClassNames:resolveClassNames({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:resolveStyles({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}MantineCssVariables.displayName="@mantine/CssVariables",suppressNextjsWarning(),MantineProvider.displayName="@mantine/core/MantineProvider";const FOCUS_CLASS_NAMES={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function getGlobalClassNames({theme:e,options:t,unstyled:n}){return clsx$2((null==t?void 0:t.focusable)&&!n&&(e.focusClassName||FOCUS_CLASS_NAMES[e.focusRing]),(null==t?void 0:t.active)&&!n&&e.activeClassName)}function getOptionsClassNames({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return resolveClassNames({theme:o,classNames:null==n?void 0:n.classNames,props:(null==n?void 0:n.props)||r,stylesCtx:t})[e]}function getResolvedClassNames({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return resolveClassNames({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function getRootClassName({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function getSelectorClassName({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function getStaticClassNames({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return!1===r?[]:e.map(e=>`${t}-${e}-${n}`)}function getThemeClassNames({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(e=>{var i,a;return null==(a=resolveClassNames({theme:t,classNames:null==(i=t.components[e])?void 0:i.classNames,props:r,stylesCtx:o}))?void 0:a[n]})}function getVariantClassName({options:e,classes:t,selector:n,unstyled:r}){return(null==e?void 0:e.variant)&&!r?t[`${n}--${e.variant}`]:void 0}function getClassName({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:i,classes:a,unstyled:s,className:l,rootSelector:c,props:u,stylesCtx:d,withStaticClasses:p,headless:h,transformedStyles:f}){return clsx$2(getGlobalClassNames({theme:e,options:t,unstyled:s||h}),getThemeClassNames({theme:e,themeName:n,selector:r,props:u,stylesCtx:d}),getVariantClassName({options:t,classes:a,selector:r,unstyled:s}),getResolvedClassNames({selector:r,stylesCtx:d,theme:e,classNames:i,props:u}),getResolvedClassNames({selector:r,stylesCtx:d,theme:e,classNames:f,props:u}),getOptionsClassNames({selector:r,stylesCtx:d,options:t,props:u,theme:e}),getRootClassName({rootSelector:c,selector:r,className:l}),getSelectorClassName({selector:r,classes:a,unstyled:s||h}),p&&!h&&getStaticClassNames({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:null==t?void 0:t.withStaticClass}),null==t?void 0:t.className)}function getThemeStyles({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(t=>{var i;return resolveStyles({theme:e,styles:null==(i=e.components[t])?void 0:i.styles,props:n,stylesCtx:r})[o]}).reduce((e,t)=>({...e,...t}),{})}function resolveStyle({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...resolveStyle({style:n,theme:t})}),{}):"function"==typeof e?e(t):null==e?{}:e}function mergeVars(e){return e.reduce((e,t)=>(t&&Object.keys(t).forEach(n=>{e[n]={...e[n],...filterProps(t[n])}}),e),{})}function resolveVars({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:i,themeName:a,headless:s}){var l;return null==(l=mergeVars([s?{}:null==t?void 0:t(n,r,o),...a.map(e=>{var t,i,a;return null==(a=null==(i=null==(t=n.components)?void 0:t[e])?void 0:i.vars)?void 0:a.call(i,n,r,o)}),null==e?void 0:e(n,r,o)]))?void 0:l[i]}function getStyle({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:i,rootSelector:a,styles:s,style:l,vars:c,varsResolver:u,headless:d,withStylesTransform:p}){return{...!p&&getThemeStyles({theme:e,themeName:t,props:o,stylesCtx:i,selector:n}),...!p&&resolveStyles({theme:e,styles:s,props:o,stylesCtx:i})[n],...!p&&resolveStyles({theme:e,styles:null==r?void 0:r.styles,props:(null==r?void 0:r.props)||o,stylesCtx:i})[n],...resolveVars({theme:e,props:o,stylesCtx:i,vars:c,varsResolver:u,selector:n,themeName:t,headless:d}),...a===n?resolveStyle({style:l,theme:e}):null,...resolveStyle({style:null==r?void 0:r.style,theme:e})}}function useStylesTransform({props:e,stylesCtx:t,themeName:n}){var r;const o=useMantineTheme(),i=null==(r=useMantineStylesTransform())?void 0:r();return{getTransformedStyles:r=>{if(!i)return[];return[...r.map(n=>i(n,{props:e,theme:o,ctx:t})),...n.map(n=>{var r;return i(null==(r=o.components[n])?void 0:r.styles,{props:e,theme:o,ctx:t})})].filter(Boolean)},withStylesTransform:!!i}}function useStyles$u({name:e,classes:t,props:n,stylesCtx:r,className:o,style:i,rootSelector:a="root",unstyled:s,classNames:l,styles:c,vars:u,varsResolver:d}){const p=useMantineTheme(),h=useMantineClassNamesPrefix(),f=useMantineWithStaticClasses(),A=useMantineIsHeadless(),m=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:g,getTransformedStyles:y}=useStylesTransform({props:n,stylesCtx:r,themeName:m});return(e,v)=>({className:getClassName({theme:p,options:v,themeName:m,selector:e,classNamesPrefix:h,classNames:l,classes:t,unstyled:s,className:o,rootSelector:a,props:n,stylesCtx:r,withStaticClasses:f,headless:A,transformedStyles:y([null==v?void 0:v.styles,c])}),style:getStyle({theme:p,themeName:m,selector:e,options:v,props:n,stylesCtx:r,rootSelector:a,styles:c,style:i,vars:u,varsResolver:d,headless:A,withStylesTransform:g})})}function getAutoContrastValue(e,t){return"boolean"==typeof e?e:t.autoContrast}function useProps(e,t,n){var r;const o=useMantineTheme(),i=null==(r=o.components[e])?void 0:r.defaultProps;return{...t,..."function"==typeof i?i(o):i,...filterProps(n)}}function createTheme(e){return e}function cssObjectToString(e){return keys(e).reduce((t,n)=>void 0!==e[n]?`${t}${camelToKebabCase(n)}:${e[n]};`:t,"").trim()}function stylesToString({selector:e,styles:t,media:n,container:r}){const o=t?cssObjectToString(t):"",i=Array.isArray(n)?n.map(t=>`@media${t.query}{${e}{${cssObjectToString(t.styles)}}}`):[],a=Array.isArray(r)?r.map(t=>`@container ${t.query}{${e}{${cssObjectToString(t.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${i.join("")}${a.join("")}`.trim()}function InlineStyles(e){const t=useMantineStyleNonce();return factory$1("style",{"data-mantine-styles":"inline",nonce:null==t?void 0:t(),dangerouslySetInnerHTML:{__html:stylesToString(e)}})}function extractStyleProps(e){const{m:t,mx:n,my:r,mt:o,mb:i,ml:a,mr:s,me:l,ms:c,p:u,px:d,py:p,pt:h,pb:f,pl:A,pr:m,pe:g,ps:y,bd:v,bg:b,c:x,opacity:w,ff:C,fz:$,fw:_,lts:S,ta:E,lh:k,fs:B,tt:P,td:T,w:I,miw:L,maw:M,h:D,mih:N,mah:F,bgsz:O,bgp:R,bgr:U,bga:j,pos:H,top:Q,left:z,bottom:V,right:W,inset:Y,display:G,flex:K,hiddenFrom:q,visibleFrom:J,lightHidden:Z,darkHidden:X,sx:ee,...te}=e;return{styleProps:filterProps({m:t,mx:n,my:r,mt:o,mb:i,ml:a,mr:s,me:l,ms:c,p:u,px:d,py:p,pt:h,pb:f,pl:A,pr:m,pe:g,ps:y,bd:v,bg:b,c:x,opacity:w,ff:C,fz:$,fw:_,lts:S,ta:E,lh:k,fs:B,tt:P,td:T,w:I,miw:L,maw:M,h:D,mih:N,mah:F,bgsz:O,bgp:R,bgr:U,bga:j,pos:H,top:Q,left:z,bottom:V,right:W,inset:Y,display:G,flex:K,hiddenFrom:q,visibleFrom:J,lightHidden:Z,darkHidden:X,sx:ee}),rest:te}}const STYlE_PROPS_DATA={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function colorResolver(e,t){const n=parseThemeColor({color:e,theme:t});return"dimmed"===n.color?"var(--mantine-color-dimmed)":"bright"===n.color?"var(--mantine-color-bright)":n.variable?`var(${n.variable})`:n.color}function textColorResolver(e,t){const n=parseThemeColor({color:e,theme:t});return n.isThemeColor&&void 0===n.shade?`var(--mantine-color-${n.color}-text)`:colorResolver(e,t)}function borderResolver(e,t){if("number"==typeof e)return rem(e);if("string"==typeof e){const[n,r,...o]=e.split(" ").filter(e=>""!==e.trim());let i=`${rem(n)}`;return r&&(i+=` ${r}`),o.length>0&&(i+=` ${colorResolver(o.join(" "),t)}`),i.trim()}return e}const values={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function fontFamilyResolver(e){return"string"==typeof e&&e in values?values[e]:e}const headings$1=["h1","h2","h3","h4","h5","h6"];function fontSizeResolver(e,t){return"string"==typeof e&&e in t.fontSizes?`var(--mantine-font-size-${e})`:"string"==typeof e&&headings$1.includes(e)?`var(--mantine-${e}-font-size)`:"number"==typeof e||"string"==typeof e?rem(e):e}function identityResolver(e){return e}const headings=["h1","h2","h3","h4","h5","h6"];function lineHeightResolver(e,t){return"string"==typeof e&&e in t.lineHeights?`var(--mantine-line-height-${e})`:"string"==typeof e&&headings.includes(e)?`var(--mantine-${e}-line-height)`:e}function sizeResolver(e){return"number"==typeof e?rem(e):e}function spacingResolver(e,t){if("number"==typeof e)return rem(e);if("string"==typeof e){const n=e.replace("-","");if(!(n in t.spacing))return rem(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const resolvers={color:colorResolver,textColor:textColorResolver,fontSize:fontSizeResolver,spacing:spacingResolver,identity:identityResolver,size:sizeResolver,lineHeight:lineHeightResolver,fontFamily:fontFamilyResolver,border:borderResolver};function replaceMediaQuery(e){return e.replace("(min-width: ","").replace("em)","")}function sortMediaQueries({media:e,...t}){const n=Object.keys(e).sort((e,t)=>Number(replaceMediaQuery(e))-Number(replaceMediaQuery(t))).map(t=>({query:t,styles:e[t]}));return{...t,media:n}}function hasResponsiveStyles(e){if("object"!=typeof e||null===e)return!1;const t=Object.keys(e);return 1!==t.length||"base"!==t[0]}function getBaseValue(e){return"object"==typeof e&&null!==e?"base"in e?e.base:void 0:e}function getBreakpointKeys(e){return"object"==typeof e&&null!==e?keys(e).filter(e=>"base"!==e):[]}function getBreakpointValue(e,t){return"object"==typeof e&&null!==e&&t in e?e[t]:e}function parseStyleProps({styleProps:e,data:t,theme:n}){return sortMediaQueries(keys(e).reduce((r,o)=>{if("hiddenFrom"===o||"visibleFrom"===o||"sx"===o)return r;const i=t[o],a=Array.isArray(i.property)?i.property:[i.property],s=getBaseValue(e[o]);if(!hasResponsiveStyles(e[o]))return a.forEach(e=>{r.inlineStyles[e]=resolvers[i.type](s,n)}),r;r.hasResponsiveStyles=!0;const l=getBreakpointKeys(e[o]);return a.forEach(t=>{s&&(r.styles[t]=resolvers[i.type](s,n)),l.forEach(a=>{const s=`(min-width: ${n.breakpoints[a]})`;r.media[s]={...r.media[s],[t]:resolvers[i.type](getBreakpointValue(e[o],a),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function useRandomClassName(){return`__m__-${reactExports.useId().replace(/:/g,"")}`}function createPolymorphicComponent(e){return e}function transformModKey(e){return e.startsWith("data-")?e:`data-${e}`}function getMod(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return void 0===r||""===r||!1===r||null===r||(t[transformModKey(n)]=e[n]),t},{})}function getBoxMod(e){return e?"string"==typeof e?{[transformModKey(e)]:!0}:Array.isArray(e)?[...e].reduce((e,t)=>({...e,...getBoxMod(t)}),{}):getMod(e):null}function mergeStyles(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...mergeStyles(n,t)}),{}):"function"==typeof e?e(t):null==e?{}:e}function getBoxStyle({theme:e,style:t,vars:n,styleProps:r}){return{...mergeStyles(t,e),...mergeStyles(n,e),...r}}const _Box=reactExports.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:i,size:a,hiddenFrom:s,visibleFrom:l,lightHidden:c,darkHidden:u,renderRoot:d,__size:p,...h},f)=>{var A;const m=useMantineTheme(),g=e||"div",{styleProps:y,rest:v}=extractStyleProps(h),b=useMantineSxTransform(),x=null==(A=null==b?void 0:b())?void 0:A(y.sx),w=useRandomClassName(),C=parseStyleProps({styleProps:y,theme:m,data:STYlE_PROPS_DATA}),$={ref:f,style:getBoxStyle({theme:m,style:t,vars:n,styleProps:C.inlineStyles}),className:clsx$2(r,x,{[w]:C.hasResponsiveStyles,"mantine-light-hidden":c,"mantine-dark-hidden":u,[`mantine-hidden-from-${s}`]:s,[`mantine-visible-from-${l}`]:l}),"data-variant":o,"data-size":isNumberLike(a)?void 0:a||void 0,size:p,...getBoxMod(i),...v};return factory$1(Fragment,{children:[C.hasResponsiveStyles&&factory$1(InlineStyles,{selector:`.${w}`,styles:C.styles,media:C.media}),"function"==typeof d?d($):factory$1(g,{...$})]})});_Box.displayName="@mantine/core/Box";const Box=createPolymorphicComponent(_Box);function identity(e){return e}function factory(e){const t=reactExports.forwardRef(e);return t.extend=identity,t.withProps=e=>{const n=reactExports.forwardRef((n,r)=>factory$1(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t}function polymorphicFactory(e){const t=reactExports.forwardRef(e);return t.withProps=e=>{const n=reactExports.forwardRef((n,r)=>factory$1(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t.extend=identity,t}const DirectionContext=reactExports.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function useDirection(){return reactExports.useContext(DirectionContext)}const[ScrollAreaProvider,useScrollAreaContext]=createSafeContext("ScrollArea.Root component was not found in tree");function useResizeObserver(e,t){const n=useCallbackRef(t);useIsomorphicEffect(()=>{let t=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}const Corner=reactExports.forwardRef((e,t)=>{const{style:n,...r}=e,o=useScrollAreaContext(),[i,a]=reactExports.useState(0),[s,l]=reactExports.useState(0),c=Boolean(i&&s);return useResizeObserver(o.scrollbarX,()=>{var e;const t=(null==(e=o.scrollbarX)?void 0:e.offsetHeight)||0;o.onCornerHeightChange(t),l(t)}),useResizeObserver(o.scrollbarY,()=>{var e;const t=(null==(e=o.scrollbarY)?void 0:e.offsetWidth)||0;o.onCornerWidthChange(t),a(t)}),c?factory$1("div",{...r,ref:t,style:{...n,width:i,height:s}}):null}),ScrollAreaCorner=reactExports.forwardRef((e,t)=>{const n=useScrollAreaContext(),r=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&r?factory$1(Corner,{...e,ref:t}):null}),defaultProps$$={scrollHideDelay:1e3,type:"hover"},ScrollAreaRoot=reactExports.forwardRef((e,t)=>{const n=useProps("ScrollAreaRoot",defaultProps$$,e),{type:r,scrollHideDelay:o,scrollbars:i,...a}=n,[s,l]=reactExports.useState(null),[c,u]=reactExports.useState(null),[d,p]=reactExports.useState(null),[h,f]=reactExports.useState(null),[A,m]=reactExports.useState(null),[g,y]=reactExports.useState(0),[v,b]=reactExports.useState(0),[x,w]=reactExports.useState(!1),[C,$]=reactExports.useState(!1),_=useMergedRef(t,e=>l(e));return factory$1(ScrollAreaProvider,{value:{type:r,scrollHideDelay:o,scrollArea:s,viewport:c,onViewportChange:u,content:d,onContentChange:p,scrollbarX:h,onScrollbarXChange:f,scrollbarXEnabled:x,onScrollbarXEnabledChange:w,scrollbarY:A,onScrollbarYChange:m,scrollbarYEnabled:C,onScrollbarYEnabledChange:$,onCornerWidthChange:y,onCornerHeightChange:b},children:factory$1(Box,{...a,ref:_,__vars:{"--sa-corner-width":"xy"!==i?"0px":`${g}px`,"--sa-corner-height":"xy"!==i?"0px":`${v}px`}})})});function getThumbRatio(e,t){const n=e/t;return Number.isNaN(n)?0:n}function getThumbSize(e){const t=getThumbRatio(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function linearScale(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function clamp$1(e,[t,n]){return Math.min(n,Math.max(t,e))}function getThumbOffsetFromScroll(e,t,n="ltr"){const r=getThumbSize(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,s=i-r,l=clamp$1(e,"ltr"===n?[0,a]:[-1*a,0]);return linearScale([0,a],[0,s])(l)}function getScrollPositionFromPointer(e,t,n,r="ltr"){const o=getThumbSize(n),i=t||o/2,a=o-i,s=n.scrollbar.paddingStart+i,l=n.scrollbar.size-n.scrollbar.paddingEnd-a,c=n.content-n.viewport;return linearScale([s,l],"ltr"===r?[0,c]:[-1*c,0])(e)}function isScrollingWithinScrollbarBounds(e,t){return e>0&&e<t}function toInt(e){return e?parseInt(e,10):0}function composeEventHandlers(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{null==e||e(r),!1!==n&&r.defaultPrevented||null==t||t(r)}}ScrollAreaRoot.displayName="@mantine/core/ScrollAreaRoot";const[ScrollbarProvider,useScrollbarContext]=createSafeContext("ScrollAreaScrollbar was not found in tree"),Scrollbar=reactExports.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:s,onDragScroll:l,onWheelScroll:c,onResize:u,...d}=e,p=useScrollAreaContext(),[h,f]=reactExports.useState(null),A=useMergedRef(t,e=>f(e)),m=reactExports.useRef(null),g=reactExports.useRef(""),{viewport:y}=p,v=n.content-n.viewport,b=useCallbackRef(c),x=useCallbackRef(s),w=useDebouncedCallback(u,10),C=e=>{if(m.current){const t=e.clientX-m.current.left,n=e.clientY-m.current.top;l({x:t,y:n})}};return reactExports.useEffect(()=>{const e=e=>{const t=e.target;(null==h?void 0:h.contains(t))&&b(e,v)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[y,h,v,b]),reactExports.useEffect(x,[n,x]),useResizeObserver(h,w),useResizeObserver(p.content,w),factory$1(ScrollbarProvider,{value:{scrollbar:h,hasThumb:r,onThumbChange:useCallbackRef(o),onThumbPointerUp:useCallbackRef(i),onThumbPositionChange:x,onThumbPointerDown:useCallbackRef(a)},children:factory$1("div",{...d,ref:A,"data-mantine-scrollbar":!0,style:{position:"absolute",...d.style},onPointerDown:composeEventHandlers(e.onPointerDown,e=>{e.preventDefault();if(0===e.button){e.target.setPointerCapture(e.pointerId),m.current=h.getBoundingClientRect(),g.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",C(e)}}),onPointerMove:composeEventHandlers(e.onPointerMove,C),onPointerUp:composeEventHandlers(e.onPointerUp,e=>{e.preventDefault();const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=g.current,m.current=null})})})}),ScrollAreaScrollbarX=reactExports.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,a=useScrollAreaContext(),[s,l]=reactExports.useState(),c=reactExports.useRef(null),u=useMergedRef(t,c,a.onScrollbarXChange);return reactExports.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),factory$1(Scrollbar,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{...o,"--sa-thumb-width":`${getThumbSize(n)}px`},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){const r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),isScrollingWithinScrollbarBounds(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&s&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:toInt(s.paddingLeft),paddingEnd:toInt(s.paddingRight)}})}})}),ScrollAreaScrollbarY=reactExports.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,a=useScrollAreaContext(),[s,l]=reactExports.useState(),c=reactExports.useRef(null),u=useMergedRef(t,c,a.onScrollbarYChange);return reactExports.useEffect(()=>{c.current&&l(window.getComputedStyle(c.current))},[]),factory$1(Scrollbar,{...i,"data-orientation":"vertical",ref:u,sizes:n,style:{"--sa-thumb-height":`${getThumbSize(n)}px`,...o},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){const r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),isScrollingWithinScrollbarBounds(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&s&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:toInt(s.paddingTop),paddingEnd:toInt(s.paddingBottom)}})}})}),ScrollAreaScrollbarVisible=reactExports.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=useDirection(),i=useScrollAreaContext(),a=reactExports.useRef(null),s=reactExports.useRef(0),[l,c]=reactExports.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=getThumbRatio(l.viewport,l.content),d={...r,sizes:l,onSizesChange:c,hasThumb:Boolean(u>0&&u<1),onThumbChange:e=>{a.current=e},onThumbPointerUp:()=>{s.current=0},onThumbPointerDown:e=>{s.current=e}},p=(e,t)=>getScrollPositionFromPointer(e,s.current,l,t);return"horizontal"===n?factory$1(ScrollAreaScrollbarX,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const e=getThumbOffsetFromScroll(i.viewport.scrollLeft,l,o);a.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=p(e,o))}}):"vertical"===n?factory$1(ScrollAreaScrollbarY,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const e=getThumbOffsetFromScroll(i.viewport.scrollTop,l);0===l.scrollbar.size?a.current.style.opacity="0":a.current.style.opacity="1",a.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=p(e))}}):null}),ScrollAreaScrollbarAuto=reactExports.forwardRef((e,t)=>{const n=useScrollAreaContext(),{forceMount:r,...o}=e,[i,a]=reactExports.useState(!1),s="horizontal"===e.orientation,l=useDebouncedCallback(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;a(s?e:t)}},10);return useResizeObserver(n.viewport,l),useResizeObserver(n.content,l),r||i?factory$1(ScrollAreaScrollbarVisible,{"data-state":i?"visible":"hidden",...o,ref:t}):null}),ScrollAreaScrollbarHover=reactExports.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=useScrollAreaContext(),[i,a]=reactExports.useState(!1);return reactExports.useEffect(()=>{const{scrollArea:e}=o;let t=0;if(e){const n=()=>{window.clearTimeout(t),a(!0)},r=()=>{t=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[o.scrollArea,o.scrollHideDelay]),n||i?factory$1(ScrollAreaScrollbarAuto,{"data-state":i?"visible":"hidden",...r,ref:t}):null}),ScrollAreaScrollbarScroll=reactExports.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=useScrollAreaContext(),i="horizontal"===e.orientation,[a,s]=reactExports.useState("hidden"),l=useDebouncedCallback(()=>s("idle"),100);return reactExports.useEffect(()=>{if("idle"===a){const e=window.setTimeout(()=>s("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(e)}},[a,o.scrollHideDelay]),reactExports.useEffect(()=>{const{viewport:e}=o,t=i?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(s("scrolling"),l()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[o.viewport,i,l]),n||"hidden"!==a?factory$1(ScrollAreaScrollbarVisible,{"data-state":"hidden"===a?"hidden":"visible",...r,ref:t,onPointerEnter:composeEventHandlers(e.onPointerEnter,()=>s("interacting")),onPointerLeave:composeEventHandlers(e.onPointerLeave,()=>s("idle"))}):null}),ScrollAreaScrollbar=reactExports.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=useScrollAreaContext(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,s="horizontal"===e.orientation;return reactExports.useEffect(()=>(s?i(!0):a(!0),()=>{s?i(!1):a(!1)}),[s,i,a]),"hover"===o.type?factory$1(ScrollAreaScrollbarHover,{...r,ref:t,forceMount:n}):"scroll"===o.type?factory$1(ScrollAreaScrollbarScroll,{...r,ref:t,forceMount:n}):"auto"===o.type?factory$1(ScrollAreaScrollbarAuto,{...r,ref:t,forceMount:n}):"always"===o.type?factory$1(ScrollAreaScrollbarVisible,{...r,ref:t}):null});function addUnlinkedScrollListener(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,s=n.top!==i.top;(a||s)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)}const Thumb$1=reactExports.forwardRef((e,t)=>{const{style:n,...r}=e,o=useScrollAreaContext(),i=useScrollbarContext(),{onThumbPositionChange:a}=i,s=useMergedRef(t,e=>i.onThumbChange(e)),l=reactExports.useRef(),c=useDebouncedCallback(()=>{l.current&&(l.current(),l.current=void 0)},100);return reactExports.useEffect(()=>{const{viewport:e}=o;if(e){const t=()=>{if(c(),!l.current){const t=addUnlinkedScrollListener(e,a);l.current=t,a()}};return a(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,c,a]),factory$1("div",{"data-state":i.hasThumb?"visible":"hidden",...r,ref:s,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:composeEventHandlers(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;i.onThumbPointerDown({x:n,y:r})}),onPointerUp:composeEventHandlers(e.onPointerUp,i.onThumbPointerUp)})}),ScrollAreaThumb=reactExports.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=useScrollbarContext();return n||o.hasThumb?factory$1(Thumb$1,{ref:t,...r}):null}),ScrollAreaViewport=reactExports.forwardRef(({children:e,style:t,...n},r)=>{const o=useScrollAreaContext(),i=useMergedRef(r,o.onViewportChange);return factory$1(Box,{...n,ref:i,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t},children:factory$1("div",{style:{minWidth:"100%",display:"table"},ref:o.onContentChange,children:e})})});ScrollAreaViewport.displayName="@mantine/core/ScrollAreaViewport";var classes$p={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const defaultProps$_={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},varsResolver$n=createVarsResolver((e,{scrollbarSize:t})=>({root:{"--scrollarea-scrollbar-size":rem(t)}})),ScrollArea=factory((e,t)=>{const n=useProps("ScrollArea",defaultProps$_,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,scrollbarSize:l,vars:c,type:u,scrollHideDelay:d,viewportProps:p,viewportRef:h,onScrollPositionChange:f,children:A,offsetScrollbars:m,scrollbars:g,onBottomReached:y,onTopReached:v,...b}=n,[x,w]=reactExports.useState(!1),C=useStyles$u({name:"ScrollArea",props:n,classes:classes$p,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:c,varsResolver:varsResolver$n});return factory$1(ScrollAreaRoot,{type:"never"===u?"always":u,scrollHideDelay:d,ref:t,scrollbars:g,...C("root"),...b,children:[factory$1(ScrollAreaViewport,{...p,...C("viewport",{style:null==p?void 0:p.style}),ref:h,"data-offset-scrollbars":!0===m?"xy":m||void 0,"data-scrollbars":g||void 0,onScroll:e=>{var t;null==(t=null==p?void 0:p.onScroll)||t.call(p,e),null==f||f({x:e.currentTarget.scrollLeft,y:e.currentTarget.scrollTop});const{scrollTop:n,scrollHeight:r,clientHeight:o}=e.currentTarget;n-(r-o)===0&&(null==y||y()),0===n&&(null==v||v())},children:A}),("xy"===g||"x"===g)&&factory$1(ScrollAreaScrollbar,{...C("scrollbar"),orientation:"horizontal","data-hidden":"never"===u||void 0,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:factory$1(ScrollAreaThumb,{...C("thumb")})}),("xy"===g||"y"===g)&&factory$1(ScrollAreaScrollbar,{...C("scrollbar"),orientation:"vertical","data-hidden":"never"===u||void 0,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:factory$1(ScrollAreaThumb,{...C("thumb")})}),factory$1(ScrollAreaCorner,{...C("corner"),"data-hovered":x||void 0,"data-hidden":"never"===u||void 0})]})});ScrollArea.displayName="@mantine/core/ScrollArea";const ScrollAreaAutosize=factory((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:i,scrollHideDelay:a,type:s,dir:l,offsetScrollbars:c,viewportRef:u,onScrollPositionChange:d,unstyled:p,variant:h,viewportProps:f,scrollbars:A,style:m,vars:g,onBottomReached:y,...v}=useProps("ScrollAreaAutosize",defaultProps$_,e);return factory$1(Box,{...v,ref:t,style:[{display:"flex",overflow:"auto"},m],children:factory$1(Box,{style:{display:"flex",flexDirection:"column",flex:1},children:factory$1(ScrollArea,{classNames:r,styles:o,scrollHideDelay:a,scrollbarSize:i,type:s,dir:l,offsetScrollbars:c,viewportRef:u,onScrollPositionChange:d,unstyled:p,variant:h,viewportProps:f,vars:g,scrollbars:A,onBottomReached:y,children:n})})})});ScrollArea.classes=classes$p,ScrollAreaAutosize.displayName="@mantine/core/ScrollAreaAutosize",ScrollAreaAutosize.classes=classes$p,ScrollArea.Autosize=ScrollAreaAutosize;var classes$o={root:"m_87cf2631"};const defaultProps$Z={__staticSelector:"UnstyledButton"},UnstyledButton=polymorphicFactory((e,t)=>{const n=useProps("UnstyledButton",defaultProps$Z,e),{className:r,component:o="button",__staticSelector:i,unstyled:a,classNames:s,styles:l,style:c,...u}=n,d=useStyles$u({name:i,props:n,classes:classes$o,className:r,style:c,classNames:s,styles:l,unstyled:a});return factory$1(Box,{...d("root",{focusable:!0}),component:o,ref:t,type:"button"===o?"button":void 0,...u})});UnstyledButton.classes=classes$o,UnstyledButton.displayName="@mantine/core/UnstyledButton";var classes$n={root:"m_515a97f8"};const defaultProps$Y={},VisuallyHidden=factory((e,t)=>{const n=useProps("VisuallyHidden",defaultProps$Y,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,...c}=n,u=useStyles$u({name:"VisuallyHidden",classes:classes$n,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s});return factory$1(Box,{component:"span",ref:t,...u("root"),...c})});function hasWindow(){return"undefined"!=typeof window}function getNodeName(e){return isNode(e)?(e.nodeName||"").toLowerCase():"#document"}function getWindow(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function getDocumentElement(e){var t;return null==(t=(isNode(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function isNode(e){return!!hasWindow()&&(e instanceof Node||e instanceof getWindow(e).Node)}function isElement$1(e){return!!hasWindow()&&(e instanceof Element||e instanceof getWindow(e).Element)}function isHTMLElement(e){return!!hasWindow()&&(e instanceof HTMLElement||e instanceof getWindow(e).HTMLElement)}function isShadowRoot(e){return!(!hasWindow()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof getWindow(e).ShadowRoot)}VisuallyHidden.classes=classes$n,VisuallyHidden.displayName="@mantine/core/VisuallyHidden";const invalidOverflowDisplayValues=new Set(["inline","contents"]);function isOverflowElement(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=getComputedStyle$1(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!invalidOverflowDisplayValues.has(o)}const tableElements=new Set(["table","td","th"]);function isTableElement(e){return tableElements.has(getNodeName(e))}const topLayerSelectors=[":popover-open",":modal"];function isTopLayer(e){return topLayerSelectors.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const transformProperties=["transform","translate","scale","rotate","perspective"],willChangeValues=["transform","translate","scale","rotate","perspective","filter"],containValues=["paint","layout","strict","content"];function isContainingBlock(e){const t=isWebKit(),n=isElement$1(e)?getComputedStyle$1(e):e;return transformProperties.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||willChangeValues.some(e=>(n.willChange||"").includes(e))||containValues.some(e=>(n.contain||"").includes(e))}function getContainingBlock(e){let t=getParentNode(e);for(;isHTMLElement(t)&&!isLastTraversableNode(t);){if(isContainingBlock(t))return t;if(isTopLayer(t))return null;t=getParentNode(t)}return null}function isWebKit(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const lastTraversableNodeNames=new Set(["html","body","#document"]);function isLastTraversableNode(e){return lastTraversableNodeNames.has(getNodeName(e))}function getComputedStyle$1(e){return getWindow(e).getComputedStyle(e)}function getNodeScroll(e){return isElement$1(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function getParentNode(e){if("html"===getNodeName(e))return e;const t=e.assignedSlot||e.parentNode||isShadowRoot(e)&&e.host||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getNearestOverflowAncestor(e){const t=getParentNode(e);return isLastTraversableNode(t)?e.ownerDocument?e.ownerDocument.body:e.body:isHTMLElement(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=getNearestOverflowAncestor(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=getWindow(o);if(i){const e=getFrameElement(a);return t.concat(a,a.visualViewport||[],isOverflowElement(o)?o:[],e&&n?getOverflowAncestors(e):[])}return t.concat(o,getOverflowAncestors(o,[],n))}function getFrameElement(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const min$2=Math.min,max$3=Math.max,round$2=Math.round,floor$3=Math.floor,createCoords=e=>({x:e,y:e}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp(e,t,n){return max$3(e,min$2(t,n))}function evaluate(e,t){return"function"==typeof e?e(t):e}function getSide(e){return e.split("-")[0]}function getAlignment(e){return e.split("-")[1]}function getOppositeAxis(e){return"x"===e?"y":"x"}function getAxisLength(e){return"y"===e?"height":"width"}const yAxisSides=new Set(["top","bottom"]);function getSideAxis(e){return yAxisSides.has(getSide(e))?"y":"x"}function getAlignmentAxis(e){return getOppositeAxis(getSideAxis(e))}function getAlignmentSides(e,t,n){void 0===n&&(n=!1);const r=getAlignment(e),o=getAlignmentAxis(e),i=getAxisLength(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=getOppositePlacement(a)),[a,getOppositePlacement(a)]}function getExpandedPlacements(e){const t=getOppositePlacement(e);return[getOppositeAlignmentPlacement(e),t,getOppositeAlignmentPlacement(t)]}function getOppositeAlignmentPlacement(e){return e.replace(/start|end/g,e=>oppositeAlignmentMap[e])}const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(e,t,n){switch(e){case"top":case"bottom":return n?t?rlPlacement:lrPlacement:t?lrPlacement:rlPlacement;case"left":case"right":return t?tbPlacement:btPlacement;default:return[]}}function getOppositeAxisPlacements(e,t,n,r){const o=getAlignment(e);let i=getSideList(getSide(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(getOppositeAlignmentPlacement)))),i}function getOppositePlacement(e){return e.replace(/left|right|bottom|top/g,e=>oppositeSideMap[e])}function expandPaddingObject(e){return{top:0,right:0,bottom:0,left:0,...e}}function getPaddingObject(e){return"number"!=typeof e?expandPaddingObject(e):{top:e,right:e,bottom:e,left:e}}function rectToClientRect(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function computeCoordsFromPlacement(e,t,n){let{reference:r,floating:o}=e;const i=getSideAxis(t),a=getAlignmentAxis(t),s=getAxisLength(a),l=getSide(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(getAlignment(t)){case"start":h[a]-=p*(n&&c?-1:1);break;case"end":h[a]+=p*(n&&c?-1:1)}return h}async function detectOverflow(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=evaluate(t,e),f=getPaddingObject(h),A=s[p?"floating"===d?"reference":"floating":d],m=rectToClientRect(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(A)))||n?A:A.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),g="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),v=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=rectToClientRect(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:y,strategy:l}):g);return{top:(m.top-b.top+f.top)/v.y,bottom:(b.bottom-m.bottom+f.bottom)/v.y,left:(m.left-b.left+f.left)/v.x,right:(b.right-m.right+f.right)/v.x}}const computePosition$1=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=computeCoordsFromPlacement(c,r,l),p=r,h={},f=0;for(let m=0;m<s.length;m++){var A;const{name:n,fn:i}=s[m],{x:g,y:y,data:v,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:{...a,detectOverflow:null!=(A=a.detectOverflow)?A:detectOverflow},elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,h={...h,[n]:{...h[n],...v}},b&&f<=50&&(f++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=computeCoordsFromPlacement(c,p,l))),m=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}},arrow$3=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=evaluate(e,t)||{};if(null==c)return{};const d=getPaddingObject(u),p={x:n,y:r},h=getAlignmentAxis(o),f=getAxisLength(h),A=await a.getDimensions(c),m="y"===h,g=m?"top":"left",y=m?"bottom":"right",v=m?"clientHeight":"clientWidth",b=i.reference[f]+i.reference[h]-p[h]-i.floating[f],x=p[h]-i.reference[h],w=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let C=w?w[v]:0;C&&await(null==a.isElement?void 0:a.isElement(w))||(C=s.floating[v]||i.floating[f]);const $=b/2-x/2,_=C/2-A[f]/2-1,S=min$2(d[g],_),E=min$2(d[y],_),k=S,B=C-A[f]-E,P=C/2-A[f]/2+$,T=clamp(k,P,B),I=!l.arrow&&null!=getAlignment(o)&&P!==T&&i.reference[f]/2-(P<k?S:E)-A[f]/2<0,L=I?P<k?P-k:P-B:0;return{[h]:p[h]+L,data:{[h]:T,centerOffset:P-T-L,...I&&{alignmentOffset:L}},reset:I}}}),flip$2=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:A=!0,...m}=evaluate(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=getSide(o),y=getSideAxis(s),v=getSide(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=p||(v||!A?[getOppositePlacement(s)]:getExpandedPlacements(s)),w="none"!==f;!p&&w&&x.push(...getOppositeAxisPlacements(s,A,f,b));const C=[s,...x],$=await l.detectOverflow(t,m),_=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&_.push($[g]),d){const e=getAlignmentSides(o,a,b);_.push($[e[0]],$[e[1]])}if(S=[...S,{placement:o,overflows:_}],!_.every(e=>e<=0)){var E,k;const e=((null==(E=i.flip)?void 0:E.index)||0)+1,t=C[e];if(t){if(!("alignment"===d&&y!==getSideAxis(t))||S.every(e=>getSideAxis(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:S},reset:{placement:t}}}let n=null==(k=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:k.placement;if(!n)switch(h){case"bestFit":{var B;const e=null==(B=S.filter(e=>{if(w){const t=getSideAxis(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:B[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}};function getBoundingRect(e){const t=min$2(...e.map(e=>e.left)),n=min$2(...e.map(e=>e.top));return{x:t,y:n,width:max$3(...e.map(e=>e.right))-t,height:max$3(...e.map(e=>e.bottom))-n}}function getRectsByLine(e){const t=e.slice().sort((e,t)=>e.y-t.y),n=[];let r=null;for(let o=0;o<t.length;o++){const e=t[o];!r||e.y-r.y>r.height/2?n.push([e]):n[n.length-1].push(e),r=e}return n.map(e=>rectToClientRect(getBoundingRect(e)))}const inline$4=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:a}=t,{padding:s=2,x:l,y:c}=evaluate(e,t),u=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(r.reference))||[]),d=getRectsByLine(u),p=rectToClientRect(getBoundingRect(u)),h=getPaddingObject(s);const f=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===d.length&&d[0].left>d[1].right&&null!=l&&null!=c)return d.find(e=>l>e.left-h.left&&l<e.right+h.right&&c>e.top-h.top&&c<e.bottom+h.bottom)||p;if(d.length>=2){if("y"===getSideAxis(n)){const e=d[0],t=d[d.length-1],r="top"===getSide(n),o=e.top,i=t.bottom,a=r?e.left:t.left,s=r?e.right:t.right;return{top:o,bottom:i,left:a,right:s,width:s-a,height:i-o,x:a,y:o}}const e="left"===getSide(n),t=max$3(...d.map(e=>e.right)),r=min$2(...d.map(e=>e.left)),o=d.filter(n=>e?n.left===r:n.right===t),i=o[0].top,a=o[o.length-1].bottom;return{top:i,bottom:a,left:r,right:t,width:t-r,height:a-i,x:r,y:i}}return p}},floating:r.floating,strategy:a});return o.reference.x!==f.reference.x||o.reference.y!==f.reference.y||o.reference.width!==f.reference.width||o.reference.height!==f.reference.height?{reset:{rects:f}}:{}}}},originSides=new Set(["left","top"]);async function convertValueToCoords(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=getSide(n),s=getAlignment(n),l="y"===getSideAxis(n),c=originSides.has(a)?-1:1,u=i&&l?-1:1,d=evaluate(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}const offset$2=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await convertValueToCoords(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},shift$2=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=evaluate(e,t),u={x:n,y:r},d=await i.detectOverflow(t,c),p=getSideAxis(getSide(o)),h=getOppositeAxis(p);let f=u[h],A=u[p];if(a){const e="y"===h?"bottom":"right";f=clamp(f+d["y"===h?"top":"left"],f,f-d[e])}if(s){const e="y"===p?"bottom":"right";A=clamp(A+d["y"===p?"top":"left"],A,A-d[e])}const m=l.fn({...t,[h]:f,[p]:A});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:a,[p]:s}}}}}},limitShift$2=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=evaluate(e,t),u={x:n,y:r},d=getSideAxis(o),p=getOppositeAxis(d);let h=u[p],f=u[d];const A=evaluate(s,t),m="number"==typeof A?{mainAxis:A,crossAxis:0}:{mainAxis:0,crossAxis:0,...A};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+m.mainAxis,n=i.reference[p]+i.reference[e]-m.mainAxis;h<t?h=t:h>n&&(h=n)}if(c){var g,y;const e="y"===p?"width":"height",t=originSides.has(getSide(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(g=a.offset)?void 0:g[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[d])||0)-(t?m.crossAxis:0);f<n?f=n:f>r&&(f=r)}return{[p]:h,[d]:f}}}},size$2=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=evaluate(e,t),u=await a.detectOverflow(t,c),d=getSide(o),p=getAlignment(o),h="y"===getSideAxis(o),{width:f,height:A}=i.floating;let m,g;"top"===d||"bottom"===d?(m=d,g=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(g=d,m="end"===p?"top":"bottom");const y=A-u.top-u.bottom,v=f-u.left-u.right,b=min$2(A-u[m],y),x=min$2(f-u[g],v),w=!t.middlewareData.shift;let C=b,$=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&($=v),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(C=y),w&&!p){const e=max$3(u.left,0),t=max$3(u.right,0),n=max$3(u.top,0),r=max$3(u.bottom,0);h?$=f-2*(0!==e||0!==t?e+t:max$3(u.left,u.right)):C=A-2*(0!==n||0!==r?n+r:max$3(u.top,u.bottom))}await l({...t,availableWidth:$,availableHeight:C});const _=await a.getDimensions(s.floating);return f!==_.width||A!==_.height?{reset:{rects:!0}}:{}}}};function getCssDimensions(e){const t=getComputedStyle$1(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=isHTMLElement(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=round$2(n)!==i||round$2(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function unwrapElement(e){return isElement$1(e)?e:e.contextElement}function getScale(e){const t=unwrapElement(e);if(!isHTMLElement(t))return createCoords(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=getCssDimensions(t);let a=(i?round$2(n.width):n.width)/r,s=(i?round$2(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const noOffsets=createCoords(0);function getVisualOffsets(e){const t=getWindow(e);return isWebKit()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:noOffsets}function shouldAddVisualOffsets(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==getWindow(e))&&t}function getBoundingClientRect(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=unwrapElement(e);let a=createCoords(1);t&&(r?isElement$1(r)&&(a=getScale(r)):a=getScale(e));const s=shouldAddVisualOffsets(i,n,r)?getVisualOffsets(i):createCoords(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=getWindow(i),t=r&&isElement$1(r)?getWindow(r):r;let n=e,o=getFrameElement(n);for(;o&&r&&t!==n;){const e=getScale(o),t=o.getBoundingClientRect(),r=getComputedStyle$1(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=getWindow(o),o=getFrameElement(n)}}return rectToClientRect({width:u,height:d,x:l,y:c})}function getWindowScrollBarX(e,t){const n=getNodeScroll(e).scrollLeft;return t?t.left+n:getBoundingClientRect(getDocumentElement(e)).left+n}function getHTMLOffset(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-getWindowScrollBarX(e,n),y:n.top+t.scrollTop}}function convertOffsetParentRelativeRectToViewportRelativeRect(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=getDocumentElement(r),s=!!t&&isTopLayer(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=createCoords(1);const u=createCoords(0),d=isHTMLElement(r);if((d||!d&&!i)&&(("body"!==getNodeName(r)||isOverflowElement(a))&&(l=getNodeScroll(r)),isHTMLElement(r))){const e=getBoundingClientRect(r);c=getScale(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?createCoords(0):getHTMLOffset(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function getClientRects(e){return Array.from(e.getClientRects())}function getDocumentRect(e){const t=getDocumentElement(e),n=getNodeScroll(e),r=e.ownerDocument.body,o=max$3(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=max$3(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+getWindowScrollBarX(e);const s=-n.scrollTop;return"rtl"===getComputedStyle$1(r).direction&&(a+=max$3(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}const SCROLLBAR_MAX=25;function getViewportRect(e,t){const n=getWindow(e),r=getDocumentElement(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=isWebKit();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=getWindowScrollBarX(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=SCROLLBAR_MAX&&(i-=a)}else c<=SCROLLBAR_MAX&&(i+=c);return{width:i,height:a,x:s,y:l}}const absoluteOrFixed=new Set(["absolute","fixed"]);function getInnerBoundingClientRect(e,t){const n=getBoundingClientRect(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=isHTMLElement(e)?getScale(e):createCoords(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}function getClientRectFromClippingAncestor(e,t,n){let r;if("viewport"===t)r=getViewportRect(e,n);else if("document"===t)r=getDocumentRect(getDocumentElement(e));else if(isElement$1(t))r=getInnerBoundingClientRect(t,n);else{const n=getVisualOffsets(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return rectToClientRect(r)}function hasFixedPositionAncestor(e,t){const n=getParentNode(e);return!(n===t||!isElement$1(n)||isLastTraversableNode(n))&&("fixed"===getComputedStyle$1(n).position||hasFixedPositionAncestor(n,t))}function getClippingElementAncestors(e,t){const n=t.get(e);if(n)return n;let r=getOverflowAncestors(e,[],!1).filter(e=>isElement$1(e)&&"body"!==getNodeName(e)),o=null;const i="fixed"===getComputedStyle$1(e).position;let a=i?getParentNode(e):e;for(;isElement$1(a)&&!isLastTraversableNode(a);){const t=getComputedStyle$1(a),n=isContainingBlock(a);n||"fixed"!==t.position||(o=null);(i?!n&&!o:!n&&"static"===t.position&&!!o&&absoluteOrFixed.has(o.position)||isOverflowElement(a)&&!n&&hasFixedPositionAncestor(e,a))?r=r.filter(e=>e!==a):o=t,a=getParentNode(a)}return t.set(e,r),r}function getClippingRect(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?isTopLayer(t)?[]:getClippingElementAncestors(t,this._c):[].concat(n),r],a=i[0],s=i.reduce((e,n)=>{const r=getClientRectFromClippingAncestor(t,n,o);return e.top=max$3(r.top,e.top),e.right=min$2(r.right,e.right),e.bottom=min$2(r.bottom,e.bottom),e.left=max$3(r.left,e.left),e},getClientRectFromClippingAncestor(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function getDimensions(e){const{width:t,height:n}=getCssDimensions(e);return{width:t,height:n}}function getRectRelativeToOffsetParent(e,t,n){const r=isHTMLElement(t),o=getDocumentElement(t),i="fixed"===n,a=getBoundingClientRect(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=createCoords(0);function c(){l.x=getWindowScrollBarX(o)}if(r||!r&&!i)if(("body"!==getNodeName(t)||isOverflowElement(o))&&(s=getNodeScroll(t)),r){const e=getBoundingClientRect(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=!o||r||i?createCoords(0):getHTMLOffset(o,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function isStaticPositioned(e){return"static"===getComputedStyle$1(e).position}function getTrueOffsetParent(e,t){if(!isHTMLElement(e)||"fixed"===getComputedStyle$1(e).position)return null;if(t)return t(e);let n=e.offsetParent;return getDocumentElement(e)===n&&(n=n.ownerDocument.body),n}function getOffsetParent(e,t){const n=getWindow(e);if(isTopLayer(e))return n;if(!isHTMLElement(e)){let t=getParentNode(e);for(;t&&!isLastTraversableNode(t);){if(isElement$1(t)&&!isStaticPositioned(t))return t;t=getParentNode(t)}return n}let r=getTrueOffsetParent(e,t);for(;r&&isTableElement(r)&&isStaticPositioned(r);)r=getTrueOffsetParent(r,t);return r&&isLastTraversableNode(r)&&isStaticPositioned(r)&&!isContainingBlock(r)?n:r||getContainingBlock(e)||n}const getElementRects=async function(e){const t=this.getOffsetParent||getOffsetParent,n=this.getDimensions,r=await n(e.floating);return{reference:getRectRelativeToOffsetParent(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function isRTL(e){return"rtl"===getComputedStyle$1(e).direction}const platform={convertOffsetParentRelativeRectToViewportRelativeRect:convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement:getDocumentElement,getClippingRect:getClippingRect,getOffsetParent:getOffsetParent,getElementRects:getElementRects,getClientRects:getClientRects,getDimensions:getDimensions,getScale:getScale,isElement:isElement$1,isRTL:isRTL};function rectsAreEqual(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function observeMove(e,t){let n,r=null;const o=getDocumentElement(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-floor$3(d)+"px "+-floor$3(o.clientWidth-(u+p))+"px "+-floor$3(o.clientHeight-(d+h))+"px "+-floor$3(u)+"px",threshold:max$3(0,min$2(1,l))||1};let A=!0;function m(t){const r=t[0].intersectionRatio;if(r!==l){if(!A)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||rectsAreEqual(c,e.getBoundingClientRect())||a(),A=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(g){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}function autoUpdate(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=unwrapElement(e),u=o||i?[...c?getOverflowAncestors(c):[],...getOverflowAncestors(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=c&&s?observeMove(c,n):null;let p,h=-1,f=null;a&&(f=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let A=l?getBoundingClientRect(e):null;return l&&function t(){const r=getBoundingClientRect(e);A&&!rectsAreEqual(A,r)&&n();A=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const offset$1=offset$2,shift$1=shift$2,flip$1=flip$2,size$1=size$2,arrow$2=arrow$3,inline$3=inline$4,limitShift$1=limitShift$2,computePosition=(e,t,n)=>{const r=new Map,o={platform:platform,...n},i={...o.platform,_c:r};return computePosition$1(e,t,{...o,platform:i})};var isClient="undefined"!=typeof document,noop$2=function(){},index$3=isClient?reactExports.useLayoutEffect:noop$2;function deepEqual(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!deepEqual(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!deepEqual(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function getDPR(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(e,t){const n=getDPR(e);return Math.round(t*n)/n}function useLatestRef(e){const t=reactExports.useRef(e);return index$3(()=>{t.current=e}),t}function useFloating$1(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=reactExports.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=reactExports.useState(r);deepEqual(p,r)||h(r);const[f,A]=reactExports.useState(null),[m,g]=reactExports.useState(null),y=reactExports.useCallback(e=>{e!==w.current&&(w.current=e,A(e))},[]),v=reactExports.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=i||f,x=a||m,w=reactExports.useRef(null),C=reactExports.useRef(null),$=reactExports.useRef(u),_=null!=l,S=useLatestRef(l),E=useLatestRef(o),k=useLatestRef(c),B=reactExports.useCallback(()=>{if(!w.current||!C.current)return;const e={placement:t,strategy:n,middleware:p};E.current&&(e.platform=E.current),computePosition(w.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==k.current};P.current&&!deepEqual($.current,t)&&($.current=t,reactDomExports.flushSync(()=>{d(t)}))})},[p,t,n,E,k]);index$3(()=>{!1===c&&$.current.isPositioned&&($.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);const P=reactExports.useRef(!1);index$3(()=>(P.current=!0,()=>{P.current=!1}),[]),index$3(()=>{if(b&&(w.current=b),x&&(C.current=x),b&&x){if(S.current)return S.current(b,x,B);B()}},[b,x,B,S,_]);const T=reactExports.useMemo(()=>({reference:w,floating:C,setReference:y,setFloating:v}),[y,v]),I=reactExports.useMemo(()=>({reference:b,floating:x}),[b,x]),L=reactExports.useMemo(()=>{const e={position:n,left:0,top:0};if(!I.floating)return e;const t=roundByDPR(I.floating,u.x),r=roundByDPR(I.floating,u.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...getDPR(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,s,I.floating,u.x,u.y]);return reactExports.useMemo(()=>({...u,update:B,refs:T,elements:I,floatingStyles:L}),[u,B,T,I,L])}const arrow$1=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?arrow$2({element:n.current,padding:r}).fn(t):{}:n?arrow$2({element:n,padding:r}).fn(t):{};var o}}),offset=(e,t)=>({...offset$1(e),options:[e,t]}),shift=(e,t)=>({...shift$1(e),options:[e,t]}),limitShift=(e,t)=>({...limitShift$1(e),options:[e,t]}),flip=(e,t)=>({...flip$1(e),options:[e,t]}),size=(e,t)=>({...size$1(e),options:[e,t]}),inline$2=(e,t)=>({...inline$3(e),options:[e,t]}),arrow=(e,t)=>({...arrow$1(e),options:[e,t]}),SafeReact={...React$1},useInsertionEffect=SafeReact.useInsertionEffect,useSafeInsertionEffect=useInsertionEffect||(e=>e());function useEffectEvent(e){const t=reactExports.useRef(()=>{});return useSafeInsertionEffect(()=>{t.current=e}),reactExports.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}var index$2="undefined"!=typeof document?reactExports.useLayoutEffect:reactExports.useEffect;let serverHandoffComplete=!1,count=0;const genId=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+count++;function useFloatingId(){const[e,t]=reactExports.useState(()=>serverHandoffComplete?genId():void 0);return index$2(()=>{null==e&&t(genId())},[]),reactExports.useEffect(()=>{serverHandoffComplete=!0},[]),e}const useReactId=SafeReact.useId,useId=useReactId||useFloatingId;function createPubSub(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter(e=>e!==n))||[])}}}const FloatingNodeContext=reactExports.createContext(null),FloatingTreeContext=reactExports.createContext(null),useFloatingParentNodeId=()=>{var e;return(null==(e=reactExports.useContext(FloatingNodeContext))?void 0:e.id)||null},useFloatingTree=()=>reactExports.useContext(FloatingTreeContext);function useFloatingRootContext(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=useId(),i=reactExports.useRef({}),[a]=reactExports.useState(()=>createPubSub()),s=null!=useFloatingParentNodeId(),[l,c]=reactExports.useState(r.reference),u=useEffectEvent((e,t,r)=>{i.current.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:r,nested:s}),null==n||n(e,t,r)}),d=reactExports.useMemo(()=>({setPositionReference:c}),[]),p=reactExports.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return reactExports.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:p,events:a,floatingId:o,refs:d}),[t,u,p,a,o,d])}function useFloating(e){void 0===e&&(e={});const{nodeId:t}=e,n=useFloatingRootContext({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,a]=reactExports.useState(null),[s,l]=reactExports.useState(null),c=(null==o?void 0:o.domReference)||i,u=reactExports.useRef(null),d=useFloatingTree();index$2(()=>{c&&(u.current=c)},[c]);const p=useFloating$1({...e,elements:{...o,...s&&{reference:s}}}),h=reactExports.useCallback(e=>{const t=isElement$1(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),p.refs.setReference(t)},[p.refs]),f=reactExports.useCallback(e=>{(isElement$1(e)||null===e)&&(u.current=e,a(e)),(isElement$1(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!isElement$1(e))&&p.refs.setReference(e)},[p.refs]),A=reactExports.useMemo(()=>({...p.refs,setReference:f,setPositionReference:h,domReference:u}),[p.refs,f,h]),m=reactExports.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),g=reactExports.useMemo(()=>({...p,...r,refs:A,elements:m,nodeId:t}),[p,A,m,t,r]);return index$2(()=>{r.dataRef.current.floatingContext=g;const e=null==d?void 0:d.nodesRef.current.find(e=>e.id===t);e&&(e.context=g)}),reactExports.useMemo(()=>({...p,context:g,refs:A,elements:m}),[p,A,m,g])}function getFloatingPosition(e,t){if("rtl"===e&&(t.includes("right")||t.includes("left"))){const[e,n]=t.split("-"),r="right"===e?"left":"right";return void 0===n?r:`${r}-${n}`}return t}function horizontalSide(e,t,n,r){return"center"===e||"center"===r?{top:t}:"end"===e?{bottom:n}:"start"===e?{top:n}:{}}function verticalSide(e,t,n,r,o){return"center"===e||"center"===r?{left:t}:"end"===e?{["ltr"===o?"right":"left"]:n}:"start"===e?{["ltr"===o?"left":"right"]:n}:{}}const radiusByFloatingSide={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function getArrowPositionStyles({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:a,dir:s}){const[l,c="center"]=e.split("-"),u={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[radiusByFloatingSide[l]]:r},d=-t/2;return"left"===l?{...u,...horizontalSide(c,a,n,o),right:d,borderLeftColor:"transparent",borderBottomColor:"transparent"}:"right"===l?{...u,...horizontalSide(c,a,n,o),left:d,borderRightColor:"transparent",borderTopColor:"transparent"}:"top"===l?{...u,...verticalSide(c,i,n,o,s),bottom:d,borderTopColor:"transparent",borderLeftColor:"transparent"}:"bottom"===l?{...u,...verticalSide(c,i,n,o,s),top:d,borderBottomColor:"transparent",borderRightColor:"transparent"}:{}}const FloatingArrow=reactExports.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:i,arrowX:a,arrowY:s,style:l,...c},u)=>{const{dir:d}=useDirection();return i?factory$1("div",{...c,ref:u,style:{...l,...getArrowPositionStyles({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:d,arrowX:a,arrowY:s})}}):null});FloatingArrow.displayName="@mantine/core/FloatingArrow";const[PopoverContextProvider,usePopoverContext]=createSafeContext("Popover component was not found in the tree");function FocusTrap({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const o=useMergedRef(useFocusTrap(t),r);return isElement$2(e)?reactExports.cloneElement(e,{[n]:o}):e}function FocusTrapInitialFocus(e){return factory$1(VisuallyHidden,{tabIndex:-1,"data-autofocus":!0,...e})}function createPortalNode(e){const t=document.createElement("div");return t.setAttribute("data-portal","true"),"string"==typeof e.className&&t.classList.add(...e.className.split(" ").filter(Boolean)),"object"==typeof e.style&&Object.assign(t.style,e.style),"string"==typeof e.id&&t.setAttribute("id",e.id),t}FocusTrap.displayName="@mantine/core/FocusTrap",FocusTrapInitialFocus.displayName="@mantine/core/FocusTrapInitialFocus",FocusTrap.InitialFocus=FocusTrapInitialFocus;const defaultProps$X={},Portal=reactExports.forwardRef((e,t)=>{const{children:n,target:r,...o}=useProps("Portal",defaultProps$X,e),[i,a]=reactExports.useState(!1),s=reactExports.useRef(null);return useIsomorphicEffect(()=>(a(!0),s.current=r?"string"==typeof r?document.querySelector(r):r:createPortalNode(o),assignRef(t,s.current),!r&&s.current&&document.body.appendChild(s.current),()=>{!r&&s.current&&document.body.removeChild(s.current)}),[r]),i&&s.current?reactDomExports.createPortal(factory$1(Fragment,{children:n}),s.current):null});function OptionalPortal({withinPortal:e=!0,children:t,...n}){return e?factory$1(Portal,{...n,children:t}):factory$1(Fragment,{children:t})}Portal.displayName="@mantine/core/Portal",OptionalPortal.displayName="@mantine/core/OptionalPortal";const popIn=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${rem("bottom"===e?10:-10)})`},transitionProperty:"transform, opacity"}),transitions={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${rem(30)}`},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${rem(-30)}`},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${rem(30)}`},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${rem(-30)}`},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${rem(-20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${rem(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${rem(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${rem(20)}) rotate(5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...popIn("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...popIn("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...popIn("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...popIn("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...popIn("top"),common:{transformOrigin:"top right"}}},transitionStatuses={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function getTransitionStyles({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return"string"==typeof e?e in transitions?{transitionProperty:transitions[e].transitionProperty,...o,...transitions[e].common,...transitions[e][transitionStatuses[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[transitionStatuses[t]]}}function useTransition({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:i,onEntered:a,onExited:s,enterDelay:l,exitDelay:c}){const u=useMantineTheme(),d=useReducedMotion(),p=!!u.respectReducedMotion&&d,[h,f]=reactExports.useState(p?0:e),[A,m]=reactExports.useState(r?"entered":"exited"),g=reactExports.useRef(-1),y=reactExports.useRef(-1),v=reactExports.useRef(-1),b=n=>{const r=n?o:i,l=n?a:s;window.clearTimeout(g.current);const c=p?0:n?e:t;f(c),0===c?("function"==typeof r&&r(),"function"==typeof l&&l(),m(n?"entered":"exited")):v.current=requestAnimationFrame(()=>{ReactDOM.flushSync(()=>{m(n?"pre-entering":"pre-exiting")}),v.current=requestAnimationFrame(()=>{"function"==typeof r&&r(),m(n?"entering":"exiting"),g.current=window.setTimeout(()=>{"function"==typeof l&&l(),m(n?"entered":"exited")},c)})})};return useDidUpdate(()=>{var e;e=r,window.clearTimeout(y.current),"number"==typeof(e?l:c)?y.current=window.setTimeout(()=>{b(e)},e?l:c):b(e)},[r]),reactExports.useEffect(()=>()=>{window.clearTimeout(g.current),cancelAnimationFrame(v.current)},[]),{transitionDuration:h,transitionStatus:A,transitionTimingFunction:n||"ease"}}function Transition({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:i,timingFunction:a="ease",onExit:s,onEntered:l,onEnter:c,onExited:u,enterDelay:d,exitDelay:p}){const{transitionDuration:h,transitionStatus:f,transitionTimingFunction:A}=useTransition({mounted:o,exitDuration:r,duration:n,timingFunction:a,onExit:s,onEntered:l,onEnter:c,onExited:u,enterDelay:d,exitDelay:p});return 0===h?o?factory$1(Fragment,{children:i({})}):e?i({display:"none"}):null:"exited"===f?e?i({display:"none"}):null:factory$1(Fragment,{children:i(getTransitionStyles({transition:t,duration:h,state:f,timingFunction:A}))})}Transition.displayName="@mantine/core/Transition";var classes$m={dropdown:"m_38a85659",arrow:"m_a31dc6c1"};const defaultProps$W={},PopoverDropdown=factory((e,t)=>{var n,r,o,i;const a=useProps("PopoverDropdown",defaultProps$W,e),{className:s,style:l,vars:c,children:u,onKeyDownCapture:d,variant:p,classNames:h,styles:f,...A}=a,m=usePopoverContext(),g=useFocusReturn({opened:m.opened,shouldReturnFocus:m.returnFocus}),y=m.withRoles?{"aria-labelledby":m.getTargetId(),id:m.getDropdownId(),role:"dialog",tabIndex:-1}:{},v=useMergedRef(t,m.floating);return m.disabled?null:factory$1(OptionalPortal,{...m.portalProps,withinPortal:m.withinPortal,children:factory$1(Transition,{mounted:m.opened,...m.transitionProps,transition:(null==(n=m.transitionProps)?void 0:n.transition)||"fade",duration:(null==(r=m.transitionProps)?void 0:r.duration)??150,keepMounted:m.keepMounted,exitDuration:"number"==typeof(null==(o=m.transitionProps)?void 0:o.exitDuration)?m.transitionProps.exitDuration:null==(i=m.transitionProps)?void 0:i.duration,children:e=>factory$1(FocusTrap,{active:m.trapFocus&&m.opened,innerRef:v,children:factory$1(Box,{...y,...A,variant:p,onKeyDownCapture:closeOnEscape(m.onClose,{active:m.closeOnEscape,onTrigger:g,onKeyDown:d}),"data-position":m.placement,"data-fixed":"fixed"===m.floatingStrategy||void 0,...m.getStyles("dropdown",{className:s,props:a,classNames:h,styles:f,style:[{...e,zIndex:m.zIndex,top:m.y??0,left:m.x??0,width:"target"===m.width?void 0:rem(m.width)},l]}),children:[u,factory$1(FloatingArrow,{ref:m.arrowRef,arrowX:m.arrowX,arrowY:m.arrowY,visible:m.withArrow,position:m.placement,arrowSize:m.arrowSize,arrowRadius:m.arrowRadius,arrowOffset:m.arrowOffset,arrowPosition:m.arrowPosition,...m.getStyles("arrow",{props:a,classNames:h,styles:f})})]})})})})});PopoverDropdown.classes=classes$m,PopoverDropdown.displayName="@mantine/core/PopoverDropdown";const defaultProps$V={refProp:"ref",popupType:"dialog"},PopoverTarget=factory((e,t)=>{const{children:n,refProp:r,popupType:o,...i}=useProps("PopoverTarget",defaultProps$V,e);if(!isElement$2(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const a=i,s=usePopoverContext(),l=useMergedRef(s.reference,n.ref,t),c=s.withRoles?{"aria-haspopup":o,"aria-expanded":s.opened,"aria-controls":s.getDropdownId(),id:s.getTargetId()}:{};return reactExports.cloneElement(n,{...a,...c,...s.targetProps,className:clsx$2(s.targetProps.className,a.className,n.props.className),[r]:l,...s.controlled?null:{onClick:s.onToggle}})});function useFloatingAutoUpdate({opened:e,floating:t,position:n,positionDependencies:r}){const[o,i]=reactExports.useState(0);reactExports.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return autoUpdate(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),useDidUpdate(()=>{t.update()},r),useDidUpdate(()=>{i(e=>e+1)},[e])}function getDefaultMiddlewares(e){if(void 0===e)return{shift:!0,flip:!0};const t={...e};return void 0===e.shift&&(t.shift=!0),void 0===e.flip&&(t.flip=!0),t}function getPopoverMiddlewares(e,t){const n=getDefaultMiddlewares(e.middlewares),r=[offset(e.offset)];return n.shift&&r.push(shift("boolean"==typeof n.shift?{limiter:limitShift(),padding:5}:{limiter:limitShift(),padding:5,...n.shift})),n.flip&&r.push("boolean"==typeof n.flip?flip():flip(n.flip)),n.inline&&r.push("boolean"==typeof n.inline?inline$2():inline$2(n.inline)),r.push(arrow({element:e.arrowRef,padding:e.arrowOffset})),(n.size||"target"===e.width)&&r.push(size({..."boolean"==typeof n.size?{}:n.size,apply({rects:r,availableWidth:o,availableHeight:i,...a}){var s;const l=(null==(s=t().refs.floating.current)?void 0:s.style)??{};n.size&&("object"==typeof n.size&&n.size.apply?n.size.apply({rects:r,availableWidth:o,availableHeight:i,...a}):Object.assign(l,{maxWidth:`${o}px`,maxHeight:`${i}px`})),"target"===e.width&&Object.assign(l,{width:`${r.reference.width}px`})}})),r}function usePopover(e){const[t,n]=useUncontrolled({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=useFloating({strategy:e.strategy,placement:e.position,middleware:getPopoverMiddlewares(e,()=>r)});return useFloatingAutoUpdate({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies||[],floating:r}),useDidUpdate(()=>{var t;null==(t=e.onPositionChange)||t.call(e,r.placement)},[r.placement]),useDidUpdate(()=>{var t,n;e.opened?null==(n=e.onOpen)||n.call(e):null==(t=e.onClose)||t.call(e)},[e.opened]),{floating:r,controlled:"boolean"==typeof e.opened,opened:t,onClose:()=>{var r;t&&(null==(r=e.onClose)||r.call(e),n(!1))},onToggle:()=>{var r,o;t?(null==(r=e.onClose)||r.call(e),n(!1)):(null==(o=e.onOpen)||o.call(e),n(!0))}}}PopoverTarget.displayName="@mantine/core/PopoverTarget";const defaultProps$U={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:getDefaultZIndex("popover"),__staticSelector:"Popover",width:"max-content"},varsResolver$m=createVarsResolver((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":void 0===t?void 0:getRadius(t),"--popover-shadow":getShadow(n)}}));function Popover(e){var t,n,r,o,i,a;const s=useProps("Popover",defaultProps$U,e),{children:l,position:c,offset:u,onPositionChange:d,positionDependencies:p,opened:h,transitionProps:f,width:A,middlewares:m,withArrow:g,arrowSize:y,arrowOffset:v,arrowRadius:b,arrowPosition:x,unstyled:w,classNames:C,styles:$,closeOnClickOutside:_,withinPortal:S,portalProps:E,closeOnEscape:k,clickOutsideEvents:B,trapFocus:P,onClose:T,onOpen:I,onChange:L,zIndex:M,radius:D,shadow:N,id:F,defaultOpened:O,__staticSelector:R,withRoles:U,disabled:j,returnFocus:H,variant:Q,keepMounted:z,vars:V,floatingStrategy:W,...Y}=s,G=useStyles$u({name:R,props:s,classes:classes$m,classNames:C,styles:$,unstyled:w,rootSelector:"dropdown",vars:V,varsResolver:varsResolver$m}),K=reactExports.useRef(null),[q,J]=reactExports.useState(null),[Z,X]=reactExports.useState(null),{dir:ee}=useDirection(),te=useId$1(F),ne=usePopover({middlewares:m,width:A,position:getFloatingPosition(ee,c),offset:"number"==typeof u?u+(g?y/2:0):u,arrowRef:K,arrowOffset:v,onPositionChange:d,positionDependencies:p,opened:h,defaultOpened:O,onChange:L,onOpen:I,onClose:T,strategy:W});useClickOutside(()=>_&&ne.onClose(),B,[q,Z]);const re=reactExports.useCallback(e=>{J(e),ne.floating.refs.setReference(e)},[ne.floating.refs.setReference]),oe=reactExports.useCallback(e=>{X(e),ne.floating.refs.setFloating(e)},[ne.floating.refs.setFloating]);return factory$1(PopoverContextProvider,{value:{returnFocus:H,disabled:j,controlled:ne.controlled,reference:re,floating:oe,x:ne.floating.x,y:ne.floating.y,arrowX:null==(r=null==(n=null==(t=ne.floating)?void 0:t.middlewareData)?void 0:n.arrow)?void 0:r.x,arrowY:null==(a=null==(i=null==(o=ne.floating)?void 0:o.middlewareData)?void 0:i.arrow)?void 0:a.y,opened:ne.opened,arrowRef:K,transitionProps:f,width:A,withArrow:g,arrowSize:y,arrowOffset:v,arrowRadius:b,arrowPosition:x,placement:ne.floating.placement,trapFocus:P,withinPortal:S,portalProps:E,zIndex:M,radius:D,shadow:N,closeOnEscape:k,onClose:ne.onClose,onToggle:ne.onToggle,getTargetId:()=>`${te}-target`,getDropdownId:()=>`${te}-dropdown`,withRoles:U,targetProps:Y,__staticSelector:R,classNames:C,styles:$,unstyled:w,variant:Q,keepMounted:z,getStyles:G,floatingStrategy:W},children:l})}Popover.Target=PopoverTarget,Popover.Dropdown=PopoverDropdown,Popover.displayName="@mantine/core/Popover",Popover.extend=e=>e;const CloseIcon=reactExports.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>factory$1("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:r,...n,children:factory$1("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));CloseIcon.displayName="@mantine/core/CloseIcon";var classes$l={root:"m_86a44da5","root--subtle":"m_220c80f2"};const defaultProps$T={variant:"subtle"},varsResolver$l=createVarsResolver((e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":getSize(t,"cb-size"),"--cb-radius":void 0===n?void 0:getRadius(n),"--cb-icon-size":rem(r)}})),CloseButton=polymorphicFactory((e,t)=>{const n=useProps("CloseButton",defaultProps$T,e),{iconSize:r,children:o,vars:i,radius:a,className:s,classNames:l,style:c,styles:u,unstyled:d,"data-disabled":p,disabled:h,variant:f,icon:A,mod:m,...g}=n,y=useStyles$u({name:"CloseButton",props:n,className:s,style:c,classes:classes$l,classNames:l,styles:u,unstyled:d,vars:i,varsResolver:varsResolver$l});return factory$1(UnstyledButton,{ref:t,...g,unstyled:d,variant:f,disabled:h,mod:[{disabled:h||p},m],...y("root",{variant:f,active:!h&&!p}),children:[A||factory$1(CloseIcon,{}),o]})});CloseButton.classes=classes$l,CloseButton.displayName="@mantine/core/CloseButton";const[InputWrapperProvider,useInputWrapperContext]=createOptionalContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var classes$k={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const defaultProps$S={},varsResolver$k=createVarsResolver((e,{size:t})=>({description:{"--input-description-size":void 0===t?void 0:`calc(${getFontSize(t)} - ${rem(2)})`}})),InputDescription=factory((e,t)=>{const n=useProps("InputDescription",defaultProps$S,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,size:c,__staticSelector:u,__inheritStyles:d=!0,variant:p,...h}=useProps("InputDescription",defaultProps$S,n),f=useInputWrapperContext(),A=useStyles$u({name:["InputWrapper",u],props:n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"description",vars:l,varsResolver:varsResolver$k}),m=d&&(null==f?void 0:f.getStyles)||A;return factory$1(Box,{component:"p",ref:t,variant:p,size:c,...m("description",(null==f?void 0:f.getStyles)?{className:o,style:i}:void 0),...h})});InputDescription.classes=classes$k,InputDescription.displayName="@mantine/core/InputDescription";const defaultProps$R={},varsResolver$j=createVarsResolver((e,{size:t})=>({error:{"--input-error-size":void 0===t?void 0:`calc(${getFontSize(t)} - ${rem(2)})`}})),InputError=factory((e,t)=>{const n=useProps("InputError",defaultProps$R,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,size:c,__staticSelector:u,__inheritStyles:d=!0,variant:p,...h}=n,f=useStyles$u({name:["InputWrapper",u],props:n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"error",vars:l,varsResolver:varsResolver$j}),A=useInputWrapperContext(),m=d&&(null==A?void 0:A.getStyles)||f;return factory$1(Box,{component:"p",ref:t,variant:p,size:c,...m("error",(null==A?void 0:A.getStyles)?{className:o,style:i}:void 0),...h})});InputError.classes=classes$k,InputError.displayName="@mantine/core/InputError";const defaultProps$Q={labelElement:"label"},varsResolver$i=createVarsResolver((e,{size:t})=>({label:{"--input-label-size":getFontSize(t),"--input-asterisk-color":void 0}})),InputLabel=factory((e,t)=>{const n=useProps("InputLabel",defaultProps$Q,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,labelElement:c,size:u,required:d,htmlFor:p,onMouseDown:h,children:f,__staticSelector:A,variant:m,mod:g,...y}=useProps("InputLabel",defaultProps$Q,n),v=useStyles$u({name:["InputWrapper",A],props:n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"label",vars:l,varsResolver:varsResolver$i}),b=useInputWrapperContext(),x=(null==b?void 0:b.getStyles)||v;return factory$1(Box,{...x("label",(null==b?void 0:b.getStyles)?{className:o,style:i}:void 0),component:c,variant:m,size:u,ref:t,htmlFor:"label"===c?p:void 0,mod:[{required:d},g],onMouseDown:e=>{null==h||h(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()},...y,children:[f,d&&factory$1("span",{...x("required"),"aria-hidden":!0,children:" *"})]})});InputLabel.classes=classes$k,InputLabel.displayName="@mantine/core/InputLabel";const defaultProps$P={},InputPlaceholder=factory((e,t)=>{const n=useProps("InputPlaceholder",defaultProps$P,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,__staticSelector:c,variant:u,error:d,mod:p,...h}=useProps("InputPlaceholder",defaultProps$P,n),f=useStyles$u({name:["InputPlaceholder",c],props:n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"placeholder"});return factory$1(Box,{...f("placeholder"),mod:[{error:!!d},p],component:"span",variant:u,ref:t,...h})});function getInputOffsets(e,{hasDescription:t,hasError:n}){const r=e.findIndex(e=>"input"===e),o=e.slice(0,r),i=e.slice(r+1),a=t&&o.includes("description")||n&&o.includes("error");return{offsetBottom:t&&i.includes("description")||n&&i.includes("error"),offsetTop:a}}InputPlaceholder.classes=classes$k,InputPlaceholder.displayName="@mantine/core/InputPlaceholder";const defaultProps$O={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},varsResolver$h=createVarsResolver((e,{size:t})=>({label:{"--input-label-size":getFontSize(t),"--input-asterisk-color":void 0},error:{"--input-error-size":void 0===t?void 0:`calc(${getFontSize(t)} - ${rem(2)})`},description:{"--input-description-size":void 0===t?void 0:`calc(${getFontSize(t)} - ${rem(2)})`}})),InputWrapper=factory((e,t)=>{const n=useProps("InputWrapper",defaultProps$O,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,size:c,variant:u,__staticSelector:d,inputContainer:p,inputWrapperOrder:h,label:f,error:A,description:m,labelProps:g,descriptionProps:y,errorProps:v,labelElement:b,children:x,withAsterisk:w,id:C,required:$,__stylesApiProps:_,mod:S,...E}=n,k=useStyles$u({name:["InputWrapper",d],props:_||n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$h}),B={size:c,variant:u,__staticSelector:d},P=useId$1(C),T="boolean"==typeof w?w:$,I=(null==v?void 0:v.id)||`${P}-error`,L=(null==y?void 0:y.id)||`${P}-description`,M=P,D=!!A&&"boolean"!=typeof A,N=!!m,F=`${D?I:""} ${N?L:""}`,O=F.trim().length>0?F.trim():void 0,R=(null==g?void 0:g.id)||`${P}-label`,U=f&&factory$1(InputLabel,{labelElement:b,id:R,htmlFor:M,required:T,...B,...g,children:f}),j=N&&factory$1(InputDescription,{...y,...B,size:(null==y?void 0:y.size)||B.size,id:(null==y?void 0:y.id)||L,children:m}),H=factory$1(reactExports.Fragment,{children:p(x)}),Q=D&&reactExports.createElement(InputError,{...v,...B,size:(null==v?void 0:v.size)||B.size,key:"error",id:(null==v?void 0:v.id)||I},A),z=h.map(e=>{switch(e){case"label":return U;case"input":return H;case"description":return j;case"error":return Q;default:return null}});return factory$1(InputWrapperProvider,{value:{getStyles:k,describedBy:O,inputId:M,labelId:R,...getInputOffsets(h,{hasDescription:N,hasError:D})},children:factory$1(Box,{ref:t,variant:u,size:c,mod:[{error:!!A},S],...k("root"),...E,children:z})})});InputWrapper.classes=classes$k,InputWrapper.displayName="@mantine/core/InputWrapper";const defaultProps$N={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},varsResolver$g=createVarsResolver((e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":getSize(t.size,"input-height"),"--input-fz":getFontSize(t.size),"--input-radius":void 0===t.radius?void 0:getRadius(t.radius),"--input-left-section-width":void 0!==t.leftSectionWidth?rem(t.leftSectionWidth):void 0,"--input-right-section-width":void 0!==t.rightSectionWidth?rem(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?getSize(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}})),Input$5=polymorphicFactory((e,t)=>{const n=useProps("Input",defaultProps$N,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,required:l,__staticSelector:c,__stylesApiProps:u,size:d,wrapperProps:p,error:h,disabled:f,leftSection:A,leftSectionProps:m,leftSectionWidth:g,rightSection:y,rightSectionProps:v,rightSectionWidth:b,rightSectionPointerEvents:x,leftSectionPointerEvents:w,variant:C,vars:$,pointer:_,multiline:S,radius:E,id:k,withAria:B,withErrorStyles:P,mod:T,inputSize:I,...L}=n,{styleProps:M,rest:D}=extractStyleProps(L),N=useInputWrapperContext(),F={offsetBottom:null==N?void 0:N.offsetBottom,offsetTop:null==N?void 0:N.offsetTop},O=useStyles$u({name:["Input",c],props:u||n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,stylesCtx:F,rootSelector:"wrapper",vars:$,varsResolver:varsResolver$g}),R=B?{required:l,disabled:f,"aria-invalid":!!h,"aria-describedby":null==N?void 0:N.describedBy,id:(null==N?void 0:N.inputId)||k}:{};return factory$1(Box,{...O("wrapper"),...M,...p,mod:[{error:!!h&&P,pointer:_,disabled:f,multiline:S,"data-with-right-section":!!y,"data-with-left-section":!!A},T],variant:C,size:d,children:[A&&factory$1("div",{...m,"data-position":"left",...O("section",{className:null==m?void 0:m.className,style:null==m?void 0:m.style}),children:A}),factory$1(Box,{component:"input",...D,...R,ref:t,required:l,mod:{disabled:f,error:!!h&&P},variant:C,__size:I,...O("input")}),y&&factory$1("div",{...v,"data-position":"right",...O("section",{className:null==v?void 0:v.className,style:null==v?void 0:v.style}),children:y})]})});function useInputProps(e,t,n){const r=useProps(e,t,n),{label:o,description:i,error:a,required:s,classNames:l,styles:c,className:u,unstyled:d,__staticSelector:p,__stylesApiProps:h,errorProps:f,labelProps:A,descriptionProps:m,wrapperProps:g,id:y,size:v,style:b,inputContainer:x,inputWrapperOrder:w,withAsterisk:C,variant:$,vars:_,mod:S,...E}=r,{styleProps:k,rest:B}=extractStyleProps(E);return{...B,classNames:l,styles:c,unstyled:d,wrapperProps:{...{label:o,description:i,error:a,required:s,classNames:l,className:u,__staticSelector:p,__stylesApiProps:h||r,errorProps:f,labelProps:A,descriptionProps:m,unstyled:d,styles:c,size:v,style:b,inputContainer:x,inputWrapperOrder:w,withAsterisk:C,variant:$,id:y,mod:S,...g},...k},inputProps:{required:s,classNames:l,styles:c,unstyled:d,size:v,__staticSelector:p,__stylesApiProps:h||r,error:a,variant:$,id:y}}}Input$5.classes=classes$k,Input$5.Wrapper=InputWrapper,Input$5.Label=InputLabel,Input$5.Error=InputError,Input$5.Description=InputDescription,Input$5.Placeholder=InputPlaceholder,Input$5.displayName="@mantine/core/Input";const defaultProps$M={__staticSelector:"InputBase",withAria:!0},InputBase=polymorphicFactory((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=useInputProps("InputBase",defaultProps$M,e);return factory$1(Input$5.Wrapper,{...r,children:factory$1(Input$5,{...n,...o,ref:t})})});function AccordionChevron({style:e,size:t=16,...n}){return factory$1("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:rem(t),height:rem(t),display:"block"},...n,children:factory$1("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function parseItem(e){return"string"==typeof e?{value:e,label:e}:"value"in e&&!("label"in e)?{value:e.value,label:e.value,disabled:e.disabled}:"number"==typeof e?{value:e.toString(),label:e.toString()}:"group"in e?{group:e.group,items:e.items.map(e=>parseItem(e))}:e}function getParsedComboboxData(e){return e?e.map(e=>parseItem(e)):[]}function getOptionsLockup(e){return e.reduce((e,t)=>"group"in t?{...e,...getOptionsLockup(t.items)}:(e[t.value]=t,e),{})}InputBase.classes={...Input$5.classes,...Input$5.Wrapper.classes},InputBase.displayName="@mantine/core/InputBase",AccordionChevron.displayName="@mantine/core/AccordionChevron";var classes$j={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2"};const defaultProps$L={error:null},varsResolver$f=createVarsResolver((e,{size:t})=>({chevron:{"--combobox-chevron-size":getSize(t,"combobox-chevron-size")}})),ComboboxChevron=factory((e,t)=>{const n=useProps("ComboboxChevron",defaultProps$L,e),{size:r,error:o,style:i,className:a,classNames:s,styles:l,unstyled:c,vars:u,mod:d,...p}=n,h=useStyles$u({name:"ComboboxChevron",classes:classes$j,props:n,style:i,className:a,classNames:s,styles:l,unstyled:c,vars:u,varsResolver:varsResolver$f,rootSelector:"chevron"});return factory$1(Box,{component:"svg",...p,...h("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:o},d],ref:t,children:factory$1("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});ComboboxChevron.classes=classes$j,ComboboxChevron.displayName="@mantine/core/ComboboxChevron";const[ComboboxProvider,useComboboxContext]=createSafeContext("Combobox component was not found in tree"),ComboboxClearButton=reactExports.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},i)=>factory$1(CloseButton,{ref:i,size:e||"sm",variant:"transparent",tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:e=>{e.preventDefault(),null==t||t(e)},onClick:e=>{r(),null==n||n(e)}}));ComboboxClearButton.displayName="@mantine/core/ComboboxClearButton";const defaultProps$K={},ComboboxDropdown=factory((e,t)=>{const{classNames:n,styles:r,className:o,style:i,hidden:a,...s}=useProps("ComboboxDropdown",defaultProps$K,e),l=useComboboxContext();return factory$1(Popover.Dropdown,{...s,ref:t,role:"presentation","data-hidden":a||void 0,...l.getStyles("dropdown",{className:o,style:i,classNames:n,styles:r})})});ComboboxDropdown.classes=classes$j,ComboboxDropdown.displayName="@mantine/core/ComboboxDropdown";const defaultProps$J={refProp:"ref"},ComboboxDropdownTarget=factory((e,t)=>{const{children:n,refProp:r}=useProps("ComboboxDropdownTarget",defaultProps$J,e);if(useComboboxContext(),!isElement$2(n))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return factory$1(Popover.Target,{ref:t,refProp:r,children:n})});ComboboxDropdownTarget.displayName="@mantine/core/ComboboxDropdownTarget";const defaultProps$I={},ComboboxEmpty=factory((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...s}=useProps("ComboboxEmpty",defaultProps$I,e),l=useComboboxContext();return factory$1(Box,{ref:t,...l.getStyles("empty",{className:r,classNames:n,styles:i,style:o}),...s})});function useComboboxTargetProps({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:i}){const a=useComboboxContext(),[s,l]=reactExports.useState(null);return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!(!a.store.listId||!a.store.dropdownOpened)||void 0,"aria-controls":a.store.listId,"aria-activedescendant":a.store.dropdownOpened&&s||void 0,autoComplete:i,"data-expanded":a.store.dropdownOpened||void 0,"data-mantine-stop-propagation":a.store.dropdownOpened||void 0}:{},onKeyDown:n=>{if(null==e||e(n),!a.readOnly&&t){if(n.nativeEvent.isComposing)return;if("ArrowDown"===n.nativeEvent.code&&(n.preventDefault(),a.store.dropdownOpened?l(a.store.selectNextOption()):(a.store.openDropdown("keyboard"),l(a.store.selectActiveOption()))),"ArrowUp"===n.nativeEvent.code&&(n.preventDefault(),a.store.dropdownOpened?l(a.store.selectPreviousOption()):(a.store.openDropdown("keyboard"),l(a.store.selectActiveOption()))),"Enter"===n.nativeEvent.code||"NumpadEnter"===n.nativeEvent.code){if(229===n.nativeEvent.keyCode)return;const e=a.store.getSelectedOptionIndex();a.store.dropdownOpened&&-1!==e?(n.preventDefault(),a.store.clickSelectedOption()):"button"===o&&(n.preventDefault(),a.store.openDropdown("keyboard"))}"Escape"===n.nativeEvent.code&&a.store.closeDropdown("keyboard"),"Space"===n.nativeEvent.code&&"button"===o&&(n.preventDefault(),a.store.toggleDropdown("keyboard"))}}}}ComboboxEmpty.classes=classes$j,ComboboxEmpty.displayName="@mantine/core/ComboboxEmpty";const defaultProps$H={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},ComboboxEventsTarget=factory((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:a,targetType:s,autoComplete:l,...c}=useProps("ComboboxEventsTarget",defaultProps$H,e);if(!isElement$2(n))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=useComboboxContext(),d=useComboboxTargetProps({targetType:s,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:n.props.onKeyDown,autoComplete:l});return reactExports.cloneElement(n,{...d,...c,[r]:useMergedRef(t,u.store.targetRef,null==n?void 0:n.ref)})});ComboboxEventsTarget.displayName="@mantine/core/ComboboxEventsTarget";const defaultProps$G={},ComboboxFooter=factory((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...s}=useProps("ComboboxFooter",defaultProps$G,e),l=useComboboxContext();return factory$1(Box,{ref:t,...l.getStyles("footer",{className:r,classNames:n,style:o,styles:i}),...s,onMouseDown:e=>{e.preventDefault()}})});ComboboxFooter.classes=classes$j,ComboboxFooter.displayName="@mantine/core/ComboboxFooter";const defaultProps$F={},ComboboxGroup=factory((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,children:s,label:l,...c}=useProps("ComboboxGroup",defaultProps$F,e),u=useComboboxContext();return factory$1(Box,{ref:t,...u.getStyles("group",{className:r,classNames:n,style:o,styles:i}),...c,children:[l&&factory$1("div",{...u.getStyles("groupLabel",{classNames:n,styles:i}),children:l}),s]})});ComboboxGroup.classes=classes$j,ComboboxGroup.displayName="@mantine/core/ComboboxGroup";const defaultProps$E={},ComboboxHeader=factory((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...s}=useProps("ComboboxHeader",defaultProps$E,e),l=useComboboxContext();return factory$1(Box,{ref:t,...l.getStyles("header",{className:r,classNames:n,style:o,styles:i}),...s,onMouseDown:e=>{e.preventDefault()}})});function ComboboxHiddenInput({value:e,valuesDivider:t=",",...n}){return factory$1("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}ComboboxHeader.classes=classes$j,ComboboxHeader.displayName="@mantine/core/ComboboxHeader",ComboboxHiddenInput.displayName="@mantine/core/ComboboxHiddenInput";const defaultProps$D={},ComboboxOption=factory((e,t)=>{const n=useProps("ComboboxOption",defaultProps$D,e),{classNames:r,className:o,style:i,styles:a,vars:s,onClick:l,id:c,active:u,onMouseDown:d,onMouseOver:p,disabled:h,selected:f,mod:A,...m}=n,g=useComboboxContext(),y=reactExports.useId(),v=c||y;return factory$1(Box,{...g.getStyles("option",{className:o,classNames:r,styles:a,style:i}),...m,ref:t,id:v,mod:["combobox-option",{"combobox-active":u,"combobox-disabled":h,"combobox-selected":f},A],role:"option",onClick:e=>{var t;h?e.preventDefault():(null==(t=g.onOptionSubmit)||t.call(g,n.value,n),null==l||l(e))},onMouseDown:e=>{e.preventDefault(),null==d||d(e)},onMouseOver:e=>{g.resetSelectionOnOptionHover&&g.store.resetSelectedOption(),null==p||p(e)}})});ComboboxOption.classes=classes$j,ComboboxOption.displayName="@mantine/core/ComboboxOption";const defaultProps$C={},ComboboxOptions=factory((e,t)=>{const n=useProps("ComboboxOptions",defaultProps$C,e),{classNames:r,className:o,style:i,styles:a,id:s,onMouseDown:l,labelledBy:c,...u}=n,d=useComboboxContext(),p=useId$1(s);return reactExports.useEffect(()=>{d.store.setListId(p)},[p]),factory$1(Box,{ref:t,...d.getStyles("options",{className:o,style:i,classNames:r,styles:a}),...u,id:p,role:"listbox","aria-labelledby":c,onMouseDown:e=>{e.preventDefault(),null==l||l(e)}})});ComboboxOptions.classes=classes$j,ComboboxOptions.displayName="@mantine/core/ComboboxOptions";const defaultProps$B={withAriaAttributes:!0,withKeyboardNavigation:!0},ComboboxSearch=factory((e,t)=>{const n=useProps("ComboboxSearch",defaultProps$B,e),{classNames:r,styles:o,unstyled:i,vars:a,withAriaAttributes:s,onKeyDown:l,withKeyboardNavigation:c,size:u,...d}=n,p=useComboboxContext(),h=p.getStyles("search"),f=useComboboxTargetProps({targetType:"input",withAriaAttributes:s,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:l,autoComplete:"off"});return factory$1(Input$5,{ref:useMergedRef(t,p.store.searchRef),classNames:[{input:h.className},r],styles:[{input:h.style},o],size:u||p.size,...f,...d,__staticSelector:"Combobox"})});ComboboxSearch.classes=classes$j,ComboboxSearch.displayName="@mantine/core/ComboboxSearch";const defaultProps$A={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},ComboboxTarget=factory((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:a,targetType:s,autoComplete:l,...c}=useProps("ComboboxTarget",defaultProps$A,e);if(!isElement$2(n))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=useComboboxContext(),d=useComboboxTargetProps({targetType:s,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:n.props.onKeyDown,autoComplete:l}),p=reactExports.cloneElement(n,{...d,...c});return factory$1(Popover.Target,{ref:useMergedRef(t,u.store.targetRef),children:p})});function getPreviousIndex(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;if(n)for(let r=t.length-1;r>-1;r-=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;return e}function getNextIndex$1(e,t,n){for(let r=e+1;r<t.length;r+=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;if(n)for(let r=0;r<t.length;r+=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;return e}function getFirstIndex(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function useCombobox({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:i=!0,scrollBehavior:a="instant"}={}){const[s,l]=useUncontrolled({value:t,defaultValue:e,finalValue:!1,onChange:n}),c=reactExports.useRef(null),u=reactExports.useRef(-1),d=reactExports.useRef(null),p=reactExports.useRef(null),h=reactExports.useRef(-1),f=reactExports.useRef(-1),A=reactExports.useRef(-1),m=reactExports.useCallback((e="unknown")=>{s||(l(!0),null==o||o(e))},[l,o,s]),g=reactExports.useCallback((e="unknown")=>{s&&(l(!1),null==r||r(e))},[l,r,s]),y=reactExports.useCallback((e="unknown")=>{s?g(e):m(e)},[g,m,s]),v=reactExports.useCallback(()=>{const e=document.querySelector(`#${c.current} [data-combobox-selected]`);null==e||e.removeAttribute("data-combobox-selected"),null==e||e.removeAttribute("aria-selected")},[]),b=reactExports.useCallback(e=>{const t=document.getElementById(c.current),n=null==t?void 0:t.querySelectorAll("[data-combobox-option]");if(!n)return null;const r=e>=n.length?0:e<0?n.length-1:e;return u.current=r,(null==n?void 0:n[r])&&!n[r].hasAttribute("data-combobox-disabled")?(v(),n[r].setAttribute("data-combobox-selected","true"),n[r].setAttribute("aria-selected","true"),n[r].scrollIntoView({block:"nearest",behavior:a}),n[r].id):null},[a,v]),x=reactExports.useCallback(()=>{const e=document.querySelector(`#${c.current} [data-combobox-active]`);if(e){const t=document.querySelectorAll(`#${c.current} [data-combobox-option]`),n=Array.from(t).findIndex(t=>t===e);return b(n)}return b(0)},[b]),w=reactExports.useCallback(()=>b(getNextIndex$1(u.current,document.querySelectorAll(`#${c.current} [data-combobox-option]`),i)),[b,i]),C=reactExports.useCallback(()=>b(getPreviousIndex(u.current,document.querySelectorAll(`#${c.current} [data-combobox-option]`),i)),[b,i]),$=reactExports.useCallback(()=>b(getFirstIndex(document.querySelectorAll(`#${c.current} [data-combobox-option]`))),[b]),_=reactExports.useCallback((e="selected",t)=>{A.current=window.setTimeout(()=>{var n;const r=document.querySelectorAll(`#${c.current} [data-combobox-option]`),o=Array.from(r).findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=o,(null==t?void 0:t.scrollIntoView)&&(null==(n=r[o])||n.scrollIntoView({block:"nearest",behavior:a}))},0)},[]),S=reactExports.useCallback(()=>{u.current=-1,v()},[v]),E=reactExports.useCallback(()=>{const e=document.querySelectorAll(`#${c.current} [data-combobox-option]`),t=null==e?void 0:e[u.current];null==t||t.click()},[]),k=reactExports.useCallback(e=>{c.current=e},[]),B=reactExports.useCallback(()=>{h.current=window.setTimeout(()=>d.current.focus(),0)},[]),P=reactExports.useCallback(()=>{f.current=window.setTimeout(()=>p.current.focus(),0)},[]),T=reactExports.useCallback(()=>u.current,[]);return reactExports.useEffect(()=>()=>{window.clearTimeout(h.current),window.clearTimeout(f.current),window.clearTimeout(A.current)},[]),{dropdownOpened:s,openDropdown:m,closeDropdown:g,toggleDropdown:y,selectedOptionIndex:u.current,getSelectedOptionIndex:T,selectOption:b,selectFirstOption:$,selectActiveOption:x,selectNextOption:w,selectPreviousOption:C,resetSelectedOption:S,updateSelectedOptionIndex:_,listId:c.current,setListId:k,clickSelectedOption:E,searchRef:d,focusSearchInput:B,targetRef:p,focusTarget:P}}ComboboxTarget.displayName="@mantine/core/ComboboxTarget";const defaultProps$z={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},varsResolver$e=createVarsResolver((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":getFontSize(t),"--combobox-option-padding":getSize(t,"combobox-option-padding")},dropdown:{"--combobox-padding":void 0===n?void 0:rem(n),"--combobox-option-fz":getFontSize(t),"--combobox-option-padding":getSize(t,"combobox-option-padding")}}));function Combobox(e){const t=useProps("Combobox",defaultProps$z,e),{classNames:n,styles:r,unstyled:o,children:i,store:a,vars:s,onOptionSubmit:l,onClose:c,size:u,dropdownPadding:d,resetSelectionOnOptionHover:p,__staticSelector:h,readOnly:f,...A}=t,m=useCombobox(),g=a||m,y=useStyles$u({name:h||"Combobox",classes:classes$j,props:t,classNames:n,styles:r,unstyled:o,vars:s,varsResolver:varsResolver$e});return factory$1(ComboboxProvider,{value:{getStyles:y,store:g,onOptionSubmit:l,size:u,resetSelectionOnOptionHover:p,readOnly:f},children:factory$1(Popover,{opened:g.dropdownOpened,...A,onClose:()=>{null==c||c(),g.closeDropdown()},withRoles:!1,unstyled:o,children:i})})}const extendCombobox=e=>e;Combobox.extend=extendCombobox,Combobox.classes=classes$j,Combobox.displayName="@mantine/core/Combobox",Combobox.Target=ComboboxTarget,Combobox.Dropdown=ComboboxDropdown,Combobox.Options=ComboboxOptions,Combobox.Option=ComboboxOption,Combobox.Search=ComboboxSearch,Combobox.Empty=ComboboxEmpty,Combobox.Chevron=ComboboxChevron,Combobox.Footer=ComboboxFooter,Combobox.Header=ComboboxHeader,Combobox.EventsTarget=ComboboxEventsTarget,Combobox.DropdownTarget=ComboboxDropdownTarget,Combobox.Group=ComboboxGroup,Combobox.ClearButton=ComboboxClearButton,Combobox.HiddenInput=ComboboxHiddenInput;var classes$i={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const InlineInputClasses=classes$i,InlineInput=reactExports.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:i,children:a,label:s,description:l,id:c,disabled:u,error:d,size:p,labelPosition:h="left",bodyElement:f="div",labelElement:A="label",variant:m,style:g,vars:y,mod:v,...b},x)=>{const w=useStyles$u({name:e,props:t,className:n,style:g,classes:classes$i,classNames:r,styles:o,unstyled:i});return factory$1(Box,{...w("root"),ref:x,__vars:{"--label-fz":getFontSize(p),"--label-lh":getSize(p,"label-lh")},mod:[{"label-position":h},v],variant:m,size:p,...b,children:factory$1(Box,{component:f,htmlFor:"label"===f?c:void 0,...w("body"),children:[a,factory$1("div",{...w("labelWrapper"),"data-disabled":u||void 0,children:[s&&factory$1(Box,{component:A,htmlFor:"label"===A?c:void 0,...w("label"),"data-disabled":u||void 0,children:s}),l&&factory$1(Input$5.Description,{size:p,__inheritStyles:!1,...w("description"),children:l}),d&&"boolean"!=typeof d&&factory$1(Input$5.Error,{size:p,__inheritStyles:!1,...w("error"),children:d})]})]})})});InlineInput.displayName="@mantine/core/InlineInput";const CheckboxGroupContext=reactExports.createContext(null),CheckboxGroupProvider=CheckboxGroupContext.Provider,useCheckboxGroupContext=()=>reactExports.useContext(CheckboxGroupContext),[CheckboxCardProvider,useCheckboxCardContext]=createOptionalContext();var classes$h={card:"m_26775b0a"};const defaultProps$y={withBorder:!0},varsResolver$d=createVarsResolver((e,{radius:t})=>({card:{"--card-radius":getRadius(t)}})),CheckboxCard=factory((e,t)=>{const n=useProps("CheckboxCard",defaultProps$y,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,checked:c,mod:u,withBorder:d,value:p,onClick:h,...f}=n,A=useStyles$u({name:"CheckboxCard",classes:classes$h,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$d,rootSelector:"card"}),m=useCheckboxGroupContext(),g="boolean"==typeof c?c:(null==m?void 0:m.value.includes(p||""))||!1;return factory$1(CheckboxCardProvider,{value:{checked:g},children:factory$1(UnstyledButton,{ref:t,mod:[{"with-border":d,checked:g},u],...A("card"),...f,role:"checkbox","aria-checked":g,onClick:e=>{null==h||h(e),null==m||m.onChange(p||"")}})})});function InputsGroupFieldset({children:e,role:t}){const n=useInputWrapperContext();return n?factory$1("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):factory$1(Fragment,{children:e})}CheckboxCard.displayName="@mantine/core/CheckboxCard",CheckboxCard.classes=classes$h;const defaultProps$x={},CheckboxGroup=factory((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:s,readOnly:l,...c}=useProps("CheckboxGroup",defaultProps$x,e),[u,d]=useUncontrolled({value:n,defaultValue:r,finalValue:[],onChange:o});return factory$1(CheckboxGroupProvider,{value:{value:u,onChange:e=>{const t="string"==typeof e?e:e.currentTarget.value;!l&&d(u.includes(t)?u.filter(e=>e!==t):[...u,t])},size:i},children:factory$1(Input$5.Wrapper,{size:i,ref:t,...a,...c,labelElement:"div",__staticSelector:"CheckboxGroup",children:factory$1(InputsGroupFieldset,{role:"group",children:s})})})});function CheckIcon({size:e,style:t,...n}){const r=void 0!==e?{width:rem(e),height:rem(e),...t}:t;return factory$1("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:factory$1("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function CheckboxIcon({indeterminate:e,...t}){return e?factory$1("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:factory$1("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):factory$1(CheckIcon,{...t})}CheckboxGroup.classes=Input$5.Wrapper.classes,CheckboxGroup.displayName="@mantine/core/CheckboxGroup";var classes$g={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const defaultProps$w={icon:CheckboxIcon},varsResolver$c=createVarsResolver((e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const s=parseThemeColor({color:n||e.primaryColor,theme:e}),l=s.isThemeColor&&void 0===s.shade?`var(--mantine-color-${s.color}-outline)`:s.color;return{indicator:{"--checkbox-size":getSize(r,"checkbox-size"),"--checkbox-radius":void 0===t?void 0:getRadius(t),"--checkbox-color":"outline"===i?l:getThemeColor(n,e),"--checkbox-icon-color":o?getThemeColor(o,e):getAutoContrastValue(a,e)?getContrastColor({color:n,theme:e,autoContrast:a}):void 0}}}),CheckboxIndicator=factory((e,t)=>{const n=useProps("CheckboxIndicator",defaultProps$w,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,icon:c,indeterminate:u,radius:d,color:p,iconColor:h,autoContrast:f,checked:A,mod:m,variant:g,disabled:y,...v}=n,b=c,x=useStyles$u({name:"CheckboxIndicator",classes:classes$g,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$c,rootSelector:"indicator"}),w=useCheckboxCardContext(),C="boolean"==typeof A||"boolean"==typeof u?A||u:(null==w?void 0:w.checked)||!1;return factory$1(Box,{ref:t,...x("indicator",{variant:g}),variant:g,mod:[{checked:C,disabled:y},m],...v,children:factory$1(b,{indeterminate:u,...x("icon")})})});CheckboxIndicator.displayName="@mantine/core/CheckboxIndicator",CheckboxIndicator.classes=classes$g;var classes$f={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const defaultProps$v={labelPosition:"right",icon:CheckboxIcon},varsResolver$b=createVarsResolver((e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const s=parseThemeColor({color:n||e.primaryColor,theme:e}),l=s.isThemeColor&&void 0===s.shade?`var(--mantine-color-${s.color}-outline)`:s.color;return{root:{"--checkbox-size":getSize(r,"checkbox-size"),"--checkbox-radius":void 0===t?void 0:getRadius(t),"--checkbox-color":"outline"===i?l:getThemeColor(n,e),"--checkbox-icon-color":o?getThemeColor(o,e):getAutoContrastValue(a,e)?getContrastColor({color:n,theme:e,autoContrast:a}):void 0}}}),Checkbox=factory((e,t)=>{const n=useProps("Checkbox",defaultProps$v,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,color:c,label:u,id:d,size:p,radius:h,wrapperProps:f,checked:A,labelPosition:m,description:g,error:y,disabled:v,variant:b,indeterminate:x,icon:w,rootRef:C,iconColor:$,onChange:_,autoContrast:S,mod:E,...k}=n,B=useCheckboxGroupContext(),P=p||(null==B?void 0:B.size),T=w,I=useStyles$u({name:"Checkbox",props:n,classes:classes$f,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$b}),{styleProps:L,rest:M}=extractStyleProps(k),D=useId$1(d),N=B?{checked:B.value.includes(M.value),onChange:e=>{B.onChange(e),null==_||_(e)}}:{};return factory$1(InlineInput,{...I("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:D,size:P,labelPosition:m,label:u,description:g,error:y,disabled:v,classNames:r,styles:a,unstyled:s,"data-checked":N.checked||A||void 0,variant:b,ref:C,mod:E,...L,...f,children:factory$1(Box,{...I("inner"),mod:{"data-label-position":m},children:[factory$1(Box,{component:"input",id:D,ref:t,checked:A,disabled:v,mod:{error:!!y,indeterminate:x},...I("input",{focusable:!0,variant:b}),onChange:_,...M,...N,type:"checkbox"}),factory$1(T,{indeterminate:x,...I("icon")})]})})});function isOptionsGroup(e){return"group"in e}function defaultOptionsFilter({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let i=0;i<e.length;i+=1){const a=e[i];if(o.length===n)return o;isOptionsGroup(a)&&o.push({group:a.group,items:defaultOptionsFilter({options:a.items,search:t,limit:n-o.length})}),isOptionsGroup(a)||a.label.toLowerCase().includes(r)&&o.push(a)}return o}function isEmptyComboboxData(e){if(0===e.length)return!0;for(const t of e){if(!("group"in t))return!1;if(t.items.length>0)return!1}return!0}function validateOptions(e,t=new Set){if(Array.isArray(e))for(const n of e)if(isOptionsGroup(n))validateOptions(n.items,t);else{if(void 0===n.value)throw new Error("[@mantine/core] Each option must have value property");if("string"!=typeof n.value)throw new Error("[@mantine/core] Option value must be a string, other data formats are not supported, got "+typeof n.value);if(t.has(n.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function isValueChecked(e,t){return Array.isArray(e)?e.includes(t):e===t}function Option({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:i}){if(!isOptionsGroup(e)){const a=isValueChecked(n,e.value),s=t&&a&&factory$1(CheckIcon,{className:classes$j.optionsDropdownCheckIcon}),l=factory$1(Fragment,{children:["left"===r&&s,factory$1("span",{children:e.label}),"right"===r&&s]});return factory$1(Combobox.Option,{value:e.value,disabled:e.disabled,className:clsx$2({[classes$j.optionsDropdownOption]:!o}),"data-reverse":"right"===r||void 0,"data-checked":a||void 0,"aria-selected":a,active:a,children:"function"==typeof i?i({option:e,checked:a}):l})}const a=e.items.map(e=>factory$1(Option,{data:e,value:n,unstyled:o,withCheckIcon:t,checkIconPosition:r,renderOption:i},e.value));return factory$1(Combobox.Group,{label:e.group,children:a})}function OptionsDropdown({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:i,maxDropdownHeight:a,withScrollArea:s=!0,filterOptions:l=!0,withCheckIcon:c=!1,value:u,checkIconPosition:d,nothingFoundMessage:p,unstyled:h,labelId:f,renderOption:A,scrollAreaProps:m,"aria-label":g}){validateOptions(e);const y="string"==typeof o?(r||defaultOptionsFilter)({options:e,search:l?o:"",limit:i??1/0}):e,v=isEmptyComboboxData(y),b=y.map(e=>factory$1(Option,{data:e,withCheckIcon:c,value:u,checkIconPosition:d,unstyled:h,renderOption:A},isOptionsGroup(e)?e.group:e.value));return factory$1(Combobox.Dropdown,{hidden:t||n&&v,children:factory$1(Combobox.Options,{labelledBy:f,"aria-label":g,children:[s?factory$1(ScrollArea.Autosize,{mah:a??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...m,children:b}):b,v&&p&&factory$1(Combobox.Empty,{children:p})]})})}Checkbox.classes={...classes$f,...InlineInputClasses},Checkbox.displayName="@mantine/core/Checkbox",Checkbox.Group=CheckboxGroup,Checkbox.Indicator=CheckboxIndicator,Checkbox.Card=CheckboxCard;var index$1=reactExports.useLayoutEffect,useLatest=function(e){var t=React.useRef(e);return index$1(function(){t.current=e}),t},updateRef=function(e,t){"function"!=typeof e?e.current=t:e(t)},useComposedRef=function(e,t){var n=React.useRef();return React.useCallback(function(r){e.current=r,n.current&&updateRef(n.current,null),n.current=t,t&&updateRef(t,r)},[t])},HIDDEN_TEXTAREA_STYLE={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},forceHiddenStyles=function(e){Object.keys(HIDDEN_TEXTAREA_STYLE).forEach(function(t){e.style.setProperty(t,HIDDEN_TEXTAREA_STYLE[t],"important")})},forceHiddenStyles$1=forceHiddenStyles,hiddenTextarea=null,getHeight=function(e,t){var n=e.scrollHeight;return"border-box"===t.sizingStyle.boxSizing?n+t.borderSize:n-t.paddingSize};function calculateNodeHeight(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=1/0),hiddenTextarea||((hiddenTextarea=document.createElement("textarea")).setAttribute("tabindex","-1"),hiddenTextarea.setAttribute("aria-hidden","true"),forceHiddenStyles$1(hiddenTextarea)),null===hiddenTextarea.parentNode&&document.body.appendChild(hiddenTextarea);var o=e.paddingSize,i=e.borderSize,a=e.sizingStyle,s=a.boxSizing;Object.keys(a).forEach(function(e){var t=e;hiddenTextarea.style[t]=a[t]}),forceHiddenStyles$1(hiddenTextarea),hiddenTextarea.value=t;var l=getHeight(hiddenTextarea,e);hiddenTextarea.value=t,l=getHeight(hiddenTextarea,e),hiddenTextarea.value="x";var c=hiddenTextarea.scrollHeight-o,u=c*n;"border-box"===s&&(u=u+o+i),l=Math.max(u,l);var d=c*r;return"border-box"===s&&(d=d+o+i),[l=Math.min(d,l),c]}var noop$1=function(){},pick=function(e,t){return e.reduce(function(e,n){return e[n]=t[n],e},{})},SIZING_STYLE=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],isIE=!!document.documentElement.currentStyle,getSizingData=function(e){var t=window.getComputedStyle(e);if(null===t)return null;var n=pick(SIZING_STYLE,t),r=n.boxSizing;return""===r?null:(isIE&&"border-box"===r&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px"),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})},getSizingData$1=getSizingData;function useListener(e,t,n){var r=useLatest(n);reactExports.useLayoutEffect(function(){var n=function(e){return r.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}},[])}var useWindowResizeListener=function(e){useListener(window,"resize",e)},useFontsLoadedListener=function(e){useListener(document.fonts,"loadingdone",e)},_excluded$1=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],TextareaAutosize=function(e,t){var n=e.cacheMeasurements,r=e.maxRows,o=e.minRows,i=e.onChange,a=void 0===i?noop$1:i,s=e.onHeightChange,l=void 0===s?noop$1:s,c=_objectWithoutPropertiesLoose(e,_excluded$1),u=void 0!==c.value,d=reactExports.useRef(null),p=useComposedRef(d,t),h=reactExports.useRef(0),f=reactExports.useRef(),A=function(){var e=d.current,t=n&&f.current?f.current:getSizingData$1(e);if(t){f.current=t;var i=calculateNodeHeight(t,e.value||e.placeholder||"x",o,r),a=i[0],s=i[1];h.current!==a&&(h.current=a,e.style.setProperty("height",a+"px","important"),l(a,{rowHeight:s}))}};return reactExports.useLayoutEffect(A),useWindowResizeListener(A),useFontsLoadedListener(A),reactExports.createElement("textarea",_extends({},c,{onChange:function(e){u||A(),a(e)},ref:p}))},index=reactExports.forwardRef(TextareaAutosize);const defaultProps$u={},Textarea=factory((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:i,resize:a,...s}=useProps("Textarea",defaultProps$u,e),l=n&&"test"!==getEnv();return factory$1(InputBase,{component:l?index:"textarea",ref:t,...s,__staticSelector:i||"Textarea",multiline:!0,"data-no-overflow":n&&void 0===r||void 0,__vars:{"--input-resize":a},...l?{maxRows:r,minRows:o}:{}})});Textarea.classes=InputBase.classes,Textarea.displayName="@mantine/core/Textarea";const[PillsInputProvider,usePillsInputContext]=createOptionalContext(),[PillGroupProvider,usePillGroupContext]=createOptionalContext();var classes$e={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const defaultProps$t={},varsResolver$a=createVarsResolver((e,{gap:t},{size:n})=>({group:{"--pg-gap":void 0!==t?getSize(t):getSize(n,"pg-gap")}})),PillGroup=factory((e,t)=>{const n=useProps("PillGroup",defaultProps$t,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,size:c,disabled:u,...d}=n,p=usePillsInputContext(),h=(null==p?void 0:p.size)||c||void 0,f=useStyles$u({name:"PillGroup",classes:classes$e,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$a,stylesCtx:{size:h},rootSelector:"group"});return factory$1(PillGroupProvider,{value:{size:h,disabled:u},children:factory$1(Box,{ref:t,size:h,...f("group"),...d})})});PillGroup.classes=classes$e,PillGroup.displayName="@mantine/core/PillGroup";const defaultProps$s={variant:"default"},varsResolver$9=createVarsResolver((e,{radius:t},{size:n})=>({root:{"--pill-fz":getSize(n,"pill-fz"),"--pill-height":getSize(n,"pill-height"),"--pill-radius":void 0===t?void 0:getRadius(t)}})),Pill=factory((e,t)=>{const n=useProps("Pill",defaultProps$s,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,variant:c,children:u,withRemoveButton:d,onRemove:p,removeButtonProps:h,radius:f,size:A,disabled:m,mod:g,...y}=n,v=usePillGroupContext(),b=usePillsInputContext(),x=A||(null==v?void 0:v.size)||void 0,w="filled"===(null==b?void 0:b.variant)?"contrast":c||"default",C=useStyles$u({name:"Pill",classes:classes$e,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$9,stylesCtx:{size:x}});return factory$1(Box,{component:"span",ref:t,variant:w,size:x,...C("root",{variant:w}),mod:[{"with-remove":d&&!m,disabled:m||(null==v?void 0:v.disabled)},g],...y,children:[factory$1("span",{...C("label"),children:u}),d&&factory$1(CloseButton,{variant:"transparent",radius:f,tabIndex:-1,"aria-hidden":!0,unstyled:s,...h,...C("remove",{className:null==h?void 0:h.className,style:null==h?void 0:h.style}),onMouseDown:e=>{var t;e.preventDefault(),e.stopPropagation(),null==(t=null==h?void 0:h.onMouseDown)||t.call(h,e)},onClick:e=>{var t;e.stopPropagation(),null==p||p(),null==(t=null==h?void 0:h.onClick)||t.call(h,e)}})]})});Pill.classes=classes$e,Pill.displayName="@mantine/core/Pill",Pill.Group=PillGroup;var classes$d={field:"m_45c4369d"};const defaultProps$r={type:"visible"},PillsInputField=factory((e,t)=>{const n=useProps("PillsInputField",defaultProps$r,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,type:c,disabled:u,id:d,pointer:p,mod:h,...f}=n,A=usePillsInputContext(),m=useInputWrapperContext(),g=useStyles$u({name:"PillsInputField",classes:classes$d,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"field"}),y=u||(null==A?void 0:A.disabled);return factory$1(Box,{component:"input",ref:useMergedRef(t,null==A?void 0:A.fieldRef),"data-type":c,disabled:y,mod:[{disabled:y,pointer:p},h],...g("field"),...f,id:(null==m?void 0:m.inputId)||d,"aria-invalid":null==A?void 0:A.hasError,"aria-describedby":null==m?void 0:m.describedBy,type:"text",onMouseDown:e=>!p&&e.stopPropagation()})});PillsInputField.classes=classes$d,PillsInputField.displayName="@mantine/core/PillsInputField";const defaultProps$q={},PillsInput=factory((e,t)=>{const n=useProps("PillsInput",defaultProps$q,e),{children:r,onMouseDown:o,onClick:i,size:a,disabled:s,__staticSelector:l,error:c,variant:u,...d}=n,p=reactExports.useRef();return factory$1(PillsInputProvider,{value:{fieldRef:p,size:a,disabled:s,hasError:!!c,variant:u},children:factory$1(InputBase,{size:a,error:c,variant:u,component:"div",ref:t,onMouseDown:e=>{var t;e.preventDefault(),null==o||o(e),null==(t=p.current)||t.focus()},onClick:e=>{var t;e.preventDefault(),null==i||i(e),null==(t=p.current)||t.focus()},...d,multiline:!0,disabled:s,__staticSelector:l||"PillsInput",withAria:!1,children:r})})});function filterPickedValues({data:e,value:t}){const n=t.map(e=>e.trim().toLowerCase());return e.reduce((e,t)=>(isOptionsGroup(t)?e.push({group:t.group,items:t.items.filter(e=>-1===n.indexOf(e.value.toLowerCase().trim()))}):-1===n.indexOf(t.value.toLowerCase().trim())&&e.push(t),e),[])}PillsInput.displayName="@mantine/core/PillsInput",PillsInput.Field=PillsInputField;const defaultProps$p={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},MultiSelect=factory((e,t)=>{const n=useProps("MultiSelect",defaultProps$p,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,size:c,value:u,defaultValue:d,onChange:p,onKeyDown:h,variant:f,data:A,dropdownOpened:m,defaultDropdownOpened:g,onDropdownOpen:y,onDropdownClose:v,selectFirstOptionOnChange:b,onOptionSubmit:x,comboboxProps:w,filter:C,limit:$,withScrollArea:_,maxDropdownHeight:S,searchValue:E,defaultSearchValue:k,onSearchChange:B,readOnly:P,disabled:T,onFocus:I,onBlur:L,onPaste:M,radius:D,rightSection:N,rightSectionWidth:F,rightSectionPointerEvents:O,rightSectionProps:R,leftSection:U,leftSectionWidth:j,leftSectionPointerEvents:H,leftSectionProps:Q,inputContainer:z,inputWrapperOrder:V,withAsterisk:W,labelProps:Y,descriptionProps:G,errorProps:K,wrapperProps:q,description:J,label:Z,error:X,maxValues:ee,searchable:te,nothingFoundMessage:ne,withCheckIcon:re,checkIconPosition:oe,hidePickedOptions:ie,withErrorStyles:ae,name:se,form:le,id:ce,clearable:ue,clearButtonProps:de,hiddenInputProps:pe,placeholder:he,hiddenInputValuesDivider:fe,required:Ae,mod:me,renderOption:ge,onRemove:ye,onClear:ve,scrollAreaProps:be,...xe}=n,we=useId$1(ce),Ce=getParsedComboboxData(A),$e=getOptionsLockup(Ce),_e=useCombobox({opened:m,defaultOpened:g,onDropdownOpen:y,onDropdownClose:()=>{null==v||v(),_e.resetSelectedOption()}}),{styleProps:Se,rest:{type:Ee,autoComplete:ke,...Be}}=extractStyleProps(xe),[Pe,Te]=useUncontrolled({value:u,defaultValue:d,finalValue:[],onChange:p}),[Ie,Le]=useUncontrolled({value:E,defaultValue:k,finalValue:"",onChange:B}),Me=useStyles$u({name:"MultiSelect",classes:{},props:n,classNames:r,styles:a,unstyled:s}),{resolvedClassNames:De,resolvedStyles:Ne}=useResolvedStylesApi({props:n,styles:a,classNames:r}),Fe=Pe.map((e,t)=>{var n,r;return factory$1(Pill,{withRemoveButton:!P&&!(null==(n=$e[e])?void 0:n.disabled),onRemove:()=>{Te(Pe.filter(t=>e!==t)),null==ye||ye(e)},unstyled:s,disabled:T,...Me("pill"),children:(null==(r=$e[e])?void 0:r.label)||e})});reactExports.useEffect(()=>{b&&_e.selectFirstOption()},[b,Pe]);const Oe=ue&&Pe.length>0&&!T&&!P&&factory$1(Combobox.ClearButton,{size:c,...de,onClear:()=>{null==ve||ve(),Te([]),Le("")}}),Re=filterPickedValues({data:Ce,value:Pe});return factory$1(Fragment,{children:[factory$1(Combobox,{store:_e,classNames:De,styles:Ne,unstyled:s,size:c,readOnly:P,__staticSelector:"MultiSelect",onOptionSubmit:e=>{null==x||x(e),Le(""),_e.updateSelectedOptionIndex("selected"),Pe.includes($e[e].value)?(Te(Pe.filter(t=>t!==$e[e].value)),null==ye||ye($e[e].value)):Pe.length<ee&&Te([...Pe,$e[e].value])},...w,children:[factory$1(Combobox.DropdownTarget,{children:factory$1(PillsInput,{...Se,__staticSelector:"MultiSelect",classNames:De,styles:Ne,unstyled:s,size:c,className:o,style:i,variant:f,disabled:T,radius:D,rightSection:N||Oe||factory$1(Combobox.Chevron,{size:c,error:X,unstyled:s}),rightSectionPointerEvents:O||(Oe?"all":"none"),rightSectionWidth:F,rightSectionProps:R,leftSection:U,leftSectionWidth:j,leftSectionPointerEvents:H,leftSectionProps:Q,inputContainer:z,inputWrapperOrder:V,withAsterisk:W,labelProps:Y,descriptionProps:G,errorProps:K,wrapperProps:q,description:J,label:Z,error:X,multiline:!0,withErrorStyles:ae,__stylesApiProps:{...n,rightSectionPointerEvents:O||(Oe?"all":"none"),multiline:!0},pointer:!te,onClick:()=>te?_e.openDropdown():_e.toggleDropdown(),"data-expanded":_e.dropdownOpened||void 0,id:we,required:Ae,mod:me,children:factory$1(Pill.Group,{disabled:T,unstyled:s,...Me("pillsList"),children:[Fe,factory$1(Combobox.EventsTarget,{autoComplete:ke,children:factory$1(PillsInput.Field,{...Be,ref:t,id:we,placeholder:he,type:te||he?"visible":"hidden",...Me("inputField"),unstyled:s,onFocus:e=>{null==I||I(e),te&&_e.openDropdown()},onBlur:e=>{null==L||L(e),_e.closeDropdown(),Le("")},onKeyDown:e=>{null==h||h(e)," "!==e.key||te||(e.preventDefault(),_e.toggleDropdown()),"Backspace"===e.key&&0===Ie.length&&Pe.length>0&&(null==ye||ye(Pe[Pe.length-1]),Te(Pe.slice(0,Pe.length-1)))},value:Ie,onChange:e=>{Le(e.currentTarget.value),te&&_e.openDropdown(),b&&_e.selectFirstOption()},disabled:T,readOnly:P||!te,pointer:!te})})]})})}),factory$1(OptionsDropdown,{data:ie?Re:Ce,hidden:P||T,filter:C,search:Ie,limit:$,hiddenWhenEmpty:!ne,withScrollArea:_,maxDropdownHeight:S,filterOptions:te,value:Pe,checkIconPosition:oe,withCheckIcon:re,nothingFoundMessage:ne,unstyled:s,labelId:Z?`${we}-label`:void 0,"aria-label":Z?void 0:xe["aria-label"],renderOption:ge,scrollAreaProps:be})]}),factory$1(Combobox.HiddenInput,{name:se,valuesDivider:fe,value:Pe,form:le,disabled:T,...pe})]})});MultiSelect.classes={...InputBase.classes,...Combobox.classes},MultiSelect.displayName="@mantine/core/MultiSelect";const[RadioGroupProvider,useRadioGroupContext]=createOptionalContext(),[RadioCardProvider,useRadioCardContext]=createOptionalContext();var classes$c={card:"m_9dc8ae12"};const defaultProps$o={withBorder:!0},varsResolver$8=createVarsResolver((e,{radius:t})=>({card:{"--card-radius":getRadius(t)}})),RadioCard=factory((e,t)=>{const n=useProps("RadioCard",defaultProps$o,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,checked:c,mod:u,withBorder:d,value:p,onClick:h,name:f,onKeyDown:A,...m}=n,g=useStyles$u({name:"RadioCard",classes:classes$c,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$8,rootSelector:"card"}),{dir:y}=useDirection(),v=useRadioGroupContext(),b="boolean"==typeof c?c:(null==v?void 0:v.value)===p||!1,x=f||(null==v?void 0:v.name);return factory$1(RadioCardProvider,{value:{checked:b},children:factory$1(UnstyledButton,{ref:t,mod:[{"with-border":d,checked:b},u],...g("card"),...m,role:"radio","aria-checked":b,name:x,onClick:e=>{null==h||h(e),null==v||v.onChange(p||"")},onKeyDown:e=>{if(null==A||A(e),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(e.nativeEvent.code)){e.preventDefault();const t=Array.from(document.querySelectorAll(`[role="radio"][name="${x||"__mantine"}"]`)),n=t.findIndex(t=>t===e.target),r=n+1>=t.length?0:n+1,o=n-1<0?t.length-1:n-1;"ArrowDown"===e.nativeEvent.code&&(t[r].focus(),t[r].click()),"ArrowUp"===e.nativeEvent.code&&(t[o].focus(),t[o].click()),"ArrowLeft"===e.nativeEvent.code&&(t["ltr"===y?o:r].focus(),t["ltr"===y?o:r].click()),"ArrowRight"===e.nativeEvent.code&&(t["ltr"===y?r:o].focus(),t["ltr"===y?r:o].click())}}})})});RadioCard.displayName="@mantine/core/RadioCard",RadioCard.classes=classes$c;const defaultProps$n={},RadioGroup=factory((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:s,name:l,readOnly:c,...u}=useProps("RadioGroup",defaultProps$n,e),d=useId$1(l),[p,h]=useUncontrolled({value:n,defaultValue:r,finalValue:"",onChange:o});return factory$1(RadioGroupProvider,{value:{value:p,onChange:e=>!c&&h("string"==typeof e?e:e.currentTarget.value),size:i,name:d},children:factory$1(Input$5.Wrapper,{size:i,ref:t,...a,...u,labelElement:"div",__staticSelector:"RadioGroup",children:factory$1(InputsGroupFieldset,{role:"radiogroup",children:s})})})});function RadioIcon({size:e,style:t,...n}){return factory$1("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:rem(e),height:rem(e),...t},"aria-hidden":!0,...n,children:factory$1("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}RadioGroup.classes=Input$5.Wrapper.classes,RadioGroup.displayName="@mantine/core/RadioGroup";var classes$b={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const defaultProps$m={icon:RadioIcon},varsResolver$7=createVarsResolver((e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const s=parseThemeColor({color:n||e.primaryColor,theme:e}),l=s.isThemeColor&&void 0===s.shade?`var(--mantine-color-${s.color}-outline)`:s.color;return{indicator:{"--radio-size":getSize(r,"radio-size"),"--radio-radius":void 0===t?void 0:getRadius(t),"--radio-color":"outline"===i?l:getThemeColor(n,e),"--radio-icon-size":getSize(r,"radio-icon-size"),"--radio-icon-color":o?getThemeColor(o,e):getAutoContrastValue(a,e)?getContrastColor({color:n,theme:e,autoContrast:a}):void 0}}}),RadioIndicator=factory((e,t)=>{const n=useProps("RadioIndicator",defaultProps$m,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,icon:c,radius:u,color:d,iconColor:p,autoContrast:h,checked:f,mod:A,variant:m,disabled:g,...y}=n,v=c,b=useStyles$u({name:"RadioIndicator",classes:classes$b,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$7,rootSelector:"indicator"}),x=useRadioCardContext(),w="boolean"==typeof f?f:(null==x?void 0:x.checked)||!1;return factory$1(Box,{ref:t,...b("indicator",{variant:m}),variant:m,mod:[{checked:w,disabled:g},A],...y,children:factory$1(v,{...b("icon")})})});RadioIndicator.displayName="@mantine/core/RadioIndicator",RadioIndicator.classes=classes$b;var classes$a={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const defaultProps$l={labelPosition:"right"},varsResolver$6=createVarsResolver((e,{size:t,radius:n,color:r,iconColor:o,variant:i,autoContrast:a})=>{const s=parseThemeColor({color:r||e.primaryColor,theme:e}),l=s.isThemeColor&&void 0===s.shade?`var(--mantine-color-${s.color}-outline)`:s.color;return{root:{"--radio-size":getSize(t,"radio-size"),"--radio-radius":void 0===n?void 0:getRadius(n),"--radio-color":"outline"===i?l:getThemeColor(r,e),"--radio-icon-color":o?getThemeColor(o,e):getAutoContrastValue(a,e)?getContrastColor({color:r,theme:e,autoContrast:a}):void 0,"--radio-icon-size":getSize(t,"radio-icon-size")}}}),Radio=factory((e,t)=>{const n=useProps("Radio",defaultProps$l,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,id:c,size:u,label:d,labelPosition:p,description:h,error:f,radius:A,color:m,variant:g,disabled:y,wrapperProps:v,icon:b=RadioIcon,rootRef:x,iconColor:w,onChange:C,mod:$,..._}=n,S=useStyles$u({name:"Radio",classes:classes$a,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$6}),E=useRadioGroupContext(),k=(null==E?void 0:E.size)??u,B=n.size?u:k,{styleProps:P,rest:T}=extractStyleProps(_),I=useId$1(c),L=E?{checked:E.value===T.value,name:T.name??E.name,onChange:e=>{E.onChange(e),null==C||C(e)}}:{};return factory$1(InlineInput,{...S("root"),__staticSelector:"Radio",__stylesApiProps:n,id:I,size:B,labelPosition:p,label:d,description:h,error:f,disabled:y,classNames:r,styles:a,unstyled:s,"data-checked":L.checked||void 0,variant:g,ref:x,mod:$,...P,...v,children:factory$1(Box,{...S("inner"),mod:{"label-position":p},children:[factory$1(Box,{...S("radio",{focusable:!0,variant:g}),onChange:C,...T,...L,component:"input",mod:{error:!!f},ref:t,id:I,disabled:y,type:"radio"}),factory$1(b,{...S("icon"),"aria-hidden":!0})]})})});Radio.classes=classes$a,Radio.displayName="@mantine/core/Radio",Radio.Group=RadioGroup,Radio.Card=RadioCard,Radio.Indicator=RadioIndicator;const defaultProps$k={searchable:!1,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left"},Select=factory((e,t)=>{const n=useProps("Select",defaultProps$k,e),{classNames:r,styles:o,unstyled:i,vars:a,dropdownOpened:s,defaultDropdownOpened:l,onDropdownClose:c,onDropdownOpen:u,onFocus:d,onBlur:p,onClick:h,onChange:f,data:A,value:m,defaultValue:g,selectFirstOptionOnChange:y,onOptionSubmit:v,comboboxProps:b,readOnly:x,disabled:w,filter:C,limit:$,withScrollArea:_,maxDropdownHeight:S,size:E,searchable:k,rightSection:B,checkIconPosition:P,withCheckIcon:T,nothingFoundMessage:I,name:L,form:M,searchValue:D,defaultSearchValue:N,onSearchChange:F,allowDeselect:O,error:R,rightSectionPointerEvents:U,id:j,clearable:H,clearButtonProps:Q,hiddenInputProps:z,renderOption:V,onClear:W,autoComplete:Y,scrollAreaProps:G,...K}=n,q=reactExports.useMemo(()=>getParsedComboboxData(A),[A]),J=reactExports.useMemo(()=>getOptionsLockup(q),[q]),Z=useId$1(j),[X,ee,te]=useUncontrolled({value:m,defaultValue:g,finalValue:null,onChange:f}),ne="string"==typeof X?J[X]:void 0,re=usePrevious(ne),[oe,ie]=useUncontrolled({value:D,defaultValue:N,finalValue:ne?ne.label:"",onChange:F}),ae=useCombobox({opened:s,defaultOpened:l,onDropdownOpen:()=>{null==u||u(),ae.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{null==c||c(),ae.resetSelectedOption()}}),{resolvedClassNames:se,resolvedStyles:le}=useResolvedStylesApi({props:n,styles:o,classNames:r});reactExports.useEffect(()=>{y&&ae.selectFirstOption()},[y,X]),reactExports.useEffect(()=>{null===m&&ie(""),"string"!=typeof m||!ne||(null==re?void 0:re.value)===ne.value&&(null==re?void 0:re.label)===ne.label||ie(ne.label)},[m,ne]);const ce=H&&!!X&&!w&&!x&&factory$1(Combobox.ClearButton,{size:E,...Q,onClear:()=>{ee(null,null),ie(""),null==W||W()}});return factory$1(Fragment,{children:[factory$1(Combobox,{store:ae,__staticSelector:"Select",classNames:se,styles:le,unstyled:i,readOnly:x,onOptionSubmit:e=>{null==v||v(e);const t=O&&J[e].value===X?null:J[e],n=t?t.value:null;n!==X&&ee(n,t),!te&&ie("string"==typeof n&&(null==t?void 0:t.label)||""),ae.closeDropdown()},size:E,...b,children:[factory$1(Combobox.Target,{targetType:k?"input":"button",autoComplete:Y,children:factory$1(InputBase,{id:Z,ref:t,rightSection:B||ce||factory$1(Combobox.Chevron,{size:E,error:R,unstyled:i}),rightSectionPointerEvents:U||(ce?"all":"none"),...K,size:E,__staticSelector:"Select",disabled:w,readOnly:x||!k,value:oe,onChange:e=>{ie(e.currentTarget.value),ae.openDropdown(),y&&ae.selectFirstOption()},onFocus:e=>{k&&ae.openDropdown(),null==d||d(e)},onBlur:e=>{var t;k&&ae.closeDropdown(),ie(null!=X&&(null==(t=J[X])?void 0:t.label)||""),null==p||p(e)},onClick:e=>{k?ae.openDropdown():ae.toggleDropdown(),null==h||h(e)},classNames:se,styles:le,unstyled:i,pointer:!k,error:R})}),factory$1(OptionsDropdown,{data:q,hidden:x||w,filter:C,search:oe,limit:$,hiddenWhenEmpty:!I,withScrollArea:_,maxDropdownHeight:S,filterOptions:k&&(null==ne?void 0:ne.label)!==oe,value:X,checkIconPosition:P,withCheckIcon:T,nothingFoundMessage:I,unstyled:i,labelId:K.label?`${Z}-label`:void 0,"aria-label":K.label?void 0:K["aria-label"],renderOption:V,scrollAreaProps:G})]}),factory$1(Combobox.HiddenInput,{value:X,name:L,form:M,disabled:w,...z})]})});Select.classes={...InputBase.classes,...Combobox.classes},Select.displayName="@mantine/core/Select";const[SliderProvider,useSliderContext]=createSafeContext("SliderProvider was not found in tree"),SliderRoot=reactExports.forwardRef(({size:e,disabled:t,variant:n,color:r,thumbSize:o,radius:i,...a},s)=>{const{getStyles:l}=useSliderContext();return factory$1(Box,{tabIndex:-1,variant:n,size:e,ref:s,...l("root"),...a})});SliderRoot.displayName="@mantine/core/SliderRoot";const Thumb=reactExports.forwardRef(({max:e,min:t,value:n,position:r,label:o,dragging:i,onMouseDown:a,onKeyDownCapture:s,labelTransitionProps:l,labelAlwaysOn:c,thumbLabel:u,onFocus:d,onBlur:p,showLabelOnHover:h,isHovered:f,children:A=null,disabled:m},g)=>{const{getStyles:y}=useSliderContext(),[v,b]=reactExports.useState(!1),x=c||i||v||h&&f;return factory$1(Box,{tabIndex:0,role:"slider","aria-label":u,"aria-valuemax":e,"aria-valuemin":t,"aria-valuenow":n,ref:g,__vars:{"--slider-thumb-offset":`${r}%`},...y("thumb",{focusable:!0}),mod:{dragging:i,disabled:m},onFocus:()=>{b(!0),"function"==typeof d&&d()},onBlur:()=>{b(!1),"function"==typeof p&&p()},onTouchStart:a,onMouseDown:a,onKeyDownCapture:s,onClick:e=>e.stopPropagation(),children:[A,factory$1(Transition,{mounted:null!=o&&!!x,transition:"fade",duration:0,...l,children:e=>factory$1("div",{...y("label",{style:e}),children:o})})]})});function getPosition({value:e,min:t,max:n}){const r=(e-t)/(n-t)*100;return Math.min(Math.max(r,0),100)}function isMarkFilled({mark:e,offset:t,value:n,inverted:r=!1}){return r?"number"==typeof t&&e.value<=t||e.value>=n:"number"==typeof t?e.value>=t&&e.value<=n:e.value<=n}function Marks({marks:e,min:t,max:n,disabled:r,value:o,offset:i,inverted:a}){const{getStyles:s}=useSliderContext();if(!e)return null;const l=e.map((e,l)=>reactExports.createElement(Box,{...s("markWrapper"),__vars:{"--mark-offset":`${getPosition({value:e.value,min:t,max:n})}%`},key:l},factory$1(Box,{...s("mark"),mod:{filled:isMarkFilled({mark:e,value:o,offset:i,inverted:a}),disabled:r}}),e.label&&factory$1("div",{...s("markLabel"),children:e.label})));return factory$1("div",{children:l})}function Track({filled:e,children:t,offset:n,disabled:r,marksOffset:o,inverted:i,containerProps:a,...s}){const{getStyles:l}=useSliderContext();return factory$1(Fragment,{children:factory$1(Box,{...l("trackContainer"),mod:{disabled:r},...a,children:factory$1(Box,{...l("track"),mod:{inverted:i,disabled:r},children:[factory$1(Box,{mod:{inverted:i,disabled:r},__vars:{"--slider-bar-width":`calc(${e}% + var(--slider-size))`,"--slider-bar-offset":`calc(${n}% - var(--slider-size))`},...l("bar")}),t,factory$1(Marks,{...s,offset:o,disabled:r,inverted:i})]})})})}function getChangeValue({value:e,containerWidth:t,min:n,max:r,step:o,precision:i}){const a=(t?Math.min(Math.max(e,0),t)/t:e)*(r-n),s=(0!==a?Math.round(a/o)*o:0)+n,l=Math.max(s,n);return void 0!==i?Number(l.toFixed(i)):l}function getFloatingValue(e,t){return parseFloat(e.toFixed(t))}function getPrecision(e){if(!e)return 0;const t=e.toString().split(".");return t.length>1?t[1].length:0}Thumb.displayName="@mantine/core/SliderThumb",Marks.displayName="@mantine/core/SliderMarks",Track.displayName="@mantine/core/SliderTrack";var classes$9={root:"m_dd36362e",label:"m_c9357328",thumb:"m_c9a9a60a",trackContainer:"m_a8645c2",track:"m_c9ade57f",bar:"m_38aeed47",markWrapper:"m_b7b0423a",mark:"m_dd33bc19",markLabel:"m_68c77a5b"};const defaultProps$j={radius:"xl",min:0,max:100,step:1,marks:[],label:e=>e,labelTransitionProps:{transition:"fade",duration:0},labelAlwaysOn:!1,thumbLabel:"",showLabelOnHover:!0,disabled:!1,scale:e=>e},varsResolver$5=createVarsResolver((e,{size:t,color:n,thumbSize:r,radius:o})=>({root:{"--slider-size":getSize(t,"slider-size"),"--slider-color":n?getThemeColor(n,e):void 0,"--slider-radius":void 0===o?void 0:getRadius(o),"--slider-thumb-size":void 0!==r?rem(r):"calc(var(--slider-size) * 2)"}})),Slider=factory((e,t)=>{const n=useProps("Slider",defaultProps$j,e),{classNames:r,styles:o,value:i,onChange:a,onChangeEnd:s,size:l,min:c,max:u,step:d,precision:p,defaultValue:h,name:f,marks:A,label:m,labelTransitionProps:g,labelAlwaysOn:y,thumbLabel:v,showLabelOnHover:b,thumbChildren:x,disabled:w,unstyled:C,scale:$,inverted:_,className:S,style:E,vars:k,hiddenInputProps:B,...P}=n,T=useStyles$u({name:"Slider",props:n,classes:classes$9,classNames:r,className:S,styles:o,style:E,vars:k,varsResolver:varsResolver$5,unstyled:C}),{dir:I}=useDirection(),[L,M]=reactExports.useState(!1),[D,N]=useUncontrolled({value:"number"==typeof i?clamp$2(i,c,u):i,defaultValue:"number"==typeof h?clamp$2(h,c,u):h,finalValue:clamp$2(0,c,u),onChange:a}),F=reactExports.useRef(D),O=reactExports.useRef(),R=reactExports.useRef(),U=getPosition({value:D,min:c,max:u}),j=$(D),H="function"==typeof m?m(j):m,Q=p??getPrecision(d),z=reactExports.useCallback(({x:e})=>{if(!w){const t=getChangeValue({value:e,min:c,max:u,step:d,precision:Q});N(t),F.current=t}},[w,c,u,d,Q,N]),{ref:V,active:W}=useMove(z,{onScrubEnd:()=>null==s?void 0:s(F.current)},I);return factory$1(SliderProvider,{value:{getStyles:T},children:factory$1(SliderRoot,{...P,ref:useMergedRef(t,O),onKeyDownCapture:e=>{var t,n,r,o,i,a;if(!w)switch(e.key){case"ArrowUp":{e.preventDefault(),null==(t=R.current)||t.focus();const n=getFloatingValue(Math.min(Math.max(D+d,c),u),Q);N(n),null==s||s(n);break}case"ArrowRight":{e.preventDefault(),null==(n=R.current)||n.focus();const t=getFloatingValue(Math.min(Math.max("rtl"===I?D-d:D+d,c),u),Q);N(t),null==s||s(t);break}case"ArrowDown":{e.preventDefault(),null==(r=R.current)||r.focus();const t=getFloatingValue(Math.min(Math.max(D-d,c),u),Q);N(t),null==s||s(t);break}case"ArrowLeft":{e.preventDefault(),null==(o=R.current)||o.focus();const t=getFloatingValue(Math.min(Math.max("rtl"===I?D+d:D-d,c),u),Q);N(t),null==s||s(t);break}case"Home":e.preventDefault(),null==(i=R.current)||i.focus(),N(c),null==s||s(c);break;case"End":e.preventDefault(),null==(a=R.current)||a.focus(),N(u),null==s||s(u)}},onMouseDownCapture:()=>{var e;return null==(e=O.current)?void 0:e.focus()},size:l,disabled:w,children:[factory$1(Track,{inverted:_,offset:0,filled:U,marks:A,min:c,max:u,value:j,disabled:w,containerProps:{ref:V,onMouseEnter:b?()=>M(!0):void 0,onMouseLeave:b?()=>M(!1):void 0},children:factory$1(Thumb,{max:u,min:c,value:j,position:U,dragging:W,label:H,ref:R,labelTransitionProps:g,labelAlwaysOn:y,thumbLabel:v,showLabelOnHover:b,isHovered:L,disabled:w,children:x})}),factory$1("input",{type:"hidden",name:f,value:j,...B})]})})});Slider.classes=classes$9,Slider.displayName="@mantine/core/Slider";const SwitchGroupContext=reactExports.createContext(null),SwitchGroupProvider=SwitchGroupContext.Provider,useSwitchGroupContext=()=>reactExports.useContext(SwitchGroupContext),defaultProps$i={},SwitchGroup=factory((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:s,readOnly:l,...c}=useProps("SwitchGroup",defaultProps$i,e),[u,d]=useUncontrolled({value:n,defaultValue:r,finalValue:[],onChange:o});return factory$1(SwitchGroupProvider,{value:{value:u,onChange:e=>{const t=e.currentTarget.value;!l&&d(u.includes(t)?u.filter(e=>e!==t):[...u,t])},size:i},children:factory$1(Input$5.Wrapper,{size:i,ref:t,...a,...c,labelElement:"div",__staticSelector:"SwitchGroup",children:factory$1(InputsGroupFieldset,{role:"group",children:s})})})});SwitchGroup.classes=Input$5.Wrapper.classes,SwitchGroup.displayName="@mantine/core/SwitchGroup";var classes$8={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const defaultProps$h={labelPosition:"right"},varsResolver$4=createVarsResolver((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":void 0===t?void 0:getRadius(t),"--switch-height":getSize(r,"switch-height"),"--switch-width":getSize(r,"switch-width"),"--switch-thumb-size":getSize(r,"switch-thumb-size"),"--switch-label-font-size":getSize(r,"switch-label-font-size"),"--switch-track-label-padding":getSize(r,"switch-track-label-padding"),"--switch-color":n?getThemeColor(n,e):void 0}})),Switch=factory((e,t)=>{const n=useProps("Switch",defaultProps$h,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,color:c,label:u,offLabel:d,onLabel:p,id:h,size:f,radius:A,wrapperProps:m,thumbIcon:g,checked:y,defaultChecked:v,onChange:b,labelPosition:x,description:w,error:C,disabled:$,variant:_,rootRef:S,mod:E,...k}=n,B=useSwitchGroupContext(),P=f||(null==B?void 0:B.size),T=useStyles$u({name:"Switch",props:n,classes:classes$8,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$4}),{styleProps:I,rest:L}=extractStyleProps(k),M=useId$1(h),D=B?{checked:B.value.includes(L.value),onChange:B.onChange}:{},[N,F]=useUncontrolled({value:D.checked??y,defaultValue:v,finalValue:!1});return factory$1(InlineInput,{...T("root"),__staticSelector:"Switch",__stylesApiProps:n,id:M,size:P,labelPosition:x,label:u,description:w,error:C,disabled:$,bodyElement:"label",labelElement:"span",classNames:r,styles:a,unstyled:s,"data-checked":D.checked||void 0,variant:_,ref:S,mod:E,...I,...m,children:[factory$1("input",{...L,disabled:$,checked:N,onChange:e=>{var t;B?null==(t=D.onChange)||t.call(D,e):null==b||b(e),F(e.currentTarget.checked)},id:M,ref:t,type:"checkbox",role:"switch",...T("input")}),factory$1(Box,{"aria-hidden":"true",mod:{error:C,"label-position":x,"without-labels":!p&&!d},...T("track"),children:[factory$1(Box,{component:"span",mod:"reduce-motion",...T("thumb"),children:g}),factory$1("span",{...T("trackLabel"),children:N?p:d})]})]})});Switch.classes={...classes$8,...InlineInputClasses},Switch.displayName="@mantine/core/Switch",Switch.Group=SwitchGroup;const defaultProps$g={},TextInput=factory((e,t)=>{const n=useProps("TextInput",defaultProps$g,e);return factory$1(InputBase,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});var createRoot;TextInput.classes=InputBase.classes,TextInput.displayName="@mantine/core/TextInput";var m$2=reactDomExports;createRoot=m$2.createRoot,m$2.hydrateRoot;const baseServices$1={alertService:Symbol("alertService"),errorService:Symbol("errorService"),layoutService:Symbol("layoutService"),loggerService:Symbol("loggerService"),routerService:Symbol("routerService"),linkService:Symbol("linkService")},globalServices$1={symbolGlobalService:Symbol("symbolGlobalService"),priceGlobalService:Symbol("priceGlobalService"),backtestGlobalService:Symbol("backtestGlobalService"),liveGlobalService:Symbol("liveGlobalService")},helperServices$1={explorerHelperService:Symbol("explorerHelperService"),markdownHelperService:Symbol("markdownHelperService")},mockServices$1={exchangeMockService:Symbol("exchangeMockService"),notificationMockService:Symbol("notificationMockService"),storageMockService:Symbol("storageMockService"),logMockService:Symbol("logMockService"),statusMockService:Symbol("statusMockService"),markdownMockService:Symbol("markdownMockService"),explorerMockService:Symbol("explorerMockService"),signalMockService:Symbol("signalMockService"),heatMockService:Symbol("heatMockService")},viewServices$1={exchangeViewService:Symbol("exchangeViewService"),notificationViewService:Symbol("notificationViewService"),storageViewService:Symbol("storageViewService"),logViewService:Symbol("logViewService"),statusViewService:Symbol("statusViewService"),markdownViewService:Symbol("markdownViewService"),explorerViewService:Symbol("explorerViewService"),signalViewService:Symbol("signalViewService"),heatViewService:Symbol("heatViewService")},TYPES={...baseServices$1,...globalServices$1,...helperServices$1,...mockServices$1,...viewServices$1};class ErrorService{routerService=YS(TYPES.routerService);loggerService=YS(TYPES.loggerService);errorSubject=new ar;handleGlobalError=e=>{console.error(e),this.loggerService.error(e),this.routerService.push("/error_page"),this.errorSubject.next()}}class LayoutService{appbarSubject=new ar;modalSubject=new ar;pickSignalSubject=new ar;pickRiskSubject=new ar;pickSignalOpenedSubject=new ar;pickSignalClosedSubject=new ar;pickSignalScheduledSubject=new ar;pickSignalCancelledSubject=new ar;pickSignalNotifySubject=new ar;pickPartialProfitAvailableSubject=new ar;pickPartialProfitCommitSubject=new ar;pickPartialLossAvailableSubject=new ar;pickPartialLossCommitSubject=new ar;pickBreakevenAvailableSubject=new ar;pickBreakevenCommitSubject=new ar;pickTrailingStopSubject=new ar;pickTrailingTakeSubject=new ar;pickActivateScheduledSubject=new ar;pickAverageBuyCommitSubject=new ar;pickSignalSyncOpenSubject=new ar;pickSignalSyncCloseSubject=new ar;pickCancelScheduledSubject=new ar;pickClosePendingSubject=new ar;pickDumpContentSubject=new ar;closeModalSubject=new ar;reloadOutletSubject=new ar;openDocumentSubject=new ar;promptOutgoing=new ar;promptIncoming=new ar;alertOutgoung=new ar;_modalLoading=0;_appbarLoading=0;get hasModalLoader(){return!!this._modalLoading}get hasAppbarLoader(){return!!this._appbarLoading}setModalLoader=e=>{this._modalLoading=Math.max(this._modalLoading+(e?1:-1),0),this.modalSubject.next(e)};setAppbarLoader=e=>{this._appbarLoading=Math.max(this._appbarLoading+(e?1:-1),0),this.appbarSubject.next(e)};dropModalLoader=()=>{this._modalLoading=0,this.modalSubject.next(!1)};dropAppbarLoader=()=>{this._appbarLoading=0,this.appbarSubject.next(!1)};reloadOutlet=()=>{this.reloadOutletSubject.next()};prompt=async(e,t="")=>(this.promptOutgoing.next({title:e,value:t}),await this.promptIncoming.toPromise());closeModal=async()=>{await this.closeModalSubject.next()};downloadFile=(e,t,n)=>{this.openDocumentSubject.next({url:e,fileName:t,sizeOriginal:n})};pickAlert=async(e,t)=>{await this.alertOutgoung.next({title:e,description:t})};pickSignal=async e=>{await this.pickSignalSubject.next(e)};pickRisk=async e=>{await this.pickRiskSubject.next(e)};pickSignalOpened=async e=>{await this.pickSignalOpenedSubject.next(e)};pickSignalNotify=async e=>{await this.pickSignalNotifySubject.next(e)};pickSignalClosed=async e=>{await this.pickSignalClosedSubject.next(e)};pickSignalScheduled=async e=>{await this.pickSignalScheduledSubject.next(e)};pickSignalCancelled=async e=>{await this.pickSignalCancelledSubject.next(e)};pickPartialProfitAvailable=async e=>{await this.pickPartialProfitAvailableSubject.next(e)};pickPartialProfitCommit=async e=>{await this.pickPartialProfitCommitSubject.next(e)};pickPartialLossAvailable=async e=>{await this.pickPartialLossAvailableSubject.next(e)};pickPartialLossCommit=async e=>{await this.pickPartialLossCommitSubject.next(e)};pickBreakevenAvailable=async e=>{await this.pickBreakevenAvailableSubject.next(e)};pickBreakevenCommit=async e=>{await this.pickBreakevenCommitSubject.next(e)};pickTrailingStop=async e=>{await this.pickTrailingStopSubject.next(e)};pickTrailingTake=async e=>{await this.pickTrailingTakeSubject.next(e)};pickActivateScheduled=async e=>{await this.pickActivateScheduledSubject.next(e)};pickAverageBuyCommit=async e=>{await this.pickAverageBuyCommitSubject.next(e)};pickSignalSyncOpen=async e=>{await this.pickSignalSyncOpenSubject.next(e)};pickSignalSyncClose=async e=>{await this.pickSignalSyncCloseSubject.next(e)};pickCancelScheduled=async e=>{await this.pickCancelScheduledSubject.next(e)};pickClosePending=async e=>{await this.pickClosePendingSubject.next(e)};pickDumpContent=async e=>{await this.pickDumpContentSubject.next(e)}}class LoggerService{reloadSubject=new ar;_enabled=!1;error=e=>{console.error(e)};log=(e,t)=>{this._enabled&&console.log(e,t)};setEnabled=e=>{this._enabled=e,this.reloadSubject.next()}}const basePathSet=new Set(["/error_page","/offline_page","/dashboard"]),browserHistory=CC_FORCE_BROWSER_HISTORY?jf():hI("router-service-path",{allowed:e=>!basePathSet.has(e),map:e=>basePathSet.has(e)?"/":e}),DEFAULT_PATH$l="/",ALLOWED_BACK_PATH=new Set(["/dashboard"]),lastBasePathManager=ip("router-service_lastBasePath");class RouterService{reloadSubject=new ar;location=browserHistory.location;action=browserHistory.action;get lastBasePath(){return lastBasePathManager.getValue()}set lastBasePath(e){lastBasePathManager.setValue(e)}subscribeLeave=e=>mr.create(e=>this.listen(({action:t})=>{"PUSH"===t&&e()})).once(e);get locationState(){return this.location.state?this.location.state:{}}get path(){var e;return(null==(e=this.location)?void 0:e.pathname)||DEFAULT_PATH$l}pushPreviousPath=e=>{ALLOWED_BACK_PATH.has(e)&&(this.lastBasePath=e)};updateState=()=>{this.location=browserHistory.location,this.action=browserHistory.action,this.reloadSubject.next()};createHref=e=>{const t=browserHistory.createHref(e);return this.updateState(),t};push=(e,t)=>{const n="string"==typeof e?e:e.pathname;this.pushPreviousPath(this.location.pathname);const r=browserHistory.push({pathname:n,search:window.location.search,hash:window.location.hash},t||this.locationState);return this.updateState(),r};replace=(e,t)=>{const n="string"==typeof e?e:e.pathname;this.pushPreviousPath(this.location.pathname);const r=browserHistory.replace({pathname:n,search:window.location.search,hash:window.location.hash},t||this.locationState);return this.updateState(),r};go=e=>{const t=browserHistory.go(e);return this.updateState(),t};back=()=>{if(this.lastBasePath){const e=browserHistory.push({pathname:this.lastBasePath,search:window.location.search,hash:window.location.hash});return this.lastBasePath=null,this.updateState(),e}const e=browserHistory.back();return this.updateState(),e};forward=()=>{const e=browserHistory.forward();return this.updateState(),e};listen=e=>{const t=browserHistory.listen(e);return this.updateState(),t};block=e=>{const t=browserHistory.block(e);return this.updateState(),t};prefetch=so(async()=>{basePathSet.has(browserHistory.location.pathname)&&browserHistory.push("/")})}const byteToHex=[];for(let Wp=0;Wp<256;++Wp)byteToHex.push((Wp+256).toString(16).slice(1));function unsafeStringify(e,t=0){return(byteToHex[e[t+0]]+byteToHex[e[t+1]]+byteToHex[e[t+2]]+byteToHex[e[t+3]]+"-"+byteToHex[e[t+4]]+byteToHex[e[t+5]]+"-"+byteToHex[e[t+6]]+byteToHex[e[t+7]]+"-"+byteToHex[e[t+8]]+byteToHex[e[t+9]]+"-"+byteToHex[e[t+10]]+byteToHex[e[t+11]]+byteToHex[e[t+12]]+byteToHex[e[t+13]]+byteToHex[e[t+14]]+byteToHex[e[t+15]]).toLowerCase()}let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");getRandomValues=crypto.getRandomValues.bind(crypto)}return getRandomValues(rnds8)}const randomUUID="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native={randomUUID:randomUUID};function v4(e,t,n){var r;if(native.randomUUID&&!e)return native.randomUUID();const o=(e=e||{}).random??(null==(r=e.rng)?void 0:r.call(e))??rng();if(o.length<16)throw new Error("Random bytes length must be >= 16");return o[6]=15&o[6]|64,o[8]=63&o[8]|128,unsafeStringify(o)}class AlertService{reloadSubject=new ar;_alerts=[];get current(){return this._alerts.length?this._alerts[0]:null}hideCurrent=()=>{this._alerts.length>0&&this._alerts.shift(),this.reloadSubject.next()};notify=(e,t=!1)=>{this.hideCurrent(),this._alerts.push({key:v4(),pin:t,message:e}),this.reloadSubject.next()}}class LinkService{loggerService=YS(TYPES.loggerService);routerService=YS(TYPES.routerService);layoutService=YS(TYPES.layoutService);openLink=async e=>{this.loggerService.log("linkService openLink",{href:e});let t=null;if(t=fL("/pick-dump-search/:search",e))return await this.layoutService.closeModal(),void this.routerService.push(`/dump/${t.params.search}`);(t=fL("/pick-signal/:signalId",e))?this.layoutService.pickSignal(t.params.signalId):(t=fL("/pick-risk/:notificationId",e))?this.layoutService.pickRisk(t.params.notificationId):(t=fL("/pick-dump-content/:sessionId",e))?this.layoutService.pickDumpContent(t.params.sessionId):(t=fL("/pick-signal-opened/:notificationId",e))?this.layoutService.pickSignalOpened(t.params.notificationId):(t=fL("/pick-signal-closed/:notificationId",e))?this.layoutService.pickSignalClosed(t.params.notificationId):(t=fL("/pick-signal-scheduled/:notificationId",e))?this.layoutService.pickSignalScheduled(t.params.notificationId):(t=fL("/pick-signal-cancelled/:notificationId",e))?this.layoutService.pickSignalCancelled(t.params.notificationId):(t=fL("/pick-signal-sync-open/:notificationId",e))?this.layoutService.pickSignalSyncOpen(t.params.notificationId):(t=fL("/pick-signal-sync-close/:notificationId",e))?this.layoutService.pickSignalSyncClose(t.params.notificationId):(t=fL("/pick-activate-scheduled/:notificationId",e))?this.layoutService.pickActivateScheduled(t.params.notificationId):(t=fL("/pick-average-buy-commit/:notificationId",e))?this.layoutService.pickAverageBuyCommit(t.params.notificationId):(t=fL("/pick-cancel-scheduled/:notificationId",e))?this.layoutService.pickCancelScheduled(t.params.notificationId):(t=fL("/pick-close-pending/:notificationId",e))?this.layoutService.pickClosePending(t.params.notificationId):(t=fL("/pick-partial-loss-available/:notificationId",e))?this.layoutService.pickPartialLossAvailable(t.params.notificationId):(t=fL("/pick-partial-loss-commit/:notificationId",e))?this.layoutService.pickPartialLossCommit(t.params.notificationId):(t=fL("/pick-partial-profit-available/:notificationId",e))?this.layoutService.pickPartialProfitAvailable(t.params.notificationId):(t=fL("/pick-partial-profit-commit/:notificationId",e))?this.layoutService.pickPartialProfitCommit(t.params.notificationId):(t=fL("/pick-breakeven-available/:notificationId",e))?this.layoutService.pickBreakevenAvailable(t.params.notificationId):(t=fL("/pick-breakeven-commit/:notificationId",e))?this.layoutService.pickBreakevenCommit(t.params.notificationId):(t=fL("/pick-trailing-stop/:notificationId",e))?this.layoutService.pickTrailingStop(t.params.notificationId):(t=fL("/pick-trailing-take/:notificationId",e))?this.layoutService.pickTrailingTake(t.params.notificationId):ak(e)}}class ExchangeMockService{loggerService=YS(TYPES.loggerService);getSignalCandles=async(e,t)=>{this.loggerService.log("exchangeMockService getSignalCandles",{signalId:e,interval:t});const{data:n,error:r}=await Mf("/api/v1/mock/candles_signal",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),signalId:e,interval:t})});if(r)throw new Error(r);return n};getPointCandles=async e=>{this.loggerService.log("exchangeMockService getPointCandles",{dto:e});const{data:t,error:n}=await Mf("/api/v1/mock/candles_point",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),...e})});if(n)throw new Error(n);return t};getLiveCandles=async(e,t)=>{this.loggerService.log("exchangeMockService getLiveCandles",{signalId:e,interval:t});const{data:n,error:r}=await Mf("/api/v1/mock/candles_live",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),signalId:e,interval:t})});if(r)throw new Error(r);return n};getLastCandles=async(e,t)=>{this.loggerService.log("exchangeMockService getLastCandles",{symbol:e,interval:t});const{data:n,error:r}=await Mf("/api/v1/mock/candles_last",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,interval:t})});if(r)throw new Error(r);return n};getRangeCandles=async e=>{this.loggerService.log("exchangeMockService getRangeCandles",{dto:e});const{data:t,error:n}=await Mf("/api/v1/mock/candles_range",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),...e})});if(n)throw new Error(n);return t}}class NotificationMockService{loggerService=YS(TYPES.loggerService);getList=async()=>{this.loggerService.log("notificationMockService getList");const{data:e,error:t}=await Mf("/api/v1/mock/notification_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getOne=async e=>{this.loggerService.log("notificationMockService getOne",{id:e});const{data:t,error:n}=await Mf(`/api/v1/mock/notification_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};findByFilter=async(e,t,n)=>{this.loggerService.log("notificationMockService findByFilter",{filterData:e,limit:t,offset:n});const{data:r,error:o}=await Mf("/api/v1/mock/notification_filter",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),filterData:e,limit:t,offset:n})});if(o)throw new Error(o);return r}}class StorageMockService{loggerService=YS(TYPES.loggerService);findSignalById=async e=>{this.loggerService.log("storageMockService findSignalById",{signalId:e});const{data:t,error:n}=await Mf(`/api/v1/mock/storage_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};listSignalLive=async()=>{this.loggerService.log("storageMockService listSignalLive");const{data:e,error:t}=await Mf("/api/v1/mock/storage_list/live",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};listSignalBacktest=async()=>{this.loggerService.log("storageMockService listSignalBacktest");const{data:e,error:t}=await Mf("/api/v1/mock/storage_list/backtest",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e}}class LogMockService{loggerService=YS(TYPES.loggerService);getList=async()=>{this.loggerService.log("logMockService getList");const{data:e,error:t}=await Mf("/api/v1/mock/log_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getOne=async e=>{this.loggerService.log("logMockService getOne",{id:e});const{data:t,error:n}=await Mf(`/api/v1/mock/log_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};findByFilter=async(e,t,n)=>{this.loggerService.log("logMockService findByFilter",{filterData:e,limit:t,offset:n});const{data:r,error:o}=await Mf("/api/v1/mock/log_filter",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),filterData:e,limit:t,offset:n})});if(o)throw new Error(o);return r}}class StatusMockService{loggerService=YS(TYPES.loggerService);getStatusList=async()=>{this.loggerService.log("statusMockService getStatusList");const{data:e,error:t}=await Mf("/api/v1/mock/status_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getStatusMap=async()=>{this.loggerService.log("statusMockService getStatusMap");return(await this.getStatusList()).reduce((e,t)=>({...e,[t.id]:t}),{})};getStatusOne=async e=>{this.loggerService.log("statusMockService getStatusOne",{id:e});const{data:t,error:n}=await Mf(`/api/v1/mock/status_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};getStatusInfo=async()=>{this.loggerService.log("statusMockService getStatusInfo");const{data:e,error:t}=await Mf("/api/v1/mock/status_info",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e}}class MarkdownMockService{loggerService=YS(TYPES.loggerService);getStrategyData=async(e,t,n,r)=>{this.loggerService.log("markdownMockService getStrategyData",{symbol:e,strategyName:t,exchangeName:n,frameName:r});const{data:o,error:i}=await Mf("/api/v1/markdown_mock/strategy_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r})});if(i)throw new Error(i);return o};getStrategyReport=async(e,t,n,r)=>{this.loggerService.log("markdownMockService getStrategyReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r});const{data:o,error:i}=await Mf("/api/v1/markdown_mock/strategy_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r})});if(i)throw new Error(i);return o};getBacktestData=async(e,t,n,r)=>{this.loggerService.log("markdownMockService getBacktestData",{symbol:e,strategyName:t,exchangeName:n,frameName:r});const{data:o,error:i}=await Mf("/api/v1/markdown_mock/backtest_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r})});if(i)throw new Error(i);return o};getBacktestReport=async(e,t,n,r)=>{this.loggerService.log("markdownMockService getBacktestReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r});const{data:o,error:i}=await Mf("/api/v1/markdown_mock/backtest_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r})});if(i)throw new Error(i);return o};getLiveData=async(e,t,n)=>{this.loggerService.log("markdownMockService getLiveData",{symbol:e,strategyName:t,exchangeName:n});const{data:r,error:o}=await Mf("/api/v1/markdown_mock/live_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n})});if(o)throw new Error(o);return r};getLiveReport=async(e,t,n)=>{this.loggerService.log("markdownMockService getLiveReport",{symbol:e,strategyName:t,exchangeName:n});const{data:r,error:o}=await Mf("/api/v1/markdown_mock/live_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n})});if(o)throw new Error(o);return r};getBreakevenData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getBreakevenData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/breakeven_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getBreakevenReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getBreakevenReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/breakeven_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getRiskData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getRiskData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/risk_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getRiskReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getRiskReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/risk_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPartialData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getPartialData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/partial_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPartialReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getPartialReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/partial_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getHighestProfitData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getHighestProfitData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/highest_profit_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getHighestProfitReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getHighestProfitReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/highest_profit_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getMaxDrawdownData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getMaxDrawdownData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/max_drawdown_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getMaxDrawdownReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getMaxDrawdownReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/max_drawdown_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getScheduleData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getScheduleData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/schedule_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getScheduleReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getScheduleReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/schedule_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPerformanceData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getPerformanceData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/performance_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPerformanceReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getPerformanceReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/performance_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getSyncData=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getSyncData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/sync_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getSyncReport=async(e,t,n,r,o=!1)=>{this.loggerService.log("markdownMockService getSyncReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/markdown_mock/sync_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getHeatData=async(e,t,n,r=!1)=>{this.loggerService.log("markdownMockService getHeatData",{strategyName:e,exchangeName:t,frameName:n,backtest:r});const{data:o,error:i}=await Mf("/api/v1/markdown_mock/heat_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),strategyName:e,exchangeName:t,frameName:n,backtest:r})});if(i)throw new Error(i);return o};getHeatReport=async(e,t,n,r=!1)=>{this.loggerService.log("markdownMockService getHeatReport",{strategyName:e,exchangeName:t,frameName:n,backtest:r});const{data:o,error:i}=await Mf("/api/v1/markdown_mock/heat_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),strategyName:e,exchangeName:t,frameName:n,backtest:r})});if(i)throw new Error(i);return o};getWalkerData=async(e,t)=>{this.loggerService.log("markdownMockService getWalkerData",{symbol:e,walkerName:t});const{data:n,error:r}=await Mf("/api/v1/markdown_mock/walker_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,walkerName:t})});if(r)throw new Error(r);return n};getWalkerReport=async(e,t)=>{this.loggerService.log("markdownMockService getWalkerReport",{symbol:e,walkerName:t});const{data:n,error:r}=await Mf("/api/v1/markdown_mock/walker_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,walkerName:t})});if(r)throw new Error(r);return n}}const TTL_TIMEOUT$3=45e3;class ExplorerMockService{loggerService=YS(TYPES.loggerService);explorerHelperService=YS(TYPES.explorerHelperService);getFolderTree=CC(async()=>{this.loggerService.log("explorerMockService getFolderTree");const{data:e,error:t}=await Mf("/api/v1/explorer_mock/tree",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e},{timeout:TTL_TIMEOUT$3});getFolderMap=CC(async()=>{this.loggerService.log("explorerMockService getFolderMap");const e={},t=await this.getFolderTree();for(const n of this.explorerHelperService.deepFlat(t))e[n.id]=n;return e},{timeout:TTL_TIMEOUT$3});getFileContent=async e=>{this.loggerService.log("explorerMockService getFileContent",{path:e});const{data:t,error:n}=await Mf("/api/v1/explorer_mock/node",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),path:e})});if(n)throw new Error(n);return t};getFileInfo=async e=>{this.loggerService.log("explorerMockService getFileInfo",{id:e});const t=(await this.getFolderMap())[e];if(!t)throw new Error(`explorerMockService getFileInfo file not found id=${e}`);if("file"!==t.type)throw new Error(`explorerMockService getFileInfo not a file id=${e} type=${t.type}`);return t};clear=()=>{this.loggerService.log("explorerMockService clear"),this.getFolderTree.clear(),this.getFolderMap.clear()}}class SignalMockService{loggerService=YS(TYPES.loggerService);getLastUpdateTimestamp=async e=>{this.loggerService.log("signalMockService getLastUpdateTimestamp",{signalId:e});const{data:t,error:n}=await Mf(`/api/v1/mock/signal_last_update/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};getPendingSignal=async e=>{this.loggerService.log("signalMockService getPendingSignal",{symbol:e});const{data:t,error:n}=await Mf("/api/v1/mock/signal_pending",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e})});if(n)throw new Error(n);return t}}class HeatMockService{loggerService=YS(TYPES.loggerService);getStrategyHeatData=async()=>{this.loggerService.log("heatMockService getStrategyHeatData");const{data:e,error:t}=await Mf("/api/v1/mock/heat_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getStrategyHeatReport=async()=>{this.loggerService.log("heatMockService getStrategyHeatReport");const{data:e,error:t}=await Mf("/api/v1/mock/heat_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e}}class ExchangeViewService{loggerService=YS(TYPES.loggerService);exchangeMockService=YS(TYPES.exchangeMockService);getSignalCandles=async(e,t)=>{if(this.loggerService.log("exchangeViewService getSignalCandles",{signalId:e,interval:t}),CC_ENABLE_MOCK)return await this.exchangeMockService.getSignalCandles(e,t);const{data:n,error:r}=await Mf("/api/v1/view/candles_signal",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),signalId:e,interval:t})});if(r)throw new Error(r);return n};getPointCandles=async e=>{if(this.loggerService.log("exchangeViewService getPointCandles",{dto:e}),CC_ENABLE_MOCK)return await this.exchangeMockService.getPointCandles(e);const{data:t,error:n}=await Mf("/api/v1/view/candles_point",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),...e})});if(n)throw new Error(n);return t};getLiveCandles=async(e,t)=>{if(this.loggerService.log("exchangeViewService getLiveCandles",{signalId:e,interval:t}),CC_ENABLE_MOCK)return await this.exchangeMockService.getLiveCandles(e,t);const{data:n,error:r}=await Mf("/api/v1/view/candles_live",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),signalId:e,interval:t})});if(r)throw new Error(r);return n};getLastCandles=async(e,t)=>{if(this.loggerService.log("exchangeViewService getLastCandles",{symbol:e,interval:t}),CC_ENABLE_MOCK)return await this.exchangeMockService.getLastCandles(e,t);const{data:n,error:r}=await Mf("/api/v1/view/candles_last",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,interval:t})});if(r)throw new Error(r);return n};getRangeCandles=async e=>{if(this.loggerService.log("exchangeViewService getRangeCandles",{dto:e}),CC_ENABLE_MOCK)return await this.exchangeMockService.getRangeCandles(e);const{data:t,error:n}=await Mf("/api/v1/view/candles_range",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),...e})});if(n)throw new Error(n);return t}}class NotificationViewService{loggerService=YS(TYPES.loggerService);notificationMockService=YS(TYPES.notificationMockService);getList=async()=>{if(this.loggerService.log("notificationViewService getList"),CC_ENABLE_MOCK)return await this.notificationMockService.getList();const{data:e,error:t}=await Mf("/api/v1/view/notification_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getOne=async e=>{if(this.loggerService.log("notificationViewService getOne",{id:e}),CC_ENABLE_MOCK)return await this.notificationMockService.getOne(e);const{data:t,error:n}=await Mf(`/api/v1/view/notification_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};findByFilter=async(e,t,n)=>{if(this.loggerService.log("notificationViewService findByFilter",{filterData:e,limit:t,offset:n}),CC_ENABLE_MOCK)return await this.notificationMockService.findByFilter(e,t,n);const{data:r,error:o}=await Mf("/api/v1/view/notification_filter",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),filterData:e,limit:t,offset:n})});if(o)throw new Error(o);return r}}class StorageViewService{loggerService=YS(TYPES.loggerService);storageMockService=YS(TYPES.storageMockService);findSignalById=async e=>{if(this.loggerService.log("storageViewService findSignalById",{signalId:e}),CC_ENABLE_MOCK)return await this.storageMockService.findSignalById(e);const{data:t,error:n}=await Mf(`/api/v1/view/storage_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};listSignalLive=async()=>{if(this.loggerService.log("storageViewService listSignalLive"),CC_ENABLE_MOCK)return await this.storageMockService.listSignalLive();const{data:e,error:t}=await Mf("/api/v1/view/storage_list/live",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};listSignalBacktest=async()=>{if(this.loggerService.log("storageViewService listSignalBacktest"),CC_ENABLE_MOCK)return await this.storageMockService.listSignalBacktest();const{data:e,error:t}=await Mf("/api/v1/view/storage_list/backtest",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e}}class LogViewService{loggerService=YS(TYPES.loggerService);logMockService=YS(TYPES.logMockService);getList=async()=>{if(this.loggerService.log("logViewService getList"),CC_ENABLE_MOCK)return await this.logMockService.getList();const{data:e,error:t}=await Mf("/api/v1/view/log_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getOne=async e=>{if(this.loggerService.log("logViewService getOne",{id:e}),CC_ENABLE_MOCK)return await this.logMockService.getOne(e);const{data:t,error:n}=await Mf(`/api/v1/view/log_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};findByFilter=async(e,t,n)=>{if(this.loggerService.log("logViewService findByFilter",{filterData:e,limit:t,offset:n}),CC_ENABLE_MOCK)return await this.logMockService.findByFilter(e,t,n);const{data:r,error:o}=await Mf("/api/v1/view/log_filter",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),filterData:e,limit:t,offset:n})});if(o)throw new Error(o);return r}}const TTL_TIMEOUT$2=45e3;class StatusViewService{loggerService=YS(TYPES.loggerService);statusMockService=YS(TYPES.statusMockService);getStatusList=async()=>{if(this.loggerService.log("statusViewService getStatusList"),CC_ENABLE_MOCK)return await this.statusMockService.getStatusList();const{data:e,error:t}=await Mf("/api/v1/view/status_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getStatusMap=async()=>{if(this.loggerService.log("statusViewService getStatusMap"),CC_ENABLE_MOCK)return await this.statusMockService.getStatusMap();return(await this.getStatusList()).reduce((e,t)=>({...e,[t.id]:t}),{})};getStatusOne=async e=>{if(this.loggerService.log("statusViewService getStatusOne",{id:e}),CC_ENABLE_MOCK)return await this.statusMockService.getStatusOne(e);const{data:t,error:n}=await Mf(`/api/v1/view/status_one/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};getStatusInfo=CC(async()=>{if(this.loggerService.log("statusViewService getStatusInfo"),CC_ENABLE_MOCK)return await this.statusMockService.getStatusInfo();const{data:e,error:t}=await Mf("/api/v1/view/status_info",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e},{timeout:TTL_TIMEOUT$2})}class MarkdownViewService{loggerService=YS(TYPES.loggerService);markdownMockService=YS(TYPES.markdownMockService);getStrategyData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getStrategyData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getStrategyData(e,t,n,r);const{data:i,error:a}=await Mf("/api/v1/markdown_view/strategy_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getStrategyReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getStrategyReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getStrategyReport(e,t,n,r);const{data:i,error:a}=await Mf("/api/v1/markdown_view/strategy_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getBacktestData=async(e,t,n,r)=>{if(this.loggerService.log("markdownViewService getBacktestData",{symbol:e,strategyName:t,exchangeName:n,frameName:r}),CC_ENABLE_MOCK)return await this.markdownMockService.getBacktestData(e,t,n,r);const{data:o,error:i}=await Mf("/api/v1/markdown_view/backtest_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r})});if(i)throw new Error(i);return o};getBacktestReport=async(e,t,n,r)=>{if(this.loggerService.log("markdownViewService getBacktestReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r}),CC_ENABLE_MOCK)return await this.markdownMockService.getBacktestReport(e,t,n,r);const{data:o,error:i}=await Mf("/api/v1/markdown_view/backtest_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r})});if(i)throw new Error(i);return o};getLiveData=async(e,t,n)=>{if(this.loggerService.log("markdownViewService getLiveData",{symbol:e,strategyName:t,exchangeName:n}),CC_ENABLE_MOCK)return await this.markdownMockService.getLiveData(e,t,n);const{data:r,error:o}=await Mf("/api/v1/markdown_view/live_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n})});if(o)throw new Error(o);return r};getLiveReport=async(e,t,n)=>{if(this.loggerService.log("markdownViewService getLiveReport",{symbol:e,strategyName:t,exchangeName:n}),CC_ENABLE_MOCK)return await this.markdownMockService.getLiveReport(e,t,n);const{data:r,error:o}=await Mf("/api/v1/markdown_view/live_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n})});if(o)throw new Error(o);return r};getBreakevenData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getBreakevenData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getBreakevenData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/breakeven_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getBreakevenReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getBreakevenReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getBreakevenReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/breakeven_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getRiskData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getRiskData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getRiskData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/risk_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getRiskReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getRiskReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getRiskReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/risk_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPartialData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getPartialData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getPartialData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/partial_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPartialReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getPartialReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getPartialReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/partial_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getHighestProfitData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getHighestProfitData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getHighestProfitData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/highest_profit_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getHighestProfitReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getHighestProfitReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getHighestProfitReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/highest_profit_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getMaxDrawdownData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getMaxDrawdownData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getMaxDrawdownData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/max_drawdown_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getMaxDrawdownReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getMaxDrawdownReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getMaxDrawdownReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/max_drawdown_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getScheduleData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getScheduleData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getScheduleData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/schedule_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getScheduleReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getScheduleReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getScheduleReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/schedule_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPerformanceData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getPerformanceData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getPerformanceData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/performance_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getPerformanceReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getPerformanceReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getPerformanceReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/performance_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getSyncData=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getSyncData",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getSyncData(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/sync_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getSyncReport=async(e,t,n,r,o=!1)=>{if(this.loggerService.log("markdownViewService getSyncReport",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o}),CC_ENABLE_MOCK)return await this.markdownMockService.getSyncReport(e,t,n,r,o);const{data:i,error:a}=await Mf("/api/v1/markdown_view/sync_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i};getHeatData=async(e,t,n,r=!1)=>{if(this.loggerService.log("markdownViewService getHeatData",{strategyName:e,exchangeName:t,frameName:n,backtest:r}),CC_ENABLE_MOCK)return await this.markdownMockService.getHeatData(e,t,n,r);const{data:o,error:i}=await Mf("/api/v1/markdown_view/heat_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),strategyName:e,exchangeName:t,frameName:n,backtest:r})});if(i)throw new Error(i);return o};getHeatReport=async(e,t,n,r=!1)=>{if(this.loggerService.log("markdownViewService getHeatReport",{strategyName:e,exchangeName:t,frameName:n,backtest:r}),CC_ENABLE_MOCK)return await this.markdownMockService.getHeatReport(e,t,n,r);const{data:o,error:i}=await Mf("/api/v1/markdown_view/heat_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),strategyName:e,exchangeName:t,frameName:n,backtest:r})});if(i)throw new Error(i);return o};getWalkerData=async(e,t)=>{if(this.loggerService.log("markdownViewService getWalkerData",{symbol:e,walkerName:t}),CC_ENABLE_MOCK)return await this.markdownMockService.getWalkerData(e,t);const{data:n,error:r}=await Mf("/api/v1/markdown_view/walker_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,walkerName:t})});if(r)throw new Error(r);return n};getWalkerReport=async(e,t)=>{if(this.loggerService.log("markdownViewService getWalkerReport",{symbol:e,walkerName:t}),CC_ENABLE_MOCK)return await this.markdownMockService.getWalkerReport(e,t);const{data:n,error:r}=await Mf("/api/v1/markdown_view/walker_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,walkerName:t})});if(r)throw new Error(r);return n}}const TTL_TIMEOUT$1=45e3;class ExplorerViewService{loggerService=YS(TYPES.loggerService);explorerMockService=YS(TYPES.explorerMockService);explorerHelperService=YS(TYPES.explorerHelperService);getFolderTree=CC(async()=>{if(this.loggerService.log("explorerViewService getFolderTreeRaw"),CC_ENABLE_MOCK)return await this.explorerMockService.getFolderTree();const{data:e,error:t}=await Mf("/api/v1/explorer_view/tree",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e},{timeout:TTL_TIMEOUT$1});getFolderMap=CC(async()=>{if(this.loggerService.log("explorerViewService getFolderMap"),CC_ENABLE_MOCK)return await this.explorerMockService.getFolderMap();const e={},t=await this.getFolderTree();for(const n of this.explorerHelperService.deepFlat(t))e[n.id]=n;return e},{timeout:TTL_TIMEOUT$1});getFileContent=async e=>{if(this.loggerService.log("explorerViewService getFileContent",{path:e}),CC_ENABLE_MOCK)return await this.explorerMockService.getFileContent(e);const{data:t,error:n}=await Mf("/api/v1/explorer_view/node",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),path:e})});if(n)throw new Error(n);return t};getFileInfo=async e=>{if(this.loggerService.log("explorerViewService getFileInfo",{id:e}),CC_ENABLE_MOCK)return await this.explorerMockService.getFileInfo(e);const t=(await this.getFolderMap())[e];if(!t)throw new Error(`explorerViewService getFileInfo file not found id=${e}`);if("file"!==t.type)throw new Error(`explorerViewService getFileInfo not a file id=${e} type=${t.type}`);return t};clear=()=>{this.loggerService.log("explorerViewService clear"),CC_ENABLE_MOCK&&this.explorerMockService.clear(),this.getFolderTree.clear()}}class SignalViewService{loggerService=YS(TYPES.loggerService);signalMockService=YS(TYPES.signalMockService);getLastUpdateTimestamp=async e=>{if(this.loggerService.log("signalViewService getLastUpdateTimestamp",{signalId:e}),CC_ENABLE_MOCK)return await this.signalMockService.getLastUpdateTimestamp(e);const{data:t,error:n}=await Mf(`/api/v1/view/signal_last_update/${e}`,{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(n)throw new Error(n);return t};getPendingSignal=async e=>{if(this.loggerService.log("signalViewService getPendingSignal",{symbol:e}),CC_ENABLE_MOCK)return await this.signalMockService.getPendingSignal(e);const{data:t,error:n}=await Mf("/api/v1/view/signal_pending",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e})});if(n)throw new Error(n);return t}}const TTL_TIMEOUT=45e3;class HeatViewService{loggerService=YS(TYPES.loggerService);heatMockService=YS(TYPES.heatMockService);getStrategyHeatData=CC(async()=>{if(this.loggerService.log("heatViewService getStrategyHeatData"),CC_ENABLE_MOCK)return await this.heatMockService.getStrategyHeatData();const{data:e,error:t}=await Mf("/api/v1/view/heat_data",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e},{timeout:TTL_TIMEOUT});getStrategyHeatReport=CC(async()=>{if(this.loggerService.log("heatViewService getStrategyHeatReport"),CC_ENABLE_MOCK)return await this.heatMockService.getStrategyHeatReport();const{data:e,error:t}=await Mf("/api/v1/view/heat_report",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e},{timeout:TTL_TIMEOUT})}class SymbolGlobalService{loggerService=YS(TYPES.loggerService);getSymbolList=async()=>{this.loggerService.log("symbolGlobalService getSymbolList");const{data:e,error:t}=await Mf("/api/v1/dict/symbol/list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getSymbolMap=async()=>{this.loggerService.log("symbolGlobalService getSymbolMap");const{data:e,error:t}=await Mf("/api/v1/dict/symbol/map",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e};getSymbol=async e=>{this.loggerService.log("symbolGlobalService getSymbol",{symbol:e});const{data:t,error:n}=await Mf("/api/v1/dict/symbol/one",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),id:e})});if(n)throw new Error(n);return t}}class PriceGlobalService{loggerService=YS(TYPES.loggerService);getSignalPendingPrice=async(e,t,n,r,o)=>{this.loggerService.log("priceGlobalService getSignalPendingPrice",{symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o});const{data:i,error:a}=await Mf("/api/v1/global/signal_pending_price",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr(),symbol:e,strategyName:t,exchangeName:n,frameName:r,backtest:o})});if(a)throw new Error(a);return i}}class BacktestGlobalService{loggerService=YS(TYPES.loggerService);list=async()=>{this.loggerService.log("backtestGlobalService list");const{data:e,error:t}=await Mf("/api/v1/global/backtest_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e}}class LiveGlobalService{loggerService=YS(TYPES.loggerService);list=async()=>{this.loggerService.log("liveGlobalService list");const{data:e,error:t}=await Mf("/api/v1/global/live_list",{method:"POST",body:JSON.stringify({clientId:CC_CLIENT_ID,serviceName:CC_SERVICE_NAME,userId:CC_USER_ID,requestId:Gr()})});if(t)throw new Error(t);return e}}var html2pdf$1={exports:{}};const scriptRel="modulepreload",assetsURL=function(e){return"/"+e},seen={},__vitePreload=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const e=document.querySelector("meta[property=csp-nonce]"),n=(null==e?void 0:e.nonce)||(null==e?void 0:e.getAttribute("nonce"));r=Promise.allSettled(t.map(e=>{if((e=assetsURL(e))in seen)return;seen[e]=!0;const t=e.endsWith(".css"),r=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${r}`))return;const o=document.createElement("link");return o.rel=t?"stylesheet":scriptRel,t||(o.as="script"),o.crossOrigin="",o.href=e,n&&o.setAttribute("nonce",n),document.head.appendChild(o),t?new Promise((t,n)=>{o.addEventListener("load",t),o.addEventListener("error",()=>n(new Error(`Unable to preload CSS for ${e}`)))}):void 0}))}function o(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(const e of t||[])"rejected"===e.status&&o(e.reason);return e().catch(o)})};function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var u8=Uint8Array,u16=Uint16Array,i32=Int32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(e,t){for(var n=new u16(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new i32(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return{b:n,r:o}},_a$1=freb(fleb,2),fl=_a$1.b,revfl=_a$1.r;fl[28]=258,revfl[258]=28;for(var _b=freb(fdeb,0),revfd=_b.r,rev=new u16(32768),i$3=0;i$3<32768;++i$3){var x$4=(43690&i$3)>>1|(21845&i$3)<<1;x$4=(52428&x$4)>>2|(13107&x$4)<<2,x$4=(61680&x$4)>>4|(3855&x$4)<<4,rev[i$3]=((65280&x$4)>>8|(255&x$4)<<8)>>1}for(var hMap=function(e,t,n){for(var r=e.length,o=0,i=new u16(t);o<r;++o)e[o]&&++i[e[o]-1];var a,s=new u16(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(n){a=new u16(1<<t);var l=15-t;for(o=0;o<r;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],d=s[e[o]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)a[rev[d]>>l]=c}else for(a=new u16(r),o=0;o<r;++o)e[o]&&(a[o]=rev[s[e[o]-1]++]>>15-e[o]);return a},flt=new u8(288),i$3=0;i$3<144;++i$3)flt[i$3]=8;for(var i$3=144;i$3<256;++i$3)flt[i$3]=9;for(var i$3=256;i$3<280;++i$3)flt[i$3]=7;for(var i$3=280;i$3<288;++i$3)flt[i$3]=8;for(var fdt=new u8(32),i$3=0;i$3<32;++i$3)fdt[i$3]=5;var flm=hMap(flt,9,0),fdm=hMap(fdt,5,0),shft=function(e){return(e+7)/8|0},slc=function(e,t,n){return(null==n||n>e.length)&&(n=e.length),new u8(e.subarray(t,n))},wbits=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},wbits16=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},hTree=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,i=n.slice();if(!o)return{t:et$2,l:0};if(1==o){var a=new u8(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=o-1;)s=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:s.f+l.f,l:s,r:l};var p=i[0].s;for(r=1;r<o;++r)i[r].s>p&&(p=i[r].s);var h=new u16(p+1),f=ln$1(n[u-1],h,0);if(f>t){r=0;var A=0,m=f-t,g=1<<m;for(i.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});r<o;++r){var y=i[r].s;if(!(h[y]>t))break;A+=g-(1<<f-h[y]),h[y]=t}for(A>>=m;A>0;){var v=i[r].s;h[v]<t?A-=1<<t-h[v]++-1:++r}for(;r>=0&&A;--r){var b=i[r].s;h[b]==t&&(--h[b],++A)}f=t}return{t:new u8(h),l:f}},ln$1=function(e,t,n){return-1==e.s?Math.max(ln$1(e.l,t,n+1),ln$1(e.r,t,n+1)):t[e.s]=n},lc=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new u16(++t),r=0,o=e[0],i=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return{c:n.subarray(0,r),n:t}},clen=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},wfblk=function(e,t,n){var r=n.length,o=shft(t+2);e[o]=255&r,e[o+1]=r>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<r;++i)e[o+i+4]=n[i];return 8*(o+4+r)},wblk=function(e,t,n,r,o,i,a,s,l,c,u){wbits(t,u++,n),++o[256];for(var d=hTree(o,15),p=d.t,h=d.l,f=hTree(i,15),A=f.t,m=f.l,g=lc(p),y=g.c,v=g.n,b=lc(A),x=b.c,w=b.n,C=new u16(19),$=0;$<y.length;++$)++C[31&y[$]];for($=0;$<x.length;++$)++C[31&x[$]];for(var _=hTree(C,7),S=_.t,E=_.l,k=19;k>4&&!S[clim[k-1]];--k);var B,P,T,I,L=c+5<<3,M=clen(o,flt)+clen(i,fdt)+a,D=clen(o,p)+clen(i,A)+a+14+3*k+clen(C,S)+2*C[16]+3*C[17]+7*C[18];if(l>=0&&L<=M&&L<=D)return wfblk(t,u,e.subarray(l,l+c));if(wbits(t,u,1+(D<M)),u+=2,D<M){B=hMap(p,h,0),P=p,T=hMap(A,m,0),I=A;var N=hMap(S,E,0);wbits(t,u,v-257),wbits(t,u+5,w-1),wbits(t,u+10,k-4),u+=14;for($=0;$<k;++$)wbits(t,u+3*$,S[clim[$]]);u+=3*k;for(var F=[y,x],O=0;O<2;++O){var R=F[O];for($=0;$<R.length;++$){var U=31&R[$];wbits(t,u,N[U]),u+=S[U],U>15&&(wbits(t,u,R[$]>>5&127),u+=R[$]>>12)}}}else B=flm,P=flt,T=fdm,I=fdt;for($=0;$<s;++$){var j=r[$];if(j>255){wbits16(t,u,B[(U=j>>18&31)+257]),u+=P[U+257],U>7&&(wbits(t,u,j>>23&31),u+=fleb[U]);var H=31&j;wbits16(t,u,T[H]),u+=I[H],H>3&&(wbits16(t,u,j>>5&8191),u+=fdeb[H])}else wbits16(t,u,B[j]),u+=P[j]}return wbits16(t,u,B[256]),u+P[256]},deo=new i32([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),et$2=new u8(0),dflt=function(e,t,n,r,o,i){var a=i.z||e.length,s=new u8(r+a+5*(1+Math.ceil(a/7e3))+o),l=s.subarray(r,s.length-o),c=i.l,u=7&(i.r||0);if(t){u&&(l[0]=i.r>>3);for(var d=deo[t-1],p=d>>13,h=8191&d,f=(1<<n)-1,A=i.p||new u16(32768),m=i.h||new u16(f+1),g=Math.ceil(n/3),y=2*g,v=function(t){return(e[t]^e[t+1]<<g^e[t+2]<<y)&f},b=new i32(25e3),x=new u16(288),w=new u16(32),C=0,$=0,_=i.i||0,S=0,E=i.w||0,k=0;_+2<a;++_){var B=v(_),P=32767&_,T=m[B];if(A[P]=T,m[B]=P,E<=_){var I=a-_;if((C>7e3||S>24576)&&(I>423||!c)){u=wblk(e,l,0,b,x,w,$,S,k,_-k,u),S=C=$=0,k=_;for(var L=0;L<286;++L)x[L]=0;for(L=0;L<30;++L)w[L]=0}var M=2,D=0,N=h,F=P-T&32767;if(I>2&&B==v(_-F))for(var O=Math.min(p,I)-1,R=Math.min(32767,_),U=Math.min(258,I);F<=R&&--N&&P!=T;){if(e[_+M]==e[_+M-F]){for(var j=0;j<U&&e[_+j]==e[_+j-F];++j);if(j>M){if(M=j,D=F,j>O)break;var H=Math.min(F,j-2),Q=0;for(L=0;L<H;++L){var z=_-F+L&32767,V=z-A[z]&32767;V>Q&&(Q=V,T=z)}}}F+=(P=T)-(T=A[P])&32767}if(D){b[S++]=268435456|revfl[M]<<18|revfd[D];var W=31&revfl[M],Y=31&revfd[D];$+=fleb[W]+fdeb[Y],++x[257+W],++w[Y],E=_+M,++C}else b[S++]=e[_],++x[e[_]]}}for(_=Math.max(_,E);_<a;++_)b[S++]=e[_],++x[e[_]];u=wblk(e,l,c,b,x,w,$,S,k,_-k,u),c||(i.r=7&u|l[u/8|0]<<3,u-=7,i.h=m,i.p=A,i.i=_,i.w=E)}else{for(_=i.w||0;_<a+c;_+=65535){var G=_+65535;G>=a&&(l[u/8|0]=c,G=a),u=wfblk(l,u+1,e.subarray(_,G))}i.i=a}return slc(s,0,r+shft(u)+o)},adler=function(){var e=1,t=0;return{p:function(n){for(var r=e,o=t,i=0|n.length,a=0;a!=i;){for(var s=Math.min(a+2655,i);a<s;++a)o+=r+=n[a];r=(65535&r)+15*(r>>16),o=(65535&o)+15*(o>>16)}e=r,t=o},d:function(){return(255&(e%=65521))<<24|(65280&e)<<8|(255&(t%=65521))<<8|t>>8}}},dopt=function(e,t,n,r,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),a=new u8(i.length+e.length);a.set(i),a.set(e,i.length),e=a,o.w=i.length}return dflt(e,null==t.level?6:t.level,null==t.mem?o.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,n,r,o)},wbytes=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},zlh=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var o=adler();o.p(t.dictionary),wbytes(e,2,o.d())}};function zlibSync(e,t){t||(t={});var n=adler();n.p(e);var r=dopt(e,t,t.dictionary?6:2,4);return zlh(r,t),wbytes(r,r.length-4,n.d()),r}var td="undefined"!=typeof TextDecoder&&new TextDecoder,tds=0;try{td.decode(et$2,{stream:!0}),tds=1}catch(e2){}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function decode$5(e,t="utf8"){return new TextDecoder(t).decode(e)}const encoder=new TextEncoder;function encode$4(e){return encoder.encode(e)}const defaultByteLength=8192,hostBigEndian=(()=>{const e=new Uint8Array(4);return!((new Uint32Array(e.buffer)[0]=1)&e[0])})(),typedArrays={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class IOBuffer{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(e=defaultByteLength,t={}){let n=!1;"number"==typeof e?e=new ArrayBuffer(e):(n=!0,this.lastWrittenByte=e.byteLength);const r=t.offset?t.offset>>>0:0,o=e.byteLength-r;let i=r;(ArrayBuffer.isView(e)||e instanceof IOBuffer)&&(e.byteLength!==e.buffer.byteLength&&(i=e.byteOffset+r),e=e.buffer),this.lastWrittenByte=n?o:0,this.buffer=e,this.length=o,this.byteLength=o,this.byteOffset=i,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,i,o),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(void 0===e)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const t=2*(this.offset+e),n=new Uint8Array(t);n.set(new Uint8Array(this.buffer)),this.buffer=n.buffer,this.length=t,this.byteLength=t,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,t){const n=typedArrays[t].BYTES_PER_ELEMENT*e,r=this.byteOffset+this.offset,o=this.buffer.slice(r,r+n);if(this.littleEndian===hostBigEndian&&"uint8"!==t&&"int8"!==t){const e=new Uint8Array(this.buffer.slice(r,r+n));e.reverse();const o=new typedArrays[t](e.buffer);return this.offset+=n,o.reverse(),o}const i=new typedArrays[t](o);return this.offset+=n,i}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let t="";for(let n=0;n<e;n++)t+=this.readChar();return t}readUtf8(e=1){return decode$5(this.readBytes(e))}decodeText(e=1,t="utf8"){return decode$5(this.readBytes(e),t)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let t=0;t<e.length;t++)this.writeUint8(e.charCodeAt(t));return this}writeUtf8(e){return this.writeBytes(encode$4(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function zero$1(e){let t=e.length;for(;--t>=0;)e[t]=0}const MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,DIST_CODE_LEN=512,static_ltree=new Array(2*(L_CODES$1+2));zero$1(static_ltree);const static_dtree=new Array(2*D_CODES$1);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);const adler32=(e,t,n,r)=>{let o=65535&e,i=e>>>16&65535,a=0;for(;0!==n;){a=n>2e3?2e3:n,n-=a;do{o=o+t[r++]|0,i=i+o|0}while(--a);o%=65521,i%=65521}return o|i<<16};var adler32_1=adler32;const makeTable=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t},crcTable$1=new Uint32Array(makeTable()),crc32=(e,t,n,r)=>{const o=crcTable$1,i=r+n;e^=-1;for(let a=r;a<i;a++)e=e>>>8^o[255&(e^t[a])];return-1^e};var crc32_1=crc32,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},constants$2={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const _has=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var assign$3=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)_has(n,t)&&(e[t]=n[t])}}return e},flattenChunks=e=>{let t=0;for(let r=0,o=e.length;r<o;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,o=0,i=e.length;r<i;r++){let t=e[r];n.set(t,o),o+=t.length}return n},common={assign:assign$3,flattenChunks:flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(__){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let Wp=0;Wp<256;Wp++)_utf8len[Wp]=Wp>=252?6:Wp>=248?5:Wp>=240?4:Wp>=224?3:Wp>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,r,o,i,a=e.length,s=0;for(o=0;o<a;o++)n=e.charCodeAt(o),55296==(64512&n)&&o+1<a&&(r=e.charCodeAt(o+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),i=0,o=0;i<s;o++)n=e.charCodeAt(o),55296==(64512&n)&&o+1<a&&(r=e.charCodeAt(o+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),n<128?t[i++]=n:n<2048?(t[i++]=192|n>>>6,t[i++]=128|63&n):n<65536?(t[i++]=224|n>>>12,t[i++]=128|n>>>6&63,t[i++]=128|63&n):(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63,t[i++]=128|n>>>6&63,t[i++]=128|63&n);return t};const buf2binstring=(e,t)=>{if(t<65534&&e.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var buf2string=(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,o;const i=new Array(2*n);for(o=0,r=0;r<n;){let t=e[r++];if(t<128){i[o++]=t;continue}let a=_utf8len[t];if(a>4)i[o++]=65533,r+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&r<n;)t=t<<6|63&e[r++],a--;a>1?i[o++]=65533:t<65536?i[o++]=t:(t-=65536,i[o++]=55296|t>>10&1023,i[o++]=56320|1023&t)}}return buf2binstring(i,o)},utf8border=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+_utf8len[e[n]]>t?n:t},strings={string2buf:string2buf,buf2string:buf2string,utf8border:utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream;const BAD$1=16209,TYPE$1=16191;var inffast=function(e,t){let n,r,o,i,a,s,l,c,u,d,p,h,f,A,m,g,y,v,b,x,w,C,$,_;const S=e.state;n=e.next_in,$=e.input,r=n+(e.avail_in-5),o=e.next_out,_=e.output,i=o-(t-e.avail_out),a=o+(e.avail_out-257),s=S.dmax,l=S.wsize,c=S.whave,u=S.wnext,d=S.window,p=S.hold,h=S.bits,f=S.lencode,A=S.distcode,m=(1<<S.lenbits)-1,g=(1<<S.distbits)-1;e:do{h<15&&(p+=$[n++]<<h,h+=8,p+=$[n++]<<h,h+=8),y=f[p&m];t:for(;;){if(v=y>>>24,p>>>=v,h-=v,v=y>>>16&255,0===v)_[o++]=65535&y;else{if(!(16&v)){if(64&v){if(32&v){S.mode=TYPE$1;break e}e.msg="invalid literal/length code",S.mode=BAD$1;break e}y=f[(65535&y)+(p&(1<<v)-1)];continue t}for(b=65535&y,v&=15,v&&(h<v&&(p+=$[n++]<<h,h+=8),b+=p&(1<<v)-1,p>>>=v,h-=v),h<15&&(p+=$[n++]<<h,h+=8,p+=$[n++]<<h,h+=8),y=A[p&g];;){if(v=y>>>24,p>>>=v,h-=v,v=y>>>16&255,16&v){if(x=65535&y,v&=15,h<v&&(p+=$[n++]<<h,h+=8,h<v&&(p+=$[n++]<<h,h+=8)),x+=p&(1<<v)-1,x>s){e.msg="invalid distance too far back",S.mode=BAD$1;break e}if(p>>>=v,h-=v,v=o-i,x>v){if(v=x-v,v>c&&S.sane){e.msg="invalid distance too far back",S.mode=BAD$1;break e}if(w=0,C=d,0===u){if(w+=l-v,v<b){b-=v;do{_[o++]=d[w++]}while(--v);w=o-x,C=_}}else if(u<v){if(w+=l+u-v,v-=u,v<b){b-=v;do{_[o++]=d[w++]}while(--v);if(w=0,u<b){v=u,b-=v;do{_[o++]=d[w++]}while(--v);w=o-x,C=_}}}else if(w+=u-v,v<b){b-=v;do{_[o++]=d[w++]}while(--v);w=o-x,C=_}for(;b>2;)_[o++]=C[w++],_[o++]=C[w++],_[o++]=C[w++],b-=3;b&&(_[o++]=C[w++],b>1&&(_[o++]=C[w++]))}else{w=o-x;do{_[o++]=_[w++],_[o++]=_[w++],_[o++]=_[w++],b-=3}while(b>2);b&&(_[o++]=_[w++],b>1&&(_[o++]=_[w++]))}break}if(64&v){e.msg="invalid distance code",S.mode=BAD$1;break e}y=A[(65535&y)+(p&(1<<v)-1)]}}break}}while(n<r&&o<a);b=h>>3,n-=b,h-=b<<3,p&=(1<<h)-1,e.next_in=n,e.next_out=o,e.avail_in=n<r?r-n+5:5-(n-r),e.avail_out=o<a?a-o+257:257-(o-a),S.hold=p,S.bits=h};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),lext=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),dbase=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),dext=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),inflate_table=(e,t,n,r,o,i,a,s)=>{const l=s.bits;let c,u,d,p,h,f,A=0,m=0,g=0,y=0,v=0,b=0,x=0,w=0,C=0,$=0,_=null;const S=new Uint16Array(MAXBITS+1),E=new Uint16Array(MAXBITS+1);let k,B,P,T=null;for(A=0;A<=MAXBITS;A++)S[A]=0;for(m=0;m<r;m++)S[t[n+m]]++;for(v=l,y=MAXBITS;y>=1&&0===S[y];y--);if(v>y&&(v=y),0===y)return o[i++]=20971520,o[i++]=20971520,s.bits=1,0;for(g=1;g<y&&0===S[g];g++);for(v<g&&(v=g),w=1,A=1;A<=MAXBITS;A++)if(w<<=1,w-=S[A],w<0)return-1;if(w>0&&(e===CODES$1||1!==y))return-1;for(E[1]=0,A=1;A<MAXBITS;A++)E[A+1]=E[A]+S[A];for(m=0;m<r;m++)0!==t[n+m]&&(a[E[t[n+m]]++]=m);if(e===CODES$1?(_=T=a,f=20):e===LENS$1?(_=lbase,T=lext,f=257):(_=dbase,T=dext,f=0),$=0,m=0,A=g,h=i,b=v,x=0,d=-1,C=1<<v,p=C-1,e===LENS$1&&C>ENOUGH_LENS$1||e===DISTS$1&&C>ENOUGH_DISTS$1)return 1;for(;;){k=A-x,a[m]+1<f?(B=0,P=a[m]):a[m]>=f?(B=T[a[m]-f],P=_[a[m]-f]):(B=96,P=0),c=1<<A-x,u=1<<b,g=u;do{u-=c,o[h+($>>x)+u]=k<<24|B<<16|P}while(0!==u);for(c=1<<A-1;$&c;)c>>=1;if(0!==c?($&=c-1,$+=c):$=0,m++,0===--S[A]){if(A===y)break;A=t[n+a[m]]}if(A>v&&($&p)!==d){for(0===x&&(x=v),h+=g,b=A-x,w=1<<b;b+x<y&&(w-=S[b+x],!(w<=0));)b++,w<<=1;if(C+=1<<b,e===LENS$1&&C>ENOUGH_LENS$1||e===DISTS$1&&C>ENOUGH_DISTS$1)return 1;d=$&p,o[d]=v<<24|b<<16|h-i}}return 0!==$&&(o[h+$]=A-x<<24|64<<16),s.bits=v,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK:Z_BLOCK,Z_TREES:Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR:Z_BUF_ERROR,Z_DEFLATED:Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function InflateState(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const inflateStateCheck=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<HEAD||t.mode>SYNC?1:0},inflateResetKeep=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=HEAD,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(ENOUGH_LENS),t.distcode=t.distdyn=new Int32Array(ENOUGH_DISTS),t.sane=1,t.back=-1,Z_OK$1},inflateReset=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,inflateResetKeep(e)},inflateReset2=(e,t)=>{let n;if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const r=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Z_STREAM_ERROR$1:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,inflateReset(e))},inflateInit2=(e,t)=>{if(!e)return Z_STREAM_ERROR$1;const n=new InflateState;e.state=n,n.strm=e,n.window=null,n.mode=HEAD;const r=inflateReset2(e,t);return r!==Z_OK$1&&(e.state=null),r},inflateInit=e=>inflateInit2(e,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=e=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(inftrees(LENS,e.lens,0,288,lenfix,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;inftrees(DISTS,e.lens,0,32,distfix,0,e.work,{bits:5}),virgin=!1}e.lencode=lenfix,e.lenbits=9,e.distcode=distfix,e.distbits=5},updatewindow=(e,t,n,r)=>{let o;const i=e.state;return null===i.window&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),r>=i.wsize?(i.window.set(t.subarray(n-i.wsize,n),0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>r&&(o=r),i.window.set(t.subarray(n-r,n-r+o),i.wnext),(r-=o)?(i.window.set(t.subarray(n-r,n),0),i.wnext=r,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=o))),0},inflate$2=(e,t)=>{let n,r,o,i,a,s,l,c,u,d,p,h,f,A,m,g,y,v,b,x,w,C,$=0;const _=new Uint8Array(4);let S,E;const k=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(e)||!e.output||!e.input&&0!==e.avail_in)return Z_STREAM_ERROR$1;n=e.state,n.mode===TYPE&&(n.mode=TYPEDO),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,r=e.input,s=e.avail_in,c=n.hold,u=n.bits,d=s,p=l,C=Z_OK$1;e:for(;;)switch(n.mode){case HEAD:if(0===n.wrap){n.mode=TYPEDO;break}for(;u<16;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(2&n.wrap&&35615===c){0===n.wbits&&(n.wbits=15),n.check=0,_[0]=255&c,_[1]=c>>>8&255,n.check=crc32_1(n.check,_,2,0),c=0,u=0,n.mode=FLAGS;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=BAD;break}if((15&c)!==Z_DEFLATED){e.msg="unknown compression method",n.mode=BAD;break}if(c>>>=4,u-=4,w=8+(15&c),0===n.wbits&&(n.wbits=w),w>15||w>n.wbits){e.msg="invalid window size",n.mode=BAD;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&c?DICTID:TYPE,c=0,u=0;break;case FLAGS:for(;u<16;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(n.flags=c,(255&n.flags)!==Z_DEFLATED){e.msg="unknown compression method",n.mode=BAD;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=BAD;break}n.head&&(n.head.text=c>>8&1),512&n.flags&&4&n.wrap&&(_[0]=255&c,_[1]=c>>>8&255,n.check=crc32_1(n.check,_,2,0)),c=0,u=0,n.mode=TIME;case TIME:for(;u<32;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}n.head&&(n.head.time=c),512&n.flags&&4&n.wrap&&(_[0]=255&c,_[1]=c>>>8&255,_[2]=c>>>16&255,_[3]=c>>>24&255,n.check=crc32_1(n.check,_,4,0)),c=0,u=0,n.mode=OS;case OS:for(;u<16;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&4&n.wrap&&(_[0]=255&c,_[1]=c>>>8&255,n.check=crc32_1(n.check,_,2,0)),c=0,u=0,n.mode=EXLEN;case EXLEN:if(1024&n.flags){for(;u<16;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&4&n.wrap&&(_[0]=255&c,_[1]=c>>>8&255,n.check=crc32_1(n.check,_,2,0)),c=0,u=0}else n.head&&(n.head.extra=null);n.mode=EXTRA;case EXTRA:if(1024&n.flags&&(h=n.length,h>s&&(h=s),h&&(n.head&&(w=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(i,i+h),w)),512&n.flags&&4&n.wrap&&(n.check=crc32_1(n.check,r,h,i)),s-=h,i+=h,n.length-=h),n.length))break e;n.length=0,n.mode=NAME;case NAME:if(2048&n.flags){if(0===s)break e;h=0;do{w=r[i+h++],n.head&&w&&n.length<65536&&(n.head.name+=String.fromCharCode(w))}while(w&&h<s);if(512&n.flags&&4&n.wrap&&(n.check=crc32_1(n.check,r,h,i)),s-=h,i+=h,w)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=COMMENT;case COMMENT:if(4096&n.flags){if(0===s)break e;h=0;do{w=r[i+h++],n.head&&w&&n.length<65536&&(n.head.comment+=String.fromCharCode(w))}while(w&&h<s);if(512&n.flags&&4&n.wrap&&(n.check=crc32_1(n.check,r,h,i)),s-=h,i+=h,w)break e}else n.head&&(n.head.comment=null);n.mode=HCRC;case HCRC:if(512&n.flags){for(;u<16;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(4&n.wrap&&c!==(65535&n.check)){e.msg="header crc mismatch",n.mode=BAD;break}c=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=TYPE;break;case DICTID:for(;u<32;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}e.adler=n.check=zswap32(c),c=0,u=0,n.mode=DICT;case DICT:if(0===n.havedict)return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,Z_NEED_DICT$1;e.adler=n.check=1,n.mode=TYPE;case TYPE:if(t===Z_BLOCK||t===Z_TREES)break e;case TYPEDO:if(n.last){c>>>=7&u,u-=7&u,n.mode=CHECK;break}for(;u<3;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}switch(n.last=1&c,c>>>=1,u-=1,3&c){case 0:n.mode=STORED;break;case 1:if(fixedtables(n),n.mode=LEN_,t===Z_TREES){c>>>=2,u-=2;break e}break;case 2:n.mode=TABLE;break;case 3:e.msg="invalid block type",n.mode=BAD}c>>>=2,u-=2;break;case STORED:for(c>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=BAD;break}if(n.length=65535&c,c=0,u=0,n.mode=COPY_,t===Z_TREES)break e;case COPY_:n.mode=COPY;case COPY:if(h=n.length,h){if(h>s&&(h=s),h>l&&(h=l),0===h)break e;o.set(r.subarray(i,i+h),a),s-=h,i+=h,l-=h,a+=h,n.length-=h;break}n.mode=TYPE;break;case TABLE:for(;u<14;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(n.nlen=257+(31&c),c>>>=5,u-=5,n.ndist=1+(31&c),c>>>=5,u-=5,n.ncode=4+(15&c),c>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=BAD;break}n.have=0,n.mode=LENLENS;case LENLENS:for(;n.have<n.ncode;){for(;u<3;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}n.lens[k[n.have++]]=7&c,c>>>=3,u-=3}for(;n.have<19;)n.lens[k[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,S={bits:n.lenbits},C=inftrees(CODES,n.lens,0,19,n.lencode,0,n.work,S),n.lenbits=S.bits,C){e.msg="invalid code lengths set",n.mode=BAD;break}n.have=0,n.mode=CODELENS;case CODELENS:for(;n.have<n.nlen+n.ndist;){for(;$=n.lencode[c&(1<<n.lenbits)-1],m=$>>>24,g=$>>>16&255,y=65535&$,!(m<=u);){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(y<16)c>>>=m,u-=m,n.lens[n.have++]=y;else{if(16===y){for(E=m+2;u<E;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(c>>>=m,u-=m,0===n.have){e.msg="invalid bit length repeat",n.mode=BAD;break}w=n.lens[n.have-1],h=3+(3&c),c>>>=2,u-=2}else if(17===y){for(E=m+3;u<E;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}c>>>=m,u-=m,w=0,h=3+(7&c),c>>>=3,u-=3}else{for(E=m+7;u<E;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}c>>>=m,u-=m,w=0,h=11+(127&c),c>>>=7,u-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=BAD;break}for(;h--;)n.lens[n.have++]=w}}if(n.mode===BAD)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=BAD;break}if(n.lenbits=9,S={bits:n.lenbits},C=inftrees(LENS,n.lens,0,n.nlen,n.lencode,0,n.work,S),n.lenbits=S.bits,C){e.msg="invalid literal/lengths set",n.mode=BAD;break}if(n.distbits=6,n.distcode=n.distdyn,S={bits:n.distbits},C=inftrees(DISTS,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,S),n.distbits=S.bits,C){e.msg="invalid distances set",n.mode=BAD;break}if(n.mode=LEN_,t===Z_TREES)break e;case LEN_:n.mode=LEN;case LEN:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,inffast(e,p),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,r=e.input,s=e.avail_in,c=n.hold,u=n.bits,n.mode===TYPE&&(n.back=-1);break}for(n.back=0;$=n.lencode[c&(1<<n.lenbits)-1],m=$>>>24,g=$>>>16&255,y=65535&$,!(m<=u);){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(g&&!(240&g)){for(v=m,b=g,x=y;$=n.lencode[x+((c&(1<<v+b)-1)>>v)],m=$>>>24,g=$>>>16&255,y=65535&$,!(v+m<=u);){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}c>>>=v,u-=v,n.back+=v}if(c>>>=m,u-=m,n.back+=m,n.length=y,0===g){n.mode=LIT;break}if(32&g){n.back=-1,n.mode=TYPE;break}if(64&g){e.msg="invalid literal/length code",n.mode=BAD;break}n.extra=15&g,n.mode=LENEXT;case LENEXT:if(n.extra){for(E=n.extra;u<E;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=DIST;case DIST:for(;$=n.distcode[c&(1<<n.distbits)-1],m=$>>>24,g=$>>>16&255,y=65535&$,!(m<=u);){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(!(240&g)){for(v=m,b=g,x=y;$=n.distcode[x+((c&(1<<v+b)-1)>>v)],m=$>>>24,g=$>>>16&255,y=65535&$,!(v+m<=u);){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}c>>>=v,u-=v,n.back+=v}if(c>>>=m,u-=m,n.back+=m,64&g){e.msg="invalid distance code",n.mode=BAD;break}n.offset=y,n.extra=15&g,n.mode=DISTEXT;case DISTEXT:if(n.extra){for(E=n.extra;u<E;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=BAD;break}n.mode=MATCH;case MATCH:if(0===l)break e;if(h=p-l,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=BAD;break}h>n.wnext?(h-=n.wnext,f=n.wsize-h):f=n.wnext-h,h>n.length&&(h=n.length),A=n.window}else A=o,f=a-n.offset,h=n.length;h>l&&(h=l),l-=h,n.length-=h;do{o[a++]=A[f++]}while(--h);0===n.length&&(n.mode=LEN);break;case LIT:if(0===l)break e;o[a++]=n.length,l--,n.mode=LEN;break;case CHECK:if(n.wrap){for(;u<32;){if(0===s)break e;s--,c|=r[i++]<<u,u+=8}if(p-=l,e.total_out+=p,n.total+=p,4&n.wrap&&p&&(e.adler=n.check=n.flags?crc32_1(n.check,o,p,a-p):adler32_1(n.check,o,p,a-p)),p=l,4&n.wrap&&(n.flags?c:zswap32(c))!==n.check){e.msg="incorrect data check",n.mode=BAD;break}c=0,u=0}n.mode=LENGTH;case LENGTH:if(n.wrap&&n.flags){for(;u<32;){if(0===s)break e;s--,c+=r[i++]<<u,u+=8}if(4&n.wrap&&c!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=BAD;break}c=0,u=0}n.mode=DONE;case DONE:C=Z_STREAM_END$1;break e;case BAD:C=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;default:return Z_STREAM_ERROR$1}return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,(n.wsize||p!==e.avail_out&&n.mode<BAD&&(n.mode<CHECK||t!==Z_FINISH$1))&&updatewindow(e,e.output,e.next_out,p-e.avail_out),d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,n.total+=p,4&n.wrap&&p&&(e.adler=n.check=n.flags?crc32_1(n.check,o,p,e.next_out-p):adler32_1(n.check,o,p,e.next_out-p)),e.data_type=n.bits+(n.last?64:0)+(n.mode===TYPE?128:0)+(n.mode===LEN_||n.mode===COPY_?256:0),(0===d&&0===p||t===Z_FINISH$1)&&C===Z_OK$1&&(C=Z_BUF_ERROR),C},inflateEnd=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;let t=e.state;return t.window&&(t.window=null),e.state=null,Z_OK$1},inflateGetHeader=(e,t)=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,Z_OK$1):Z_STREAM_ERROR$1},inflateSetDictionary=(e,t)=>{const n=t.length;let r,o,i;return inflateStateCheck(e)?Z_STREAM_ERROR$1:(r=e.state,0!==r.wrap&&r.mode!==DICT?Z_STREAM_ERROR$1:r.mode===DICT&&(o=1,o=adler32_1(o,t,n,0),o!==r.check)?Z_DATA_ERROR$1:(i=updatewindow(e,t,n,n),i?(r.mode=MEM,Z_MEM_ERROR$1):(r.havedict=1,Z_OK$1)))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo:inflateInfo};function GZheader(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH,Z_FINISH:Z_FINISH,Z_OK:Z_OK,Z_STREAM_END:Z_STREAM_END,Z_NEED_DICT:Z_NEED_DICT,Z_STREAM_ERROR:Z_STREAM_ERROR,Z_DATA_ERROR:Z_DATA_ERROR,Z_MEM_ERROR:Z_MEM_ERROR}=constants$2;function Inflate$1(e){this.options=common.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let n=inflate_1$2.inflateInit2(this.strm,t.windowBits);if(n!==Z_OK)throw new Error(messages[n]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=strings.string2buf(t.dictionary):"[object ArrayBuffer]"===toString.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=inflate_1$2.inflateSetDictionary(this.strm,t.dictionary),n!==Z_OK)))throw new Error(messages[n])}function inflate$1(e,t){const n=new Inflate$1(t);if(n.push(e),n.err)throw n.msg||messages[n.err];return n.result}Inflate$1.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,o=this.options.dictionary;let i,a,s;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Z_FINISH:Z_NO_FLUSH,"[object ArrayBuffer]"===toString.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),i=inflate_1$2.inflate(n,a),i===Z_NEED_DICT&&o&&(i=inflate_1$2.inflateSetDictionary(n,o),i===Z_OK?i=inflate_1$2.inflate(n,a):i===Z_DATA_ERROR&&(i=Z_NEED_DICT));n.avail_in>0&&i===Z_STREAM_END&&n.state.wrap>0&&0!==e[n.next_in];)inflate_1$2.inflateReset(n),i=inflate_1$2.inflate(n,a);switch(i){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(i),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(0===n.avail_out||i===Z_STREAM_END))if("string"===this.options.to){let e=strings.utf8border(n.output,n.next_out),t=n.next_out-e,o=strings.buf2string(n.output,e);n.next_out=t,n.avail_out=r-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(o)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(i!==Z_OK||0!==s){if(i===Z_STREAM_END)return i=inflate_1$2.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},Inflate$1.prototype.onData=function(e){this.chunks.push(e)},Inflate$1.prototype.onEnd=function(e){e===Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2};const{Inflate:Inflate,inflate:inflate}=inflate_1$1;var Inflate_1=Inflate,inflate_1=inflate;const crcTable=[];for(let Wp=0;Wp<256;Wp++){let e=Wp;for(let t=0;t<8;t++)1&e?e=3988292384^e>>>1:e>>>=1;crcTable[Wp]=e}const initialCrc=4294967295;function updateCrc(e,t,n){let r=e;for(let o=0;o<n;o++)r=crcTable[255&(r^t[o])]^r>>>8;return r}function crc(e,t){return(updateCrc(initialCrc,e,t)^initialCrc)>>>0}function checkCrc(e,t,n){const r=e.readUint32(),o=crc(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(o!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${o}`)}function unfilterNone(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}function unfilterSub(e,t,n,r){let o=0;for(;o<r;o++)t[o]=e[o];for(;o<n;o++)t[o]=e[o]+t[o-r]&255}function unfilterUp(e,t,n,r){let o=0;if(0===n.length)for(;o<r;o++)t[o]=e[o];else for(;o<r;o++)t[o]=e[o]+n[o]&255}function unfilterAverage(e,t,n,r,o){let i=0;if(0===n.length){for(;i<o;i++)t[i]=e[i];for(;i<r;i++)t[i]=e[i]+(t[i-o]>>1)&255}else{for(;i<o;i++)t[i]=e[i]+(n[i]>>1)&255;for(;i<r;i++)t[i]=e[i]+(t[i-o]+n[i]>>1)&255}}function unfilterPaeth(e,t,n,r,o){let i=0;if(0===n.length){for(;i<o;i++)t[i]=e[i];for(;i<r;i++)t[i]=e[i]+t[i-o]&255}else{for(;i<o;i++)t[i]=e[i]+n[i]&255;for(;i<r;i++)t[i]=e[i]+paethPredictor(t[i-o],n[i],n[i-o])&255}}function paethPredictor(e,t,n){const r=e+t-n,o=Math.abs(r-e),i=Math.abs(r-t),a=Math.abs(r-n);return o<=i&&o<=a?e:i<=a?t:n}function applyUnfilter(e,t,n,r,o,i){switch(e){case 0:unfilterNone(t,n,o);break;case 1:unfilterSub(t,n,o,i);break;case 2:unfilterUp(t,n,r,o);break;case 3:unfilterAverage(t,n,r,o,i);break;case 4:unfilterPaeth(t,n,r,o,i);break;default:throw new Error(`Unsupported filter: ${e}`)}}const uint16$1=new Uint16Array([255]),uint8$1=new Uint8Array(uint16$1.buffer),osIsLittleEndian$1=255===uint8$1[0];function decodeInterlaceAdam7(e){const{data:t,width:n,height:r,channels:o,depth:i}=e,a=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],s=Math.ceil(i/8)*o,l=new Uint8Array(r*n*s);let c=0;for(let u=0;u<7;u++){const e=a[u],o=Math.ceil((n-e.x)/e.xStep),i=Math.ceil((r-e.y)/e.yStep);if(o<=0||i<=0)continue;const d=o*s,p=new Uint8Array(d);for(let a=0;a<i;a++){const i=t[c++],u=t.subarray(c,c+d);c+=d;const h=new Uint8Array(d);applyUnfilter(i,u,h,p,d,s),p.set(h);for(let t=0;t<o;t++){const o=e.x+t*e.xStep,i=e.y+a*e.yStep;if(!(o>=n||i>=r))for(let e=0;e<s;e++)l[(i*n+o)*s+e]=h[t*s+e]}}}if(16===i){const e=new Uint16Array(l.buffer);if(osIsLittleEndian$1)for(let t=0;t<e.length;t++)e[t]=swap16$1(e[t]);return e}return l}function swap16$1(e){return(255&e)<<8|e>>8&255}const uint16=new Uint16Array([255]),uint8=new Uint8Array(uint16.buffer),osIsLittleEndian=255===uint8[0],empty$2=new Uint8Array(0);function decodeInterlaceNull(e){const{data:t,width:n,height:r,channels:o,depth:i}=e,a=Math.ceil(i/8)*o,s=Math.ceil(i/8*o*n),l=new Uint8Array(r*s);let c,u,d=empty$2,p=0;for(let h=0;h<r;h++){switch(c=t.subarray(p+1,p+1+s),u=l.subarray(h*s,(h+1)*s),t[p]){case 0:unfilterNone(c,u,s);break;case 1:unfilterSub(c,u,s,a);break;case 2:unfilterUp(c,u,d,s);break;case 3:unfilterAverage(c,u,d,s,a);break;case 4:unfilterPaeth(c,u,d,s,a);break;default:throw new Error(`Unsupported filter: ${t[p]}`)}d=u,p+=s+1}if(16===i){const e=new Uint16Array(l.buffer);if(osIsLittleEndian)for(let t=0;t<e.length;t++)e[t]=swap16(e[t]);return e}return l}function swap16(e){return(255&e)<<8|e>>8&255}const pngSignature=Uint8Array.of(137,80,78,71,13,10,26,10);function checkSignature(e){if(!hasPngSignature(e.readBytes(pngSignature.length)))throw new Error("wrong PNG signature")}function hasPngSignature(e){if(e.length<pngSignature.length)return!1;for(let t=0;t<pngSignature.length;t++)if(e[t]!==pngSignature[t])return!1;return!0}const textChunkName="tEXt",NULL=0,latin1Decoder=new TextDecoder("latin1");function validateKeyword(e){if(validateLatin1(e),0===e.length||e.length>79)throw new Error("keyword length must be between 1 and 79")}const latin1Regex=/^[\u0000-\u00FF]*$/;function validateLatin1(e){if(!latin1Regex.test(e))throw new Error("invalid latin1 text")}function decodetEXt(e,t,n){const r=readKeyword(t);e[r]=readLatin1(t,n-r.length-1)}function readKeyword(e){for(e.mark();e.readByte()!==NULL;);const t=e.offset;e.reset();const n=latin1Decoder.decode(e.readBytes(t-e.offset-1));return e.skip(1),validateKeyword(n),n}function readLatin1(e,t){return latin1Decoder.decode(e.readBytes(t))}const ColorType={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},CompressionMethod={UNKNOWN:-1,DEFLATE:0},FilterMethod={UNKNOWN:-1,ADAPTIVE:0},InterlaceMethod={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},DisposeOpType={NONE:0,BACKGROUND:1,PREVIOUS:2},BlendOpType={SOURCE:0,OVER:1};class PngDecoder extends IOBuffer{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(e,t={}){super(e);const{checkCrc:n=!1}=t;this._checkCrc=n,this._inflator=new Inflate_1,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=CompressionMethod.UNKNOWN,this._filterMethod=FilterMethod.UNKNOWN,this._interlaceMethod=InterlaceMethod.UNKNOWN,this._colorType=ColorType.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(checkSignature(this);!this._end;){const e=this.readUint32(),t=this.readChars(4);this.decodeChunk(e,t)}return this.decodeImage(),this._png}decodeApng(){for(checkSignature(this);!this._end;){const e=this.readUint32(),t=this.readChars(4);this.decodeApngChunk(e,t)}return this.decodeApngImage(),this._apng}decodeChunk(e,t){const n=this.offset;switch(t){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(e);break;case"IDAT":this.decodeIDAT(e);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(e);break;case"iCCP":this.decodeiCCP(e);break;case textChunkName:decodetEXt(this._png.text,this,e);break;case"pHYs":this.decodepHYs();break;default:this.skip(e)}if(this.offset-n!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?checkCrc(this,e+4,t):this.skip(4)}decodeApngChunk(e,t){const n=this.offset;switch("fdAT"!==t&&"IDAT"!==t&&this._writingDataChunks&&this.pushDataToFrame(),t){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(e);break;default:this.decodeChunk(e,t),this.offset=n+e}if(this.offset-n!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?checkCrc(this,e+4,t):this.skip(4)}decodeIHDR(){const e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=checkBitDepth(this.readUint8());const t=this.readUint8();let n;switch(this._colorType=t,t){case ColorType.GREYSCALE:n=1;break;case ColorType.TRUECOLOUR:n=3;break;case ColorType.INDEXED_COLOUR:n=1;break;case ColorType.GREYSCALE_ALPHA:n=2;break;case ColorType.TRUECOLOUR_ALPHA:n=4;break;case ColorType.UNKNOWN:default:throw new Error(`Unknown color type: ${t}`)}if(this._png.channels=n,this._compressionMethod=this.readUint8(),this._compressionMethod!==CompressionMethod.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const e={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(e)}decodePLTE(e){if(e%3!=0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);const t=e/3;this._hasPalette=!0;const n=[];this._palette=n;for(let r=0;r<t;r++)n.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(e){this._writingDataChunks=!0;const t=e,n=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,n,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodeFDAT(e){this._writingDataChunks=!0;let t=e,n=this.offset+this.byteOffset;if(n+=4,t-=4,this._inflator.push(new Uint8Array(this.buffer,n,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodetRNS(e){switch(this._colorType){case ColorType.GREYSCALE:case ColorType.TRUECOLOUR:if(e%2!=0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${e}`);if(e/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${e/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(e/2);for(let t=0;t<e/2;t++)this._transparency[t]=this.readUint16();break;case ColorType.INDEXED_COLOUR:{if(e>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);let t=0;for(;t<e;t++){const e=this.readByte();this._palette[t].push(e)}for(;t<this._palette.length;t++)this._palette[t].push(255);break}case ColorType.UNKNOWN:case ColorType.GREYSCALE_ALPHA:case ColorType.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(e){const t=readKeyword(this),n=this.readUint8();if(n!==CompressionMethod.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${n}`);const r=this.readBytes(e-t.length-2);this._png.iccEmbeddedProfile={name:t,profile:inflate_1(r)}}decodepHYs(){const e=this.readUint32(),t=this.readUint32(),n=this.readByte();this._png.resolution={x:e,y:t,unit:n}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let e=0;e<this._numberOfFrames;e++){const t={sequenceNumber:this._frames[e].sequenceNumber,delayNumber:this._frames[e].delayNumber,delayDenominator:this._frames[e].delayDenominator,data:8===this._apng.depth?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},n=this._frames.at(e);if(n){if(n.data=decodeInterlaceNull({data:n.data,width:n.width,height:n.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),0===e||0===n.xOffset&&0===n.yOffset&&n.width===this._png.width&&n.height===this._png.height)t.data=n.data;else{const r=this._apng.frames.at(e-1);this.disposeFrame(n,r,t),this.addFrameDataToCanvas(t,n)}this._apng.frames.push(t)}}return this._apng}disposeFrame(e,t,n){switch(e.disposeOp){case DisposeOpType.NONE:break;case DisposeOpType.BACKGROUND:for(let t=0;t<this._png.height;t++)for(let r=0;r<this._png.width;r++){const o=(t*e.width+r)*this._png.channels;for(let e=0;e<this._png.channels;e++)n.data[o+e]=0}break;case DisposeOpType.PREVIOUS:n.data.set(t.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(e,t){const n=1<<this._png.depth,r=(e,n)=>({index:((e+t.yOffset)*this._png.width+t.xOffset+n)*this._png.channels,frameIndex:(e*t.width+n)*this._png.channels});switch(t.blendOp){case BlendOpType.SOURCE:for(let n=0;n<t.height;n++)for(let o=0;o<t.width;o++){const{index:i,frameIndex:a}=r(n,o);for(let n=0;n<this._png.channels;n++)e.data[i+n]=t.data[a+n]}break;case BlendOpType.OVER:for(let o=0;o<t.height;o++)for(let i=0;i<t.width;i++){const{index:a,frameIndex:s}=r(o,i);for(let r=0;r<this._png.channels;r++){const o=t.data[s+this._png.channels-1]/n,i=r%(this._png.channels-1)==0?1:t.data[s+r],l=Math.floor(o*i+(1-o)*e.data[a+r]);e.data[a+r]+=l}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var e;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const t=this._isAnimated?(null==(e=this._frames)?void 0:e.at(0)).data:this._inflator.result;if(this._filterMethod!==FilterMethod.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===InterlaceMethod.NO_INTERLACE)this._png.data=decodeInterlaceNull({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else{if(this._interlaceMethod!==InterlaceMethod.ADAM7)throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._png.data=decodeInterlaceAdam7({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth})}this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const e=this._inflator.result,t=this._frames.at(-1);t?t.data=e:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:DisposeOpType.NONE,blendOp:BlendOpType.SOURCE,data:e}),this._inflator=new Inflate_1,this._writingDataChunks=!1}}function checkBitDepth(e){if(1!==e&&2!==e&&4!==e&&8!==e&&16!==e)throw new Error(`invalid bit depth: ${e}`);return e}var ResolutionUnitSpecifier,ResolutionUnitSpecifier2;function decodePng(e,t){return new PngDecoder(e,t).decode()}ResolutionUnitSpecifier2=ResolutionUnitSpecifier||(ResolutionUnitSpecifier={}),ResolutionUnitSpecifier2[ResolutionUnitSpecifier2.UNKNOWN=0]="UNKNOWN",ResolutionUnitSpecifier2[ResolutionUnitSpecifier2.METRE=1]="METRE";var i$2=function(){return"undefined"!=typeof window?window:void 0!==global$1?global$1:"undefined"!=typeof self?self:this}();function a$1(){i$2.console&&"function"==typeof i$2.console.log&&i$2.console.log.apply(i$2.console,arguments)}var o$2={log:a$1,warn:function(e){i$2.console&&("function"==typeof i$2.console.warn?i$2.console.warn.apply(i$2.console,arguments):a$1.call(null,arguments))},error:function(e){i$2.console&&("function"==typeof i$2.console.error?i$2.console.error.apply(i$2.console,arguments):a$1(e))}};function s$1(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){l$2(r.response,t,n)},r.onerror=function(){o$2.error("could not download file")},r.send()}function u$1(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(n){}return t.status>=200&&t.status<=299}function c$2(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var l$2=i$2.saveAs||("object"!==("undefined"==typeof window?"undefined":_typeof(window))||window!==i$2?function(){}:"undefined"!=typeof HTMLAnchorElement&&"download"in HTMLAnchorElement.prototype?function(e,t,n){var r=i$2.URL||i$2.webkitURL,o=document.createElement("a");t=t||e.name||"download",o.download=t,o.rel="noopener","string"==typeof e?(o.href=e,o.origin!==location.origin?u$1(o.href)?s$1(e,t,n):c$2(o,o.target="_blank"):c$2(o)):(o.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(o.href)},4e4),setTimeout(function(){c$2(o)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download","string"==typeof e)if(u$1(e))s$1(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){c$2(r)})}else navigator.msSaveOrOpenBlob((o=e,void 0===(i=n)?i={autoBom:!1}:"object"!==_typeof(i)&&(o$2.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(o.type)?new Blob([String.fromCharCode(65279),o],{type:o.type}):o),t);var o,i}:function(e,t,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return s$1(e,t,n);var o="application/octet-stream"===e.type,i=/constructor/i.test(i$2.HTMLElement)||i$2.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||o&&i)&&"object"===("undefined"==typeof FileReader?"undefined":_typeof(FileReader))){var s=new FileReader;s.onloadend=function(){var e=s.result;e=a?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},s.readAsDataURL(e)}else{var l=i$2.URL||i$2.webkitURL,c=l.createObjectURL(e);r?r.location=c:location.href=c,r=null,setTimeout(function(){l.revokeObjectURL(c)},4e4)}});
|
|
211
211
|
/**
|
|
212
212
|
* A class to parse color values
|
|
213
213
|
* @author Stoyan Stefanov <sstoo@gmail.com>
|
|
@@ -331,7 +331,7 @@ function(e){var t=function(e){var t,n,r,o,i,a,s,l,c,u;for(n=[],r=0,o=(e+=t="\0\0
|
|
|
331
331
|
* Licensed under the MIT License.
|
|
332
332
|
* http://opensource.org/licenses/mit-license
|
|
333
333
|
*/
|
|
334
|
-
function(e){e.loadFile=function(e,t,n){return function(e,t,n){t=!1!==t,n="function"==typeof n?n:function(){};var r=void 0;try{r=function(e,t,n){var r=new XMLHttpRequest,o=0,i=function(e){var t=e.length,n=[],r=String.fromCharCode;for(o=0;o<t;o+=1)n.push(r(255&e.charCodeAt(o)));return n.join("")};if(r.open("GET",e,!t),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===t&&(r.onload=function(){200===r.status?n(i(this.responseText)):n(void 0)}),r.send(null),t&&200===r.status)return i(r.responseText)}(e,t,n)}catch(i2){}return r}(e,t,n)},e.loadImageFile=e.loadFile}(E$1.API),function(e){function t(){return(i$2.html2canvas?Promise.resolve(i$2.html2canvas):__vitePreload(()=>import("./html2canvas-BiE4mNf-.js").then(e=>e.h),[])).catch(function(e){return Promise.reject(new Error("Could not load html2canvas: "+e))}).then(function(e){return e.default?e.default:e})}function n(){return(i$2.DOMPurify?Promise.resolve(i$2.DOMPurify):__vitePreload(()=>import("./purify.es-DpMHVkxQ.js"),[])).catch(function(e){return Promise.reject(new Error("Could not load dompurify: "+e))}).then(function(e){return e.default?e.default:e})}var r=function(e){var t=_typeof(e);return"undefined"===t?"undefined":"string"===t||e instanceof String?"string":"number"===t||e instanceof Number?"number":"function"===t||e instanceof Function?"function":e&&e.constructor===Array?"array":e&&1===e.nodeType?"element":"object"===t?"object":"unknown"},o=function(e,t){var n=document.createElement(e);for(var r in t.className&&(n.className=t.className),t.innerHTML&&t.dompurify&&(n.innerHTML=t.dompurify.sanitize(t.innerHTML)),t.style)n.style[r]=t.style[r];return n},i=function e(t,n){for(var r=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),o=t.firstChild;o;o=o.nextSibling)!0!==n&&1===o.nodeType&&"SCRIPT"===o.nodeName||r.appendChild(e(o,n));return 1===t.nodeType&&("CANVAS"===t.nodeName?(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(t,0,0)):"TEXTAREA"!==t.nodeName&&"SELECT"!==t.nodeName||(r.value=t.value),r.addEventListener("load",function(){r.scrollTop=t.scrollTop,r.scrollLeft=t.scrollLeft},!0)),r},a=function e(t){var n=Object.assign(e.convert(Promise.resolve()),JSON.parse(JSON.stringify(e.template))),r=e.convert(Promise.resolve(),n);return(r=r.setProgress(1,e,1,[e])).set(t)};(a.prototype=Object.create(Promise.prototype)).constructor=a,a.convert=function(e,t){return e.__proto__=t||a.prototype,e},a.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},a.prototype.from=function(e,t){return this.then(function(){switch(t=t||function(e){switch(r(e)){case"string":return"string";case"element":return"canvas"===e.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(e)){case"string":return this.then(n).then(function(t){return this.set({src:o("div",{innerHTML:e,dompurify:t})})});case"element":return this.set({src:e});case"canvas":return this.set({canvas:e});case"img":return this.set({img:e});default:return this.error("Unknown source type.")}})},a.prototype.to=function(e){switch(e){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},a.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var e={position:"relative",display:"inline-block",width:("number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},t=i(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===t.tagName&&(e.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=o("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=o("div",{className:"html2pdf__container",style:e}),this.prop.container.appendChild(t),this.prop.container.firstChild.appendChild(o("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},a.prototype.toCanvas=function(){var e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(e).then(t).then(function(e){var t=Object.assign({},this.opt.html2canvas);return delete t.onrendered,e(this.prop.container,t)}).then(function(e){(this.opt.html2canvas.onrendered||function(){})(e),this.prop.canvas=e,document.body.removeChild(this.prop.overlay)})},a.prototype.toContext2d=function(){var e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(e).then(t).then(function(e){var t=this.opt.jsPDF,n=this.opt.fontFaces,r="number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,o=Object.assign({async:!0,allowTaint:!0,scale:r,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete o.onrendered,t.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,t.context2d.posX=this.opt.x,t.context2d.posY=this.opt.y,t.context2d.margin=this.opt.margin,t.context2d.fontFaces=n,n)for(var i=0;i<n.length;++i){var a=n[i],s=a.src.find(function(e){return"truetype"===e.format});s&&t.addFont(s.url,a.ref.name,a.ref.style)}return o.windowHeight=o.windowHeight||0,o.windowHeight=0==o.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):o.windowHeight,t.context2d.save(!0),e(this.prop.container,o)}).then(function(e){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(e),this.prop.canvas=e,document.body.removeChild(this.prop.overlay)})},a.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var e=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=e})},a.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},a.prototype.output=function(e,t,n){return"img"===(n=n||"pdf").toLowerCase()||"image"===n.toLowerCase()?this.outputImg(e,t):this.outputPdf(e,t)},a.prototype.outputPdf=function(e,t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(e,t)})},a.prototype.outputImg=function(e){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(e){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+e+'" is not supported.'}})},a.prototype.save=function(e){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(e?{filename:e}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},a.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},a.prototype.set=function(e){if("object"!==r(e))return this;var t=Object.keys(e||{}).map(function(t){if(t in a.template.prop)return function(){this.prop[t]=e[t]};switch(t){case"margin":return this.setMargin.bind(this,e.margin);case"jsPDF":return function(){return this.opt.jsPDF=e.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,e.pageSize);default:return function(){this.opt[t]=e[t]}}},this);return this.then(function(){return this.thenList(t)})},a.prototype.get=function(e,t){return this.then(function(){var n=e in a.template.prop?this.prop[e]:this.opt[e];return t?t(n):n})},a.prototype.setMargin=function(e){return this.then(function(){switch(r(e)){case"number":e=[e,e,e,e];case"array":if(2===e.length&&(e=[e[0],e[1],e[0],e[1]]),4===e.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=e}).then(this.setPageSize)},a.prototype.setPageSize=function(e){function t(e,t){return Math.floor(e*t/72*96)}return this.then(function(){(e=e||E$1.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(e.inner={width:e.width-this.opt.margin[1]-this.opt.margin[3],height:e.height-this.opt.margin[0]-this.opt.margin[2]},e.inner.px={width:t(e.inner.width,e.k),height:t(e.inner.height,e.k)},e.inner.ratio=e.inner.height/e.inner.width),this.prop.pageSize=e})},a.prototype.setProgress=function(e,t,n,r){return null!=e&&(this.progress.val=e),null!=t&&(this.progress.state=t),null!=n&&(this.progress.n=n),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},a.prototype.updateProgress=function(e,t,n,r){return this.setProgress(e?this.progress.val+e:null,t||null,n?this.progress.n+n:null,r?this.progress.stack.concat(r):null)},a.prototype.then=function(e,t){var n=this;return this.thenCore(e,t,function(e,t){return n.updateProgress(null,null,1,[e]),Promise.prototype.then.call(this,function(t){return n.updateProgress(null,e),t}).then(e,t).then(function(e){return n.updateProgress(1),e})})},a.prototype.thenCore=function(e,t,n){n=n||Promise.prototype.then;var r=this;e&&(e=e.bind(r)),t&&(t=t.bind(r));var o=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?r:a.convert(Object.assign({},r),Promise.prototype),i=n.call(o,e,t);return a.convert(i,r.__proto__)},a.prototype.thenExternal=function(e,t){return Promise.prototype.then.call(this,e,t)},a.prototype.thenList=function(e){var t=this;return e.forEach(function(e){t=t.thenCore(e)}),t},a.prototype.catch=function(e){e&&(e=e.bind(this));var t=Promise.prototype.catch.call(this,e);return a.convert(t,this)},a.prototype.catchExternal=function(e){return Promise.prototype.catch.call(this,e)},a.prototype.error=function(e){return this.then(function(){throw new Error(e)})},a.prototype.using=a.prototype.set,a.prototype.saveAs=a.prototype.save,a.prototype.export=a.prototype.output,a.prototype.run=a.prototype.then,E$1.getPageSize=function(e,t,n){if("object"===_typeof(e)){var r=e;e=r.orientation,t=r.unit||t,n=r.format||n}t=t||"mm",n=n||"a4",e=(""+(e||"P")).toLowerCase();var o,i=(""+n).toLowerCase(),a={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(t){case"pt":o=1;break;case"mm":o=72/25.4;break;case"cm":o=72/2.54;break;case"in":o=72;break;case"px":o=.75;break;case"pc":case"em":o=12;break;case"ex":o=6;break;default:throw"Invalid unit: "+t}var s,l=0,c=0;if(a.hasOwnProperty(i))l=a[i][1]/o,c=a[i][0]/o;else try{l=n[1],c=n[0]}catch(u){throw new Error("Invalid format: "+n)}if("p"===e||"portrait"===e)e="p",c>l&&(s=c,c=l,l=s);else{if("l"!==e&&"landscape"!==e)throw"Invalid orientation: "+e;e="l",l>c&&(s=c,c=l,l=s)}return{width:c,height:l,unit:t,k:o,orientation:e}},e.html=function(e,t){(t=t||{}).callback=t.callback||function(){},t.html2canvas=t.html2canvas||{},t.html2canvas.canvas=t.html2canvas.canvas||this.canvas,t.jsPDF=t.jsPDF||this,t.fontFaces=t.fontFaces?t.fontFaces.map(Ct$1):null;var n=new a(t);return t.worker?n:n.from(e).doCallback()}}(E$1.API),E$1.API.addJS=function(e){return Ut$1=e,this.internal.events.subscribe("postPutResources",function(){Tt$1=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Tt$1+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),zt$1=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Ut$1+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==Tt$1&&void 0!==zt$1&&this.internal.out("/Names <</JavaScript "+Tt$1+" 0 R>>")}),this},
|
|
334
|
+
function(e){e.loadFile=function(e,t,n){return function(e,t,n){t=!1!==t,n="function"==typeof n?n:function(){};var r=void 0;try{r=function(e,t,n){var r=new XMLHttpRequest,o=0,i=function(e){var t=e.length,n=[],r=String.fromCharCode;for(o=0;o<t;o+=1)n.push(r(255&e.charCodeAt(o)));return n.join("")};if(r.open("GET",e,!t),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===t&&(r.onload=function(){200===r.status?n(i(this.responseText)):n(void 0)}),r.send(null),t&&200===r.status)return i(r.responseText)}(e,t,n)}catch(i2){}return r}(e,t,n)},e.loadImageFile=e.loadFile}(E$1.API),function(e){function t(){return(i$2.html2canvas?Promise.resolve(i$2.html2canvas):__vitePreload(()=>import("./html2canvas-CxpxaxUC.js").then(e=>e.h),[])).catch(function(e){return Promise.reject(new Error("Could not load html2canvas: "+e))}).then(function(e){return e.default?e.default:e})}function n(){return(i$2.DOMPurify?Promise.resolve(i$2.DOMPurify):__vitePreload(()=>import("./purify.es-DpMHVkxQ.js"),[])).catch(function(e){return Promise.reject(new Error("Could not load dompurify: "+e))}).then(function(e){return e.default?e.default:e})}var r=function(e){var t=_typeof(e);return"undefined"===t?"undefined":"string"===t||e instanceof String?"string":"number"===t||e instanceof Number?"number":"function"===t||e instanceof Function?"function":e&&e.constructor===Array?"array":e&&1===e.nodeType?"element":"object"===t?"object":"unknown"},o=function(e,t){var n=document.createElement(e);for(var r in t.className&&(n.className=t.className),t.innerHTML&&t.dompurify&&(n.innerHTML=t.dompurify.sanitize(t.innerHTML)),t.style)n.style[r]=t.style[r];return n},i=function e(t,n){for(var r=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),o=t.firstChild;o;o=o.nextSibling)!0!==n&&1===o.nodeType&&"SCRIPT"===o.nodeName||r.appendChild(e(o,n));return 1===t.nodeType&&("CANVAS"===t.nodeName?(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(t,0,0)):"TEXTAREA"!==t.nodeName&&"SELECT"!==t.nodeName||(r.value=t.value),r.addEventListener("load",function(){r.scrollTop=t.scrollTop,r.scrollLeft=t.scrollLeft},!0)),r},a=function e(t){var n=Object.assign(e.convert(Promise.resolve()),JSON.parse(JSON.stringify(e.template))),r=e.convert(Promise.resolve(),n);return(r=r.setProgress(1,e,1,[e])).set(t)};(a.prototype=Object.create(Promise.prototype)).constructor=a,a.convert=function(e,t){return e.__proto__=t||a.prototype,e},a.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},a.prototype.from=function(e,t){return this.then(function(){switch(t=t||function(e){switch(r(e)){case"string":return"string";case"element":return"canvas"===e.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(e)){case"string":return this.then(n).then(function(t){return this.set({src:o("div",{innerHTML:e,dompurify:t})})});case"element":return this.set({src:e});case"canvas":return this.set({canvas:e});case"img":return this.set({img:e});default:return this.error("Unknown source type.")}})},a.prototype.to=function(e){switch(e){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},a.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var e={position:"relative",display:"inline-block",width:("number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},t=i(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===t.tagName&&(e.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=o("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=o("div",{className:"html2pdf__container",style:e}),this.prop.container.appendChild(t),this.prop.container.firstChild.appendChild(o("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},a.prototype.toCanvas=function(){var e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(e).then(t).then(function(e){var t=Object.assign({},this.opt.html2canvas);return delete t.onrendered,e(this.prop.container,t)}).then(function(e){(this.opt.html2canvas.onrendered||function(){})(e),this.prop.canvas=e,document.body.removeChild(this.prop.overlay)})},a.prototype.toContext2d=function(){var e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(e).then(t).then(function(e){var t=this.opt.jsPDF,n=this.opt.fontFaces,r="number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,o=Object.assign({async:!0,allowTaint:!0,scale:r,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete o.onrendered,t.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,t.context2d.posX=this.opt.x,t.context2d.posY=this.opt.y,t.context2d.margin=this.opt.margin,t.context2d.fontFaces=n,n)for(var i=0;i<n.length;++i){var a=n[i],s=a.src.find(function(e){return"truetype"===e.format});s&&t.addFont(s.url,a.ref.name,a.ref.style)}return o.windowHeight=o.windowHeight||0,o.windowHeight=0==o.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):o.windowHeight,t.context2d.save(!0),e(this.prop.container,o)}).then(function(e){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(e),this.prop.canvas=e,document.body.removeChild(this.prop.overlay)})},a.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var e=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=e})},a.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},a.prototype.output=function(e,t,n){return"img"===(n=n||"pdf").toLowerCase()||"image"===n.toLowerCase()?this.outputImg(e,t):this.outputPdf(e,t)},a.prototype.outputPdf=function(e,t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(e,t)})},a.prototype.outputImg=function(e){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(e){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+e+'" is not supported.'}})},a.prototype.save=function(e){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(e?{filename:e}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},a.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},a.prototype.set=function(e){if("object"!==r(e))return this;var t=Object.keys(e||{}).map(function(t){if(t in a.template.prop)return function(){this.prop[t]=e[t]};switch(t){case"margin":return this.setMargin.bind(this,e.margin);case"jsPDF":return function(){return this.opt.jsPDF=e.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,e.pageSize);default:return function(){this.opt[t]=e[t]}}},this);return this.then(function(){return this.thenList(t)})},a.prototype.get=function(e,t){return this.then(function(){var n=e in a.template.prop?this.prop[e]:this.opt[e];return t?t(n):n})},a.prototype.setMargin=function(e){return this.then(function(){switch(r(e)){case"number":e=[e,e,e,e];case"array":if(2===e.length&&(e=[e[0],e[1],e[0],e[1]]),4===e.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=e}).then(this.setPageSize)},a.prototype.setPageSize=function(e){function t(e,t){return Math.floor(e*t/72*96)}return this.then(function(){(e=e||E$1.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(e.inner={width:e.width-this.opt.margin[1]-this.opt.margin[3],height:e.height-this.opt.margin[0]-this.opt.margin[2]},e.inner.px={width:t(e.inner.width,e.k),height:t(e.inner.height,e.k)},e.inner.ratio=e.inner.height/e.inner.width),this.prop.pageSize=e})},a.prototype.setProgress=function(e,t,n,r){return null!=e&&(this.progress.val=e),null!=t&&(this.progress.state=t),null!=n&&(this.progress.n=n),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},a.prototype.updateProgress=function(e,t,n,r){return this.setProgress(e?this.progress.val+e:null,t||null,n?this.progress.n+n:null,r?this.progress.stack.concat(r):null)},a.prototype.then=function(e,t){var n=this;return this.thenCore(e,t,function(e,t){return n.updateProgress(null,null,1,[e]),Promise.prototype.then.call(this,function(t){return n.updateProgress(null,e),t}).then(e,t).then(function(e){return n.updateProgress(1),e})})},a.prototype.thenCore=function(e,t,n){n=n||Promise.prototype.then;var r=this;e&&(e=e.bind(r)),t&&(t=t.bind(r));var o=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?r:a.convert(Object.assign({},r),Promise.prototype),i=n.call(o,e,t);return a.convert(i,r.__proto__)},a.prototype.thenExternal=function(e,t){return Promise.prototype.then.call(this,e,t)},a.prototype.thenList=function(e){var t=this;return e.forEach(function(e){t=t.thenCore(e)}),t},a.prototype.catch=function(e){e&&(e=e.bind(this));var t=Promise.prototype.catch.call(this,e);return a.convert(t,this)},a.prototype.catchExternal=function(e){return Promise.prototype.catch.call(this,e)},a.prototype.error=function(e){return this.then(function(){throw new Error(e)})},a.prototype.using=a.prototype.set,a.prototype.saveAs=a.prototype.save,a.prototype.export=a.prototype.output,a.prototype.run=a.prototype.then,E$1.getPageSize=function(e,t,n){if("object"===_typeof(e)){var r=e;e=r.orientation,t=r.unit||t,n=r.format||n}t=t||"mm",n=n||"a4",e=(""+(e||"P")).toLowerCase();var o,i=(""+n).toLowerCase(),a={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(t){case"pt":o=1;break;case"mm":o=72/25.4;break;case"cm":o=72/2.54;break;case"in":o=72;break;case"px":o=.75;break;case"pc":case"em":o=12;break;case"ex":o=6;break;default:throw"Invalid unit: "+t}var s,l=0,c=0;if(a.hasOwnProperty(i))l=a[i][1]/o,c=a[i][0]/o;else try{l=n[1],c=n[0]}catch(u){throw new Error("Invalid format: "+n)}if("p"===e||"portrait"===e)e="p",c>l&&(s=c,c=l,l=s);else{if("l"!==e&&"landscape"!==e)throw"Invalid orientation: "+e;e="l",l>c&&(s=c,c=l,l=s)}return{width:c,height:l,unit:t,k:o,orientation:e}},e.html=function(e,t){(t=t||{}).callback=t.callback||function(){},t.html2canvas=t.html2canvas||{},t.html2canvas.canvas=t.html2canvas.canvas||this.canvas,t.jsPDF=t.jsPDF||this,t.fontFaces=t.fontFaces?t.fontFaces.map(Ct$1):null;var n=new a(t);return t.worker?n:n.from(e).doCallback()}}(E$1.API),E$1.API.addJS=function(e){return Ut$1=e,this.internal.events.subscribe("postPutResources",function(){Tt$1=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Tt$1+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),zt$1=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Ut$1+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==Tt$1&&void 0!==zt$1&&this.internal.out("/Names <</JavaScript "+Tt$1+" 0 R>>")}),this},
|
|
335
335
|
/**
|
|
336
336
|
* @license
|
|
337
337
|
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
|
|
@@ -368,7 +368,7 @@ function(e){e.processWEBP=function(t,n,r,o){var i=new le$1(t),a=i.width,s=i.heig
|
|
|
368
368
|
* Licensed under the MIT License.
|
|
369
369
|
* http://opensource.org/licenses/mit-license
|
|
370
370
|
*/
|
|
371
|
-
function(e){var t=function(e){for(var t=e.length,n=new Uint8Array(t),r=0;r<t;r++)n[r]=e.charCodeAt(r);return n};e.API.events.push(["addFont",function(n){var r,o,i=void 0,a=n.font,s=n.instance;if(!a.isStandardFont){if(void 0===s)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");if("string"!=typeof(i=!1===s.existsFileInVFS(a.postScriptName)?s.loadFile(a.postScriptName):s.getFileFromVFS(a.postScriptName)))throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");r=a,o=/^\x00\x01\x00\x00/.test(o=i)?t(o):t(f$2(o)),r.metadata=e.API.TTFFont.open(o),r.metadata.Unicode=r.metadata.Unicode||{encoding:{},kerning:{},widths:[]},r.metadata.glyIdsUsed=[0]}}])}(E$1),E$1.API.addSvgAsImage=function(e,t,n,r,o,i,a,s){if(isNaN(t)||isNaN(n))throw o$2.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(o))throw o$2.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var l=document.createElement("canvas");l.width=r,l.height=o;var c=l.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,l.width,l.height);var u={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return(i$2.canvg?Promise.resolve(i$2.canvg):__vitePreload(()=>import("./index.es-
|
|
371
|
+
function(e){var t=function(e){for(var t=e.length,n=new Uint8Array(t),r=0;r<t;r++)n[r]=e.charCodeAt(r);return n};e.API.events.push(["addFont",function(n){var r,o,i=void 0,a=n.font,s=n.instance;if(!a.isStandardFont){if(void 0===s)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");if("string"!=typeof(i=!1===s.existsFileInVFS(a.postScriptName)?s.loadFile(a.postScriptName):s.getFileFromVFS(a.postScriptName)))throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");r=a,o=/^\x00\x01\x00\x00/.test(o=i)?t(o):t(f$2(o)),r.metadata=e.API.TTFFont.open(o),r.metadata.Unicode=r.metadata.Unicode||{encoding:{},kerning:{},widths:[]},r.metadata.glyIdsUsed=[0]}}])}(E$1),E$1.API.addSvgAsImage=function(e,t,n,r,o,i,a,s){if(isNaN(t)||isNaN(n))throw o$2.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(o))throw o$2.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var l=document.createElement("canvas");l.width=r,l.height=o;var c=l.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,l.width,l.height);var u={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return(i$2.canvg?Promise.resolve(i$2.canvg):__vitePreload(()=>import("./index.es-Du6U2Hyj.js"),[])).catch(function(e){return Promise.reject(new Error("Could not load canvg: "+e))}).then(function(e){return e.default?e.default:e}).then(function(t){return t.fromString(c,e,u)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(e){return e.render(u)}).then(function(){d.addImage(l.toDataURL("image/jpeg",1),t,n,r,o,a,s)})},E$1.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var o=0;o<this.internal.pages[r].length;o++)this.internal.pages[r][o]=this.internal.pages[r][o].replace(t,n);return this},E$1.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var r,o,i,a={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},s=Object.keys(a),l=[],c=0,u=0,d=0;function p(e,t){var n,r=!1;for(n=0;n<e.length;n+=1)e[n]===t&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(a)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===t){var h=s.length;for(d=0;d<h;d+=1)n[s[d]].value=n[s[d]].defaultValue,n[s[d]].explicitSet=!1}if("object"===_typeof(e))for(o in e)if(i=e[o],p(s,o)&&void 0!==i){if("boolean"===n[o].type&&"boolean"==typeof i)n[o].value=i;else if("name"===n[o].type&&p(n[o].valueSet,i))n[o].value=i;else if("integer"===n[o].type&&Number.isInteger(i))n[o].value=i;else if("array"===n[o].type){for(c=0;c<i.length;c+=1)if(r=!0,1===i[c].length&&"number"==typeof i[c][0])l.push(String(i[c]-1));else if(i[c].length>1){for(u=0;u<i[c].length;u+=1)"number"!=typeof i[c][u]&&(r=!1);!0===r&&l.push([i[c][0]-1,i[c][1]-1].join(" "))}n[o].value="["+l.join(" ")+"]"}else n[o].value=n[o].defaultValue;n[o].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){var e,t=[];for(e in n)!0===n[e].explicitSet&&("name"===n[e].type?t.push("/"+e+" /"+n[e].value):t.push("/"+e+" "+n[e].value));0!==t.length&&this.internal.write("/ViewerPreferences\n<<\n"+t.join("\n")+"\n>>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
|
|
372
372
|
/** ====================================================================
|
|
373
373
|
* @license
|
|
374
374
|
* jsPDF XMP metadata plugin
|
|
@@ -1536,7 +1536,7 @@ o.r(i);var e=o(
|
|
|
1536
1536
|
/*! ./plugin/pagebreaks.js */
|
|
1537
1537
|
"./src/plugin/pagebreaks.js"),o(
|
|
1538
1538
|
/*! ./plugin/hyperlinks.js */
|
|
1539
|
-
"./src/plugin/hyperlinks.js");var t=function e(t,n){var r=new e.Worker(n);return t?r.from(t).save():r};t.Worker=e.default,i.default=t}(),i=i.default}()},html2pdf$1.exports=factory2(require$$0$2,requireHtml2canvas());var html2pdfExports=html2pdf$1.exports;const html2pdf=getDefaultExportFromCjs$1(html2pdfExports),getError=()=>new Error("Node APIs are not available in browser context."),throwForSync=()=>{throw getError()},fs={access:(e,t)=>t(getError()),accessSync:throwForSync,readFile:(e,t,n)=>n(getError()),readFileSync:throwForSync},os={};var helpers$2={},shared={},hasRequiredShared,micromarkHelpers,hasRequiredMicromarkHelpers,hasRequiredHelpers;function requireShared(){return hasRequiredShared||(hasRequiredShared=1,shared.flatTokensSymbol=Symbol("flat-tokens"),shared.htmlFlowSymbol=Symbol("html-flow"),shared.newLineRe=/\r\n?|\n/g,shared.nextLinesRe=/[\r\n][\s\S]*$/),shared}function requireMicromarkHelpers(){if(hasRequiredMicromarkHelpers)return micromarkHelpers;hasRequiredMicromarkHelpers=1;const{flatTokensSymbol:e,htmlFlowSymbol:t}=requireShared();function n(e){return Boolean(e[t])}function r(e,t,n){const r=[],o=[{array:e,index:0}];for(;o.length>0;){const e=o[o.length-1],{array:i,index:a}=e;if(a<i.length){const a=i[e.index++];t(a)&&r.push(a);const{children:s}=a;if(s.length>0){const e=n?n(a):s;o.push({array:e,index:0})}}else o.pop()}return r}function o(t,o,i){const a=e=>o.includes(e.type)&&(i||!n(e)),s=t[e];return s?s.filter(a):r(t,a)}function i(e,t){let n=Array.isArray(e)?e:[e];for(const r of t){const e=e=>Array.isArray(r)?r.includes(e.type):r===e.type;n=n.flatMap(t=>t.children.filter(e))}return n}const a=/^#tab\//;return micromarkHelpers={addRangeToSet:function(e,t,n){for(let r=t;r<=n;r++)e.add(r)},filterByPredicate:r,filterByTypes:o,getBlockQuotePrefixText:function(e,t,n=1){return o(e,["blockQuotePrefix","linePrefix"]).filter(e=>e.startLine===t).map(e=>e.text).join("").trimEnd().concat("\n").repeat(n)},getDescendantsByType:i,getHeadingLevel:function(e){let t=1;const n=e.children.find(e=>["atxHeadingSequence","setextHeadingLine"].includes(e.type)),{text:r}=n;return"#"===r[0]?t=Math.min(r.length,6):"-"===r[0]&&(t=2),t},getHeadingStyle:function(e){return"setextHeading"===e.type?"setext":1===e.children.filter(e=>"atxHeadingSequence"===e.type).length?"atx":"atx_closed"},getHeadingText:function(e){return i(e,[["atxHeadingText","setextHeadingText"]]).flatMap(e=>e.children.filter(e=>"htmlText"!==e.type)).map(e=>e.text).join("").replace(/[\r\n]+/g," ")||""},getHtmlTagInfo:function(e){const t=/^<([^!>][^/\s>]*)/;if("htmlText"===e.type){const n=t.exec(e.text);if(n){const e=n[1],t=e.startsWith("/");return{close:t,name:t?e.slice(1):e}}}return null},getParentOfType:function(e,t){let n=e;for(;(n=n.parent)&&!t.includes(n.type););return n},inHtmlFlow:n,isDocfxTab:function(e){if("atxHeading"===(null==e?void 0:e.type)){const t=i(e,["atxHeadingText"]);if(1===t.length&&1===t[0].children.length&&"link"===t[0].children[0].type){const e=o(t[0].children[0].children,["resourceDestinationString"]);return 1===e.length&&a.test(e[0].text)}}return!1},isHtmlFlowComment:function(e){const{text:t,type:n}=e;if("htmlFlow"===n&&t.startsWith("\x3c!--")&&t.endsWith("--\x3e")){const e=t.slice(4,-3);return!e.startsWith(">")&&!e.startsWith("->")&&!e.endsWith("-")}return!1},nonContentTokens:new Set(["blockQuoteMarker","blockQuotePrefix","blockQuotePrefixWhitespace","lineEnding","lineEndingBlank","linePrefix","listItemIndent","undefinedReference","undefinedReferenceCollapsed","undefinedReferenceFull","undefinedReferenceShortcut"])},micromarkHelpers}function requireHelpers(){if(hasRequiredHelpers)return helpers$2;hasRequiredHelpers=1;const e=requireMicromarkHelpers(),{newLineRe:t,nextLinesRe:n}=requireShared();helpers$2.newLineRe=t,helpers$2.nextLinesRe=n,helpers$2.frontMatterRe=/((^---[^\S\r\n\u2028\u2029]*$[\s\S]+?^---\s*)|(^\+\+\+[^\S\r\n\u2028\u2029]*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{[^\S\r\n\u2028\u2029]*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m;helpers$2.inlineCommentStartRe=/(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi,helpers$2.endOfLineHtmlEntityRe=/&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/,helpers$2.endOfLineGemojiCodeRe=/:(?:[abmovx]|[-+]1|100|1234|(?:1st|2nd|3rd)_place_medal|8ball|clock\d{1,4}|e-mail|non-potable_water|o2|t-rex|u5272|u5408|u55b6|u6307|u6708|u6709|u6e80|u7121|u7533|u7981|u7a7a|[a-z]{2,15}2?|[a-z]{1,14}(?:_[a-z\d]{1,16})+):$/;const r=".,;:!?。,;:!?";function o(e){return!!e&&Object.getPrototypeOf(e)===URL.prototype}helpers$2.allPunctuation=r,helpers$2.allPunctuationNoQuestion=r.replace(/[??]/gu,""),helpers$2.isNumber=function(e){return"number"==typeof e},helpers$2.isString=function(e){return"string"==typeof e},helpers$2.isEmptyString=function(e){return 0===e.length},helpers$2.isObject=function(e){return!!e&&"object"==typeof e&&!Array.isArray(e)},helpers$2.isUrl=o,helpers$2.cloneIfArray=function(e){return Array.isArray(e)?[...e]:e},helpers$2.cloneIfUrl=function(e){return o(e)?new URL(e):e},helpers$2.getHtmlAttributeRe=function(e){return new RegExp(`\\s${e}\\s*=\\s*['"]?([^'"\\s>]*)`,"iu")},helpers$2.isBlankLine=function(e){const t="--\x3e";return!e||!e.trim()||!(e=>{for(;;){const n=e.indexOf("\x3c!--"),r=e.indexOf(t);if(-1!==r&&(-1===n||r<n))e=e.slice(r+3);else if(-1!==n&&-1!==r)e=e.slice(0,n)+e.slice(r+3);else{if(-1===n||-1!==r)return e;e=e.slice(0,n)}}})(e).replace(/>/g,"").trim()};const i="\x3c!--",a=/^ *\|/,s=/[^\r\n]/g,l=/[^ \r\n]/g,c=/ +[\r\n]/g,u=e=>e.replace(s,".");function d(e,t,n){return e.length<=30||(e=t&&n?e.slice(0,15)+"..."+e.slice(-15):n?"..."+e.slice(-30):e.slice(0,30)+"..."),e}function p(e,t,n,r,o,i){e({lineNumber:t,detail:n,context:r,range:o,fixInfo:i})}helpers$2.clearHtmlCommentText=function(e){let t=0;for(;-1!==(t=e.indexOf(i,t));){const n=e.indexOf("--\x3e",t+2);if(-1===n)break;if(n>t+4){const r=e.slice(t+4,n),o=e.lastIndexOf("\n",t)+1,i=e.slice(o,t),s=0===i.trim().length,d=a.test(i)&&r.includes("\n");if(s||!(d||r.startsWith(">")||r.startsWith("->")||r.endsWith("-")||r.includes("--"))){const o=r.replace(l,".").replace(c,u);e=e.slice(0,t+4)+o+e.slice(n)}}t=n+3}return e},helpers$2.escapeForRegExp=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},helpers$2.ellipsify=d,helpers$2.addError=p,helpers$2.addErrorDetailIf=function(e,t,n,r,o,i,a,s){n!==r&&p(e,t,"Expected: "+n+"; Actual: "+r+(o?"; "+o:""),i,a,s)},helpers$2.addErrorContext=function(e,n,r,o,i,a,s){p(e,n,void 0,r=d(r.replace(t,"\n"),o,i),a,s)};const h=(e,t,n,r)=>e<n||e===n&&t<=r;return helpers$2.hasOverlap=function(e,t){const n=h(e.startLine,e.startColumn,t.startLine,t.startColumn),r=n?e:t,o=n?t:e;return h(o.startLine,o.startColumn,r.endLine,r.endColumn)},helpers$2.frontMatterHasTitle=function(e,t){const n=void 0!==t&&!t,r=new RegExp(String(t||'^\\s*"?title"?\\s*[:=]'),"i");return!n&&e.some(e=>r.test(e))},helpers$2.getReferenceLinkImageData=function(t){var n;const r=e=>e.toLowerCase().trim().replace(/\s+/g," "),o=e=>null==e?void 0:e.children.filter(e=>"blockQuotePrefix"!==e.type).map(e=>e.text).join(""),i=new Map,a=new Map,s=(e,t,n)=>{const o=[e.startLine-1,e.startColumn-1,e.text.length],s=r(t),l=n?a:i,c=l.get(s)||[];c.push(o),l.set(s,c)},l=new Map,c=[],u=[],d=e.filterByTypes(t,["definition","gfmFootnoteDefinition","definitionLabelString","gfmFootnoteDefinitionLabelString","gfmFootnoteCall","image","link","undefinedReferenceCollapsed","undefinedReferenceFull","undefinedReferenceShortcut"]);for(const p of d){let t="";switch(p.type){case"definition":case"gfmFootnoteDefinition":for(let e=p.startLine;e<=p.endLine;e++)c.push(e-1);break;case"gfmFootnoteDefinitionLabelString":t="^";case"definitionLabelString":{const o=r(`${t}${p.text}`);if(l.has(o))u.push([o,p.startLine-1]);else{const t=e.getParentOfType(p,["definition"]),r=t&&(null==(n=e.getDescendantsByType(t,["definitionDestination","definitionDestinationRaw","definitionDestinationString"])[0])?void 0:n.text);l.set(o,[p.startLine-1,r])}}break;case"gfmFootnoteCall":case"image":case"link":{let t=1===p.children.length;const n=2===p.children.length&&!p.children.some(e=>"resource"===e.type),[r]=e.getDescendantsByType(p,["label","labelText"]),[i]=e.getDescendantsByType(p,["reference","referenceString"]);let a=o(r);if(!t&&!n){const[e,n]=p.children.filter(e=>["gfmFootnoteCallMarker","gfmFootnoteCallString"].includes(e.type));e&&n&&(a=`${e.text}${n.text}`,t=!0)}(t||n)&&s(p,o(i)||a,t)}break;case"undefinedReferenceCollapsed":case"undefinedReferenceFull":case"undefinedReferenceShortcut":{const t=e.getDescendantsByType(p,["undefinedReference"])[0].children.map(e=>e.text).join("");s(p,t,"undefinedReferenceShortcut"===p.type)}}}return{references:i,shortcuts:a,definitions:l,duplicateDefinitions:u,definitionLineIndices:c}},helpers$2.getPreferredLineEnding=function(e,n){let r=0,o=0,i=0;const a=e.match(t)||[];for(const t of a)switch(t){case"\r":r++;break;case"\n":o++;break;case"\r\n":i++}let s=null;return s=r||o||i?o>=i&&o>=r?"\n":i>=r?"\r\n":"\r":n&&n.EOL||"\n",s},helpers$2.expandTildePath=function(e,t){const n=t&&t.homedir&&t.homedir();return n?e.replace(/^~($|\/|\\)/,`${n}$1`):e},helpers$2}var helpersExports=requireHelpers(),micromarkHelpersExports=requireMicromarkHelpers();const map$1=new Map;let params;function initialize(e){map$1.clear(),params=e}function micromarkTokens(){return(null==params?void 0:params.parsers.micromark.tokens)||[]}function getCached(e,t){if(map$1.has(e))return map$1.get(e);const n=t();return map$1.set(e,n),n}function filterByTypesCached(e,t){return getCached(JSON.stringify(arguments),()=>micromarkHelpersExports.filterByTypes(micromarkTokens(),e,t))}function getReferenceLinkImageData(){return getCached(getReferenceLinkImageData.name,()=>helpersExports.getReferenceLinkImageData(micromarkTokens()))}const homepage="https://github.com/DavidAnson/markdownlint",version="0.38.0";var markdownit,hasRequiredMarkdownit;function requireMarkdownit(){if(hasRequiredMarkdownit)return markdownit;hasRequiredMarkdownit=1;const{newLineRe:e}=requireHelpers();function t(t,n){const r=/`+/g;let o=null;const i=[];for(;null!==(o=r.exec(t));)i.push([o[0].length,o.index]);const a=[];for(;null!==(o=e.exec(t));)a.push(o.index);let s=0,l=0,c=0;for(let e=0;e<i.length-1;e++){const[r,o]=i[e];if(0===o||"\\"!==t[o-1])for(let u=e+1;u<i.length;u++){const[d,p]=i[u];if(r===d){for(;c<a.length;c++){const e=a[c];if(o<e)break;s++,l=e+1}const i=o-l+r;n(t.slice(o+r,p),s,i,r),e=u;break}}}}function n(e){if(e.attrs){for(const t of e.attrs)Object.freeze(t);Object.freeze(e.attrs)}if(e.children){for(const t of e.children)n(t);Object.freeze(e.children)}e.map&&Object.freeze(e.map),Object.freeze(e)}return markdownit={forEachInlineCodeSpan:t,getMarkdownItTokens:function(r,o,i){const a=r.parse(o,{});return function(r,o){let i=null;const a=r;for(const s of a){if("tr_open"===s.type?i=s.map:"tr_close"===s.type&&(i=null),!s.map&&i&&(s.map=[...i]),s.map)for(s.line=o[s.map[0]],s.lineNumber=s.map[0]+1;s.map[1]&&!(o[s.map[1]-1]||"").trim();)s.map[1]--;if(s.children){const n=[];s.children.some(e=>"code_inline"===e.type)&&t(s.content,t=>{n.push(t.split(e).length-1)});let r=s.lineNumber;for(const e of s.children)e.lineNumber=r,e.line=o[r-1],"softbreak"===e.type||"hardbreak"===e.type?r++:"code_inline"===e.type&&(r+=n.shift())}n(s)}Object.freeze(r)}(a,i),a}}}function requireMarkdownItCjs(){return requireMarkdownit()}var deferRequire={requireMarkdownItCjs:requireMarkdownItCjs};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}"undefined"==typeof __non_webpack_require__||__non_webpack_require__;const md001={names:["MD001","heading-increment"],description:"Heading levels should only increment by one level at a time",tags:["headings"],parser:"micromark",function:function(e,t){let n=Number.MAX_SAFE_INTEGER;for(const r of filterByTypesCached(["atxHeading","setextHeading"])){const e=micromarkHelpersExports.getHeadingLevel(r);e>n&&helpersExports.addErrorDetailIf(t,r.startLine,`h${n+1}`,`h${e}`),n=e}}},md003={names:["MD003","heading-style"],description:"Heading style",tags:["headings"],parser:"micromark",function:function(e,t){let n=String(e.config.style||"consistent");for(const r of filterByTypesCached(["atxHeading","setextHeading"])){const e=micromarkHelpersExports.getHeadingStyle(r);if("consistent"===n&&(n=e),e!==n){const o=micromarkHelpersExports.getHeadingLevel(r)<=2;if(!("setext_with_atx"===n&&(o&&"setext"===e||!o&&"atx"===e))&&!("setext_with_atx_closed"===n&&(o&&"setext"===e||!o&&"atx_closed"===e))){let i=n;"setext_with_atx"===n?i=o?"setext":"atx":"setext_with_atx_closed"===n&&(i=o?"setext":"atx_closed"),helpersExports.addErrorDetailIf(t,r.startLine,i,e)}}}}},markerToStyle={"-":"dash","+":"plus","*":"asterisk"},styleToMarker={dash:"-",plus:"+",asterisk:"*"},differentItemStyle={dash:"plus",plus:"asterisk",asterisk:"dash"},validStyles=new Set(["asterisk","consistent","dash","plus","sublist"]),md004={names:["MD004","ul-style"],description:"Unordered list style",tags:["bullet","ul"],parser:"micromark",function:function(e,t){const n=String(e.config.style||"consistent");let r=validStyles.has(n)?n:"dash";const o=[];for(const i of filterByTypesCached(["listUnordered"])){let e=0;if("sublist"===n){let t=i;for(;t=micromarkHelpersExports.getParentOfType(t,["listOrdered","listUnordered"]);)e++}const a=micromarkHelpersExports.getDescendantsByType(i,["listItemPrefix","listItemMarker"]);for(const i of a){const a=markerToStyle[i.text];"sublist"===n?(o[e]||(o[e]=a===o[e-1]?differentItemStyle[a]:a),r=o[e]):"consistent"===r&&(r=a);const s=i.startColumn,l=i.endColumn-i.startColumn;helpersExports.addErrorDetailIf(t,i.startLine,r,a,void 0,void 0,[s,l],{editColumn:s,deleteCount:l,insertText:styleToMarker[r]})}}}},md005={names:["MD005","list-indent"],description:"Inconsistent indentation for list items at the same level",tags:["bullet","ul","indentation"],parser:"micromark",function:function(e,t){for(const n of filterByTypesCached(["listOrdered","listUnordered"])){const e=n.startColumn-1;let r=0,o=!1;const i=n.children.filter(e=>"listItemPrefix"===e.type);for(const a of i){const i=a.startLine,s=a.startColumn-1,l=[1,a.endColumn-1];if("listUnordered"===n.type)helpersExports.addErrorDetailIf(t,i,e,s,void 0,void 0,l);else{const n=a.text.trim().length,c=a.startColumn+n-1;if(r=r||c,e!==s||o)if(r===c)o=!0;else{const a=o?`Expected: (${r}); Actual: (${c})`:`Expected: ${e}; Actual: ${s}`,u=o?r-n:e,d=o?c-n:s;helpersExports.addError(t,i,a,void 0,l,{editColumn:Math.min(d,u)+1,deleteCount:Math.max(d-u,0),insertText:"".padEnd(Math.max(u-d,0))})}}}}}},unorderedListTypes=["blockQuotePrefix","listItemPrefix","listUnordered"],unorderedParentTypes=["blockQuote","listOrdered","listUnordered"],md007={names:["MD007","ul-indent"],description:"Unordered list indentation",tags:["bullet","ul","indentation"],parser:"micromark",function:function(e,t){const n=Number(e.config.indent||2),r=!!e.config.start_indented,o=Number(e.config.start_indent||n),i=new Map;let a=null;const s=filterByTypesCached(unorderedListTypes);for(const l of s){const{endColumn:e,parent:s,startColumn:c,startLine:u,type:d}=l;if("blockQuotePrefix"===d)a=l;else if("listUnordered"===d){let e=0,t=l;for(;t=micromarkHelpersExports.getParentOfType(t,unorderedParentTypes);){if("listUnordered"!==t.type){"listOrdered"===t.type&&(e=-1);break}e++}e>=0&&i.set(l,e)}else{const l=i.get(s);if(void 0!==l){const i=(r?o:0)+l*n,s=c-1-((null==a?void 0:a.endLine)===u?a.endColumn-1:0),d=[1,e-1],p={editColumn:c-s,deleteCount:Math.max(s-i,0),insertText:"".padEnd(Math.max(i-s,0))};helpersExports.addErrorDetailIf(t,u,i,s,void 0,void 0,d,p)}}}}},md009={names:["MD009","no-trailing-spaces"],description:"Trailing spaces",tags:["whitespace"],parser:"micromark",function:function(e,t){let n=e.config.br_spaces;n=Number(void 0===n?2:n);const r=!!e.config.list_item_empty_lines,o=!!e.config.strict,i=new Set;for(const u of filterByTypesCached(["codeFenced"]))micromarkHelpersExports.addRangeToSet(i,u.startLine+1,u.endLine-1);for(const u of filterByTypesCached(["codeIndented"]))micromarkHelpersExports.addRangeToSet(i,u.startLine,u.endLine);const a=new Set;if(r)for(const u of filterByTypesCached(["listOrdered","listUnordered"])){micromarkHelpersExports.addRangeToSet(a,u.startLine,u.endLine);let e=!0;for(let t=u.children.length-1;t>=0;t--){const n=u.children[t];switch(n.type){case"content":e=!1;break;case"listItemIndent":e&&a.delete(n.startLine);break;case"listItemPrefix":e=!0}}}const s=new Set,l=new Set;if(o){for(const e of filterByTypesCached(["paragraph"]))micromarkHelpersExports.addRangeToSet(s,e.startLine,e.endLine-1);for(const e of filterByTypesCached(["codeText"]))micromarkHelpersExports.addRangeToSet(l,e.startLine,e.endLine-1)}const c=n<2?0:n;for(let u=0;u<e.lines.length;u++){const n=e.lines[u],r=u+1,d=n.length-n.trimEnd().length;if(d&&!i.has(r)&&!a.has(r)&&(c!==d||o&&(!s.has(r)||l.has(r)))){const e=n.length-d+1;helpersExports.addError(t,r,"Expected: "+(0===c?"":"0 or ")+c+"; Actual: "+d,void 0,[e,d],{editColumn:e,deleteCount:d})}}}},tabRe=/\t+/g,md010={names:["MD010","no-hard-tabs"],description:"Hard tabs",tags:["whitespace","hard_tab"],parser:"micromark",function:function(e,t){const n=e.config.code_blocks,r=void 0===n||!!n,o=new Set((e.config.ignore_code_languages||[]).map(e=>e.toLowerCase())),i=e.config.spaces_per_tab,a=void 0===i?1:Math.max(0,Number(i)),s=[];r?o.size>0&&s.push("codeFenced"):s.push("codeFenced","codeIndented","codeText");const l=filterByTypesCached(s).filter(e=>{if("codeFenced"===e.type&&o.size>0){return micromarkHelpersExports.getDescendantsByType(e,["codeFencedFence","codeFencedFenceInfo"]).every(e=>o.has(e.text.toLowerCase()))}return!0}).map(e=>{const{type:t,startLine:n,startColumn:r,endLine:o,endColumn:i}=e,a="codeFenced"===t;return{startLine:n+(a?1:0),startColumn:a?0:r,endLine:o-(a?1:0),endColumn:a?Number.MAX_SAFE_INTEGER:i}});for(let c=0;c<e.lines.length;c++){const n=e.lines[c];let r=null;for(;null!==(r=tabRe.exec(n));){const e=c+1,n=r.index+1,o=r[0].length,i={startLine:e,startColumn:n,endLine:e,endColumn:n+o-1};l.some(e=>helpersExports.hasOverlap(e,i))||helpersExports.addError(t,e,"Column: "+n,void 0,[n,o],{editColumn:n,deleteCount:o,insertText:"".padEnd(o*a)})}}}},reversedLinkRe=/(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)\](?!\()/g,md011={names:["MD011","no-reversed-links"],description:"Reversed link syntax",tags:["links"],parser:"micromark",function:function(e,t){const n=new Set;for(const o of filterByTypesCached(["codeFenced","codeIndented"]))micromarkHelpersExports.addRangeToSet(n,o.startLine,o.endLine);const r=filterByTypesCached(["codeText"]);for(const[o,i]of e.lines.entries()){const e=o+1;if(!n.has(e)){let n=null;for(;null!==(n=reversedLinkRe.exec(i));){const[o,i,a,s]=n;if(!a.endsWith("\\")&&!s.endsWith("\\")){const l=n.index+i.length+1,c=n[0].length-i.length,u={startLine:e,startColumn:l,endLine:e,endColumn:l+c-1};r.some(e=>helpersExports.hasOverlap(e,u))||helpersExports.addError(t,e,o.slice(i.length),void 0,[l,c],{editColumn:l,deleteCount:c,insertText:`[${a}](${s})`})}}}}}},md012={names:["MD012","no-multiple-blanks"],description:"Multiple consecutive blank lines",tags:["whitespace","blank_lines"],parser:"micromark",function:function(e,t){const n=Number(e.config.maximum||1),{lines:r}=e,o=new Set;for(const a of filterByTypesCached(["codeFenced","codeIndented"]))micromarkHelpersExports.addRangeToSet(o,a.startLine,a.endLine);let i=0;for(const[a,s]of r.entries()){i=o.has(a+1)||s.trim().length>0?0:i+1,n<i&&helpersExports.addErrorDetailIf(t,a+1,n,i,void 0,void 0,void 0,{deleteCount:-1})}}},longLineRePrefix="^.{",longLineRePostfixRelaxed="}.*\\s.*$",longLineRePostfixStrict="}.+$",sternModeRe=/^(?:[#>\s]*\s)?\S*$/,md013={names:["MD013","line-length"],description:"Line length",tags:["line_length"],parser:"micromark",function:function(e,t){const n=Number(e.config.line_length||80),r=Number(e.config.heading_line_length||n),o=Number(e.config.code_block_line_length||n),i=!!e.config.strict,a=!!e.config.stern,s=i||a?longLineRePostfixStrict:longLineRePostfixRelaxed,l=new RegExp(longLineRePrefix+n+s),c=new RegExp(longLineRePrefix+r+s),u=new RegExp(longLineRePrefix+o+s),d=e.config.code_blocks,p=void 0===d||!!d,h=e.config.tables,f=void 0===h||!!h,A=e.config.headings,m=void 0===A||!!A,g=new Set;for(const $ of filterByTypesCached(["atxHeading","setextHeading"]))micromarkHelpersExports.addRangeToSet(g,$.startLine,$.endLine);const y=new Set;for(const $ of filterByTypesCached(["codeFenced","codeIndented"]))micromarkHelpersExports.addRangeToSet(y,$.startLine,$.endLine);const v=new Set;for(const $ of filterByTypesCached(["table"]))micromarkHelpersExports.addRangeToSet(v,$.startLine,$.endLine);const b=new Set;for(const $ of filterByTypesCached(["autolink","image","link","literalAutolink"]))micromarkHelpersExports.addRangeToSet(b,$.startLine,$.endLine);const x=new Set;for(const $ of filterByTypesCached(["paragraph"]))for(const e of micromarkHelpersExports.getDescendantsByType($,["data"]))micromarkHelpersExports.addRangeToSet(x,e.startLine,e.endLine);const w=new Set;for(const $ of b)x.has($)||w.add($);const C=new Set(getReferenceLinkImageData().definitionLineIndices);for(let $=0;$<e.lines.length;$++){const s=e.lines[$],d=$+1,h=g.has(d),A=y.has(d),b=v.has(d),x=A?o:h?r:n,_=A?u:h?c:l;!p&&A||!f&&b||!m&&h||C.has($)||!i&&(a&&sternModeRe.test(s)||w.has(d))||!_.test(s)||helpersExports.addErrorDetailIf(t,d,x,s.length,void 0,void 0,[x+1,s.length-x])}}},dollarCommandRe=/^(\s*)(\$\s+)/,md014={names:["MD014","commands-show-output"],description:"Dollar signs used before commands without showing output",tags:["code"],parser:"micromark",function:function(e,t){for(const n of filterByTypesCached(["codeFenced","codeIndented"])){const e=n.children.filter(e=>"codeFlowValue"===e.type),r=e.map(e=>({result:e.text.match(dollarCommandRe),startColumn:e.startColumn,startLine:e.startLine,text:e.text})).filter(e=>e.result);if(r.length===e.length)for(const n of r){const e=n.startColumn+n.result[1].length,r=n.result[2].length;helpersExports.addErrorContext(t,n.startLine,n.text,void 0,void 0,[e,r],{editColumn:e,deleteCount:r})}}}},md018={names:["MD018","no-missing-space-atx"],description:"No space after hash on atx style heading",tags:["headings","atx","spaces"],parser:"micromark",function:function(e,t){const{lines:n}=e,r=new Set;for(const o of filterByTypesCached(["codeFenced","codeIndented","htmlFlow"]))micromarkHelpersExports.addRangeToSet(r,o.startLine,o.endLine);for(const[o,i]of n.entries())if(!r.has(o+1)&&/^#+[^# \t]/.test(i)&&!/#\s*$/.test(i)&&!i.startsWith("#️⃣")){const e=/^#+/.exec(i)[0].length;helpersExports.addErrorContext(t,o+1,i.trim(),void 0,void 0,[1,e+1],{editColumn:e+1,insertText:" "})}}};function validateHeadingSpaces(e,t,n){const{children:r,startLine:o,text:i}=t;let a=n>0?0:r.length-1;for(;r[a]&&"atxHeadingSequence"!==r[a].type;)a+=n;const s=r[a],l=r[a+n];if("atxHeadingSequence"===(null==s?void 0:s.type)&&"whitespace"===(null==l?void 0:l.type)&&l.text.length>1){const t=l.startColumn+1,r=l.endColumn-t;helpersExports.addErrorContext(e,o,i.trim(),n>0,n<0,[t,r],{editColumn:t,deleteCount:r})}}const md019md021=[{names:["MD019","no-multiple-space-atx"],description:"Multiple spaces after hash on atx style heading",tags:["headings","atx","spaces"],parser:"micromark",function:function(e,t){const n=filterByTypesCached(["atxHeading"]).filter(e=>"atx"===micromarkHelpersExports.getHeadingStyle(e));for(const r of n)validateHeadingSpaces(t,r,1)}},{names:["MD021","no-multiple-space-closed-atx"],description:"Multiple spaces inside hashes on closed atx style heading",tags:["headings","atx_closed","spaces"],parser:"micromark",function:function(e,t){const n=filterByTypesCached(["atxHeading"]).filter(e=>"atx_closed"===micromarkHelpersExports.getHeadingStyle(e));for(const r of n)validateHeadingSpaces(t,r,1),validateHeadingSpaces(t,r,-1)}}],md020={names:["MD020","no-missing-space-closed-atx"],description:"No space inside hashes on closed atx style heading",tags:["headings","atx_closed","spaces"],parser:"micromark",function:function(e,t){const{lines:n}=e,r=new Set;for(const o of filterByTypesCached(["codeFenced","codeIndented","htmlFlow"]))micromarkHelpersExports.addRangeToSet(r,o.startLine,o.endLine);for(const[o,i]of n.entries())if(!r.has(o+1)){const e=/^(#+)([ \t]*)([^# \t\\]|[^# \t][^#]*?[^# \t\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(i);if(e){const[,n,{length:r},a,{length:s},l,c,{length:u}]=e,d=n.length,p=c.length,h=!r,f=!s||!!l,A=l?`${l} `:"";if(h||f){const e=h?[1,d+1]:[i.length-u-p,p+1];helpersExports.addErrorContext(t,o+1,i.trim(),h,f,e,{editColumn:1,deleteCount:i.length,insertText:`${n} ${a} ${A}${c}`})}}}}},defaultLines=1,getLinesFunction=e=>{if(Array.isArray(e)){const t=new Array(6).fill(defaultLines);for(const[n,r]of[...e.entries()].slice(0,6))t[n]=r;return e=>t[micromarkHelpersExports.getHeadingLevel(e)-1]}const t=void 0===e?defaultLines:Number(e);return()=>t},md022={names:["MD022","blanks-around-headings"],description:"Headings should be surrounded by blank lines",tags:["headings","blank_lines"],parser:"micromark",function:function(e,t){const n=getLinesFunction(e.config.lines_above),r=getLinesFunction(e.config.lines_below),{lines:o}=e,i=filterByTypesCached(["blockQuotePrefix","linePrefix"]);for(const a of filterByTypesCached(["atxHeading","setextHeading"])){const{startLine:e,endLine:s}=a,l=o[e-1].trim(),c=n(a);if(c>=0){let n=0;for(let t=0;t<c&&helpersExports.isBlankLine(o[e-2-t]);t++)n++;helpersExports.addErrorDetailIf(t,e,c,n,"Above",l,void 0,{insertText:micromarkHelpersExports.getBlockQuotePrefixText(i,e-1,c-n)})}const u=r(a);if(u>=0){let n=0;for(let e=0;e<u&&helpersExports.isBlankLine(o[s+e]);e++)n++;helpersExports.addErrorDetailIf(t,e,u,n,"Below",l,void 0,{lineNumber:s+1,insertText:micromarkHelpersExports.getBlockQuotePrefixText(i,s+1,u-n)})}}}},md023={names:["MD023","heading-start-left"],description:"Headings must start at the beginning of the line",tags:["headings","spaces"],parser:"micromark",function:function(e,t){const n=filterByTypesCached(["atxHeading","linePrefix","setextHeading"]);for(let r=0;r<n.length-1;r++)if("linePrefix"===n[r].type&&"linePrefix"!==n[r+1].type&&n[r].startLine===n[r+1].startLine){const{endColumn:o,startColumn:i,startLine:a}=n[r],s=o-i;helpersExports.addErrorContext(t,a,e.lines[a-1],!0,!1,[i,s],{editColumn:i,deleteCount:s})}}},md024={names:["MD024","no-duplicate-heading"],description:"Multiple headings with the same content",tags:["headings"],parser:"micromark",function:function(e,t){const n=!!e.config.siblings_only||!1,r=[null,[]];let o=1,i=r[o];for(const a of filterByTypesCached(["atxHeading","setextHeading"])){const e=micromarkHelpersExports.getHeadingText(a);if(n){const e=micromarkHelpersExports.getHeadingLevel(a);for(;o<e;)o++,r[o]=[];for(;o>e;)r[o]=[],o--;i=r[e]}i.includes(e)?helpersExports.addErrorContext(t,a.startLine,e.trim()):i.push(e)}}},md025={names:["MD025","single-title","single-h1"],description:"Multiple top-level headings in the same document",tags:["headings"],parser:"micromark",function:function(e,t){const n=Number(e.config.level||1),{tokens:r}=e.parsers.micromark,o=filterByTypesCached(["atxHeading","setextHeading"]).filter(e=>n===micromarkHelpersExports.getHeadingLevel(e)&&!micromarkHelpersExports.isDocfxTab(e));if(o.length>0){const n=helpersExports.frontMatterHasTitle(e.frontMatterLines,e.config.front_matter_title);let i=n;if(!i){i=r.slice(0,r.indexOf(o[0])).every(e=>micromarkHelpersExports.nonContentTokens.has(e.type)||micromarkHelpersExports.isHtmlFlowComment(e))}if(i)for(const e of o.slice(n?0:1))helpersExports.addErrorContext(t,e.startLine,micromarkHelpersExports.getHeadingText(e))}}},md026={names:["MD026","no-trailing-punctuation"],description:"Trailing punctuation in heading",tags:["headings"],parser:"micromark",function:function(e,t){let n=e.config.punctuation;n=String(void 0===n?helpersExports.allPunctuationNoQuestion:n);const r=new RegExp("\\s*["+helpersExports.escapeForRegExp(n)+"]+$"),o=filterByTypesCached(["atxHeadingText","setextHeadingText"]);for(const i of o){const{endColumn:e,endLine:n,text:o}=i,a=r.exec(o);if(a&&!helpersExports.endOfLineHtmlEntityRe.test(o)&&!helpersExports.endOfLineGemojiCodeRe.test(o)){const r=a[0],o=r.length,i=e-o;helpersExports.addError(t,n,`Punctuation: '${r}'`,void 0,[i,o],{editColumn:i,deleteCount:o})}}}},listTypes=["listOrdered","listUnordered"],md027={names:["MD027","no-multiple-space-blockquote"],description:"Multiple spaces after blockquote symbol",tags:["blockquote","whitespace","indentation"],parser:"micromark",function:function(e,t){var n,r;const o=e.config.list_items,i=void 0===o||!!o,{tokens:a}=e.parsers.micromark;for(const s of filterByTypesCached(["linePrefix"])){const o=s.parent,l="codeIndented"===(null==o?void 0:o.type),c=(null==o?void 0:o.children)||a;if(!l&&"blockQuotePrefix"===(null==(n=c[c.indexOf(s)-1])?void 0:n.type)&&(i||!listTypes.includes(null==(r=c[c.indexOf(s)+1])?void 0:r.type)&&!micromarkHelpersExports.getParentOfType(s,listTypes))){const{startColumn:n,startLine:r,text:o}=s,{length:i}=o,a=e.lines[r-1];helpersExports.addErrorContext(t,r,a,void 0,void 0,[n,i],{editColumn:n,deleteCount:i})}}}},ignoreTypes=new Set(["lineEnding","listItemIndent","linePrefix"]),md028={names:["MD028","no-blanks-blockquote"],description:"Blank line inside blockquote",tags:["blockquote","whitespace"],parser:"micromark",function:function(e,t){var n;for(const r of filterByTypesCached(["blockQuote"])){const o=[],i=(null==(n=r.parent)?void 0:n.children)||e.parsers.micromark.tokens;for(let e=i.indexOf(r)+1;e<i.length;e++){const n=i[e],{startLine:r,type:a}=n;if("lineEndingBlank"===a)o.push(r);else if(!ignoreTypes.has(a)){if("blockQuote"===a){for(const e of o)helpersExports.addError(t,e);break}break}}}}},listStyleExamples={one:"1/1/1",ordered:"1/2/3",zero:"0/0/0"};function getOrderedListItemValue(e){return Number(micromarkHelpersExports.getDescendantsByType(e,["listItemValue"])[0].text)}const md029={names:["MD029","ol-prefix"],description:"Ordered list item prefix",tags:["ol"],parser:"micromark",function:function(e,t){const n=String(e.config.style||"one_or_ordered");for(const r of filterByTypesCached(["listOrdered"])){const e=micromarkHelpersExports.getDescendantsByType(r,["listItemPrefix"]);let o=1,i=!1;if(e.length>=2){const t=getOrderedListItemValue(e[0]);1===getOrderedListItemValue(e[1])&&0!==t||(i=!0,0===t&&(o=0))}let a=n;"one_or_ordered"===a?a=i?"ordered":"one":"zero"===a?o=0:"one"===a&&(o=1);for(const n of e){const e=getOrderedListItemValue(n);helpersExports.addErrorDetailIf(t,n.startLine,o,e,"Style: "+listStyleExamples[a],void 0,[n.startColumn,n.endColumn-n.startColumn]),"ordered"===a&&o++}}}},md030={names:["MD030","list-marker-space"],description:"Spaces after list markers",tags:["ol","ul","whitespace"],parser:"micromark",function:function(e,t){const n=Number(e.config.ul_single||1),r=Number(e.config.ol_single||1),o=Number(e.config.ul_multi||1),i=Number(e.config.ol_multi||1);for(const a of filterByTypesCached(["listOrdered","listUnordered"])){const e="listOrdered"===a.type,s=a.children.filter(e=>"listItemPrefix"===e.type),l=a.endLine-a.startLine+1===s.length,c=e?l?r:i:l?n:o;for(const n of s){const e=[n.startColumn,n.endColumn-n.startColumn],r=n.children.filter(e=>"listItemPrefixWhitespace"===e.type);for(const n of r){const{endColumn:r,startColumn:o,startLine:i}=n,a=r-o,s={editColumn:o,deleteCount:a,insertText:"".padEnd(c)};helpersExports.addErrorDetailIf(t,i,c,a,void 0,void 0,e,s)}}}}},codeFencePrefixRe=/^(.*?)[`~]/;function addError(e,t,n,r){const o=t[n-1],[,i]=o.match(codeFencePrefixRe)||[],a=void 0===i?void 0:{lineNumber:n+(r?0:1),insertText:`${i.replace(/[^>]/g," ").trim()}\n`};helpersExports.addErrorContext(e,n,o.trim(),void 0,void 0,void 0,a)}const md031={names:["MD031","blanks-around-fences"],description:"Fenced code blocks should be surrounded by blank lines",tags:["code","blank_lines"],parser:"micromark",function:function(e,t){const n=e.config.list_items,r=void 0===n||!!n,{lines:o}=e;for(const i of filterByTypesCached(["codeFenced"]))!r&µmarkHelpersExports.getParentOfType(i,["listOrdered","listUnordered"])||(helpersExports.isBlankLine(o[i.startLine-2])||addError(t,o,i.startLine,!0),helpersExports.isBlankLine(o[i.endLine])||helpersExports.isBlankLine(o[i.endLine-1])||addError(t,o,i.endLine,!1))}},isList=e=>"listOrdered"===e.type||"listUnordered"===e.type,md032={names:["MD032","blanks-around-lists"],description:"Lists should be surrounded by blank lines",tags:["bullet","ul","ol","blank_lines"],parser:"micromark",function:function(e,t){const{lines:n,parsers:r}=e,o=filterByTypesCached(["blockQuotePrefix","linePrefix"]),i=micromarkHelpersExports.filterByPredicate(r.micromark.tokens,isList,e=>isList(e)||"htmlFlow"===e.type?[]:e.children);for(const a of i){const e=a.startLine;helpersExports.isBlankLine(n[e-2])||helpersExports.addErrorContext(t,e,n[e-1].trim(),void 0,void 0,void 0,{insertText:micromarkHelpersExports.getBlockQuotePrefixText(o,e)});const r=micromarkHelpersExports.filterByPredicate(a.children,e=>!micromarkHelpersExports.nonContentTokens.has(e.type),e=>micromarkHelpersExports.nonContentTokens.has(e.type)?[]:e.children);let i=a.endLine;r.length>0&&(i=r[r.length-1].endLine);const s=i;helpersExports.isBlankLine(n[s])||helpersExports.addErrorContext(t,s,n[s-1].trim(),void 0,void 0,void 0,{lineNumber:s+1,insertText:micromarkHelpersExports.getBlockQuotePrefixText(o,s)})}}},md033={names:["MD033","no-inline-html"],description:"Inline HTML",tags:["html"],parser:"micromark",function:function(e,t){let n=e.config.allowed_elements;n=Array.isArray(n)?n:[],n=n.map(e=>e.toLowerCase());for(const r of filterByTypesCached(["htmlText"],!0)){const e=micromarkHelpersExports.getHtmlTagInfo(r);if(e&&!e.close&&!n.includes(e.name.toLowerCase())){const n=[r.startColumn,r.text.replace(helpersExports.nextLinesRe,"").length];helpersExports.addError(t,r.startLine,"Element: "+e.name,void 0,n)}}}},md034={names:["MD034","no-bare-urls"],description:"Bare URL used",tags:["links","url"],parser:"micromark",function:function(e,t){for(const r of(n=e.parsers.micromark.tokens,micromarkHelpersExports.filterByPredicate(n,e=>{var t;if("literalAutolink"===e.type&&!micromarkHelpersExports.inHtmlFlow(e)){const n=null==(t=e.parent)?void 0:t.children,r=null==n?void 0:n.indexOf(e),o=null==n?void 0:n.at(r-1),i=null==n?void 0:n.at(r+1);return!(o&&i&&"data"===o.type&&"data"===i.type&&o.text.endsWith("<")&&i.text.startsWith(">"))}return!1},e=>{const{children:t}=e,n=[];for(let r=0;r<t.length;r++){const e=t[r],o=micromarkHelpersExports.getHtmlTagInfo(e);if(o&&!o.close){let e=1;for(let n=r+1;n<t.length;n++){const i=t[n],a=micromarkHelpersExports.getHtmlTagInfo(i);if(a&&o.name===a.name)if(a.close){if(e--,0===e){r=n;break}}else e++}}else n.push(e)}return n}))){const e=[r.startColumn,r.endColumn-r.startColumn],n={editColumn:e[0],deleteCount:e[1],insertText:`<${r.text}>`};helpersExports.addErrorContext(t,r.startLine,r.text,void 0,void 0,e,n)}var n}},md035={names:["MD035","hr-style"],description:"Horizontal rule style",tags:["hr"],parser:"micromark",function:function(e,t){let n=String(e.config.style||"consistent").trim();const r=filterByTypesCached(["thematicBreak"]);for(const o of r){const{startLine:e,text:r}=o;"consistent"===n&&(n=r),helpersExports.addErrorDetailIf(t,e,n,r)}}},emphasisTypes=[["emphasis","emphasisText"],["strong","strongText"]],isParagraphChildMeaningful=e=>!("htmlText"===e.type||"data"===e.type&&0===e.text.trim().length),md036={names:["MD036","no-emphasis-as-heading"],description:"Emphasis used instead of a heading",tags:["headings","emphasis"],parser:"micromark",function:function(e,t){let n=e.config.punctuation;n=String(void 0===n?helpersExports.allPunctuation:n);const r=new RegExp("["+n+"]$"),o=filterByTypesCached(["paragraph"],!0).filter(e=>{var t,n,r,o,i,a;return"content"===(null==(t=e.parent)?void 0:t.type)&&(!(null==(n=e.parent)?void 0:n.parent)||"htmlFlow"===(null==(o=null==(r=e.parent)?void 0:r.parent)?void 0:o.type)&&!(null==(a=null==(i=e.parent)?void 0:i.parent)?void 0:a.parent))&&1===e.children.filter(isParagraphChildMeaningful).length});for(const i of emphasisTypes){const e=micromarkHelpersExports.getDescendantsByType(o,i);for(const n of e)1!==n.children.length||"data"!==n.children[0].type||r.test(n.text)||helpersExports.addErrorContext(t,n.startLine,n.text)}}},md037={names:["MD037","no-space-in-emphasis"],description:"Spaces inside emphasis markers",tags:["whitespace","emphasis"],parser:"micromark",function:function(e,t){const{lines:n,parsers:r}=e,o=new Map;for(const a of["_","__","___","*","**","***"])o.set(a,[]);const i=micromarkHelpersExports.filterByPredicate(r.micromark.tokens,e=>e.children.some(e=>"data"===e.type));for(const a of i){for(const e of o.values())e.length=0;for(const e of a.children){const{text:t,type:n}=e;if("data"===n&&t.length<=3){const n=o.get(t);n&&!micromarkHelpersExports.inHtmlFlow(e)&&n.push(e)}}for(const e of o.entries()){const[r,o]=e;for(let e=0;e+1<o.length;e+=2){const i=o[e],a=n[i.startLine-1].slice(i.endColumn-1).match(/^\s+\S/);if(a){const[e]=a,n=`${r}${e}`;helpersExports.addError(t,i.startLine,void 0,n,[i.startColumn,n.length],{editColumn:i.endColumn,deleteCount:e.length-1})}const s=o[e+1],l=n[s.startLine-1].slice(0,s.startColumn-1).match(/\S\s+$/);if(l){const[e]=l,n=`${e}${r}`;helpersExports.addError(t,s.startLine,void 0,n,[s.endColumn-n.length,n.length],{editColumn:s.startColumn-(e.length-1),deleteCount:e.length-1})}}}}}},md038={names:["MD038","no-space-in-code"],description:"Spaces inside code span elements",tags:["whitespace","code"],parser:"micromark",function:function(e,t){const n=filterByTypesCached(["codeText"]);for(const r of n){const e=micromarkHelpersExports.getDescendantsByType(r,["codeTextData"]);if(e.length>0){const n=micromarkHelpersExports.getDescendantsByType(r,["codeTextPadding"]),o=n[0],i=e[0],a=/^(\s+)(\S)/.exec(i.text)||[null,"",""],s="`"===a[2],l=a[1].length-(s&&!o?1:0),c=l>0,u=n[n.length-1],d=e[e.length-1],p=/(\S)(\s+)$/.exec(d.text)||[null,"",""],h="`"===p[1],f=p[2].length-(h&&!u?1:0),A=f>0,m=c&&A&&o&&u&&!s&&!h,g=r.text;if(c){const e=(m?o:i).startColumn,n=l+(m?o.text.length:0);helpersExports.addErrorContext(t,i.startLine,g,!0,!1,[e,n],{editColumn:e,deleteCount:n})}if(A){const e=(m?u:d).endColumn,n=f+(m?u.text.length:0);helpersExports.addErrorContext(t,d.endLine,g,!1,!0,[e-n,n],{editColumn:e-n,deleteCount:n})}}}}};function addLabelSpaceError(e,t,n,r){const o=n.text.match(r?/^[^\S\r\n]+/:/[^\S\r\n]+$/),i=o?[r?n.startColumn:n.endColumn-o[0].length,o[0].length]:void 0;helpersExports.addErrorContext(e,r?n.startLine+(o?0:1):n.endLine-(o?0:1),t.text.replace(/\s+/g," "),r,!r,i,i?{editColumn:i[0],deleteCount:i[1]}:void 0)}const md039={names:["MD039","no-space-in-links"],description:"Spaces inside link text",tags:["whitespace","links"],parser:"micromark",function:function(e,t){const n=filterByTypesCached(["label"]).filter(e=>{var t;return"link"===(null==(t=e.parent)?void 0:t.type)});for(const r of n){const e=r.children.filter(e=>"labelText"===e.type);for(const n of e)n.text.trimStart().length!==n.text.length&&addLabelSpaceError(t,r,n,!0),n.text.trimEnd().length!==n.text.length&&addLabelSpaceError(t,r,n,!1)}}},md040={names:["MD040","fenced-code-language"],description:"Fenced code blocks should have a language specified",tags:["code","language"],parser:"micromark",function:function(e,t){var n;let r=e.config.allowed_languages;r=Array.isArray(r)?r:[];const o=!!e.config.language_only,i=filterByTypesCached(["codeFenced"]);for(const a of i){const e=micromarkHelpersExports.getDescendantsByType(a,["codeFencedFence"])[0],{startLine:i,text:s}=e,l=null==(n=micromarkHelpersExports.getDescendantsByType(e,["codeFencedFenceInfo"])[0])?void 0:n.text;l?r.length>0&&!r.includes(l)&&helpersExports.addError(t,i,`"${l}" is not allowed`):helpersExports.addErrorContext(t,i,s),o&µmarkHelpersExports.getDescendantsByType(e,["codeFencedFenceMeta"]).length>0&&helpersExports.addError(t,i,`Info string contains more than language: "${s}"`)}}},headingTagNameRe=/^h[1-6]$/;function getHtmlFlowTagName(e){const{children:t,type:n}=e;if("htmlFlow"===n){const e=micromarkHelpersExports.filterByTypes(t,["htmlText"],!0),n=e.length>0&µmarkHelpersExports.getHtmlTagInfo(e[0]);if(n)return n.name.toLowerCase()}return null}const md041={names:["MD041","first-line-heading","first-line-h1"],description:"First line in a file should be a top-level heading",tags:["headings"],parser:"micromark",function:function(e,t){const n=!!e.config.allow_preamble,r=Number(e.config.level||1),{tokens:o}=e.parsers.micromark;if(!helpersExports.frontMatterHasTitle(e.frontMatterLines,e.config.front_matter_title)){let i=0;for(const e of o){const{startLine:t,type:o}=e;if(!micromarkHelpersExports.nonContentTokens.has(o)&&!micromarkHelpersExports.isHtmlFlowComment(e)){let a=null;if("atxHeading"===o||"setextHeading"===o){micromarkHelpersExports.getHeadingLevel(e)!==r&&(i=t);break}if((a=getHtmlFlowTagName(e))&&headingTagNameRe.test(a)){a!==`h${r}`&&(i=t);break}if(!n){i=t;break}}}i>0&&helpersExports.addErrorContext(t,i,e.lines[i-1])}}},md042={names:["MD042","no-empty-links"],description:"No empty links",tags:["links"],parser:"micromark",function:function(e,t){const{definitions:n}=getReferenceLinkImageData(),r=e=>{const t=n.get(e.text.trim());return t&&"#"===t[1]},o=filterByTypesCached(["link"]);for(const i of o){const e=micromarkHelpersExports.getDescendantsByType(i,["label","labelText"]),n=micromarkHelpersExports.getDescendantsByType(i,["reference"]),o=micromarkHelpersExports.getDescendantsByType(i,["resource"]),a=micromarkHelpersExports.getDescendantsByType(n,["referenceString"]),s=micromarkHelpersExports.getDescendantsByType(o,["resourceDestination",["resourceDestinationLiteral","resourceDestinationRaw"],"resourceDestinationString"]),l=e.length>0,c=n.length>0,u=o.length>0,d=a.length>0,p=s.length>0;let h=!1;l&&(!c&&!u||c&&!d)?h=r(e[0]):d&&!p?h=r(a[0]):!d&&p?h="#"===s[0].text.trim():d||p||(h=!0),h&&helpersExports.addErrorContext(t,i.startLine,i.text,void 0,void 0,[i.startColumn,i.endColumn-i.startColumn])}}},md043={names:["MD043","required-headings"],description:"Required heading structure",tags:["headings"],parser:"micromark",function:function(e,t){const n=e.config.headings;if(!Array.isArray(n))return;const r=e.config.match_case||!1;let o=0,i=!1,a=!1,s=!1;const l=()=>n[o++]||"[None]",c=e=>r?e:e.toLowerCase();for(const d of filterByTypesCached(["atxHeading","setextHeading"]))if(!a){const e=micromarkHelpersExports.getHeadingText(d),n=micromarkHelpersExports.getHeadingLevel(d);s=!0;const r=`${"".padEnd(n,"#")} ${e}`,u=l();if("*"===u){c(l())!==c(r)&&(i=!0,o--)}else"+"===u?i=!0:"?"===u||(c(u)===c(r)?i=!1:i?o--:(helpersExports.addErrorDetailIf(t,d.startLine,u,r),a=!0))}const u=n.length-o;a||!(u>1||1===u&&"*"!==n[o])||!s&&n.every(e=>"*"===e)||helpersExports.addErrorContext(t,e.lines.length,n[o])}},asciiAlpha=regexCheck(/[A-Za-z]/),asciiAlphanumeric=regexCheck(/[\dA-Za-z]/),asciiAtext=regexCheck(/[#-'*+\--9=?A-Z^-~]/);function asciiControl(e){return null!==e&&(e<32||127===e)}const asciiDigit=regexCheck(/\d/),asciiHexDigit=regexCheck(/[\dA-Fa-f]/),asciiPunctuation=regexCheck(/[!-/:-@[-`{-~]/);function markdownLineEnding(e){return null!==e&&e<-2}function markdownLineEndingOrSpace(e){return null!==e&&(e<0||32===e)}function markdownSpace(e){return-2===e||-1===e||32===e}const unicodePunctuation=regexCheck(new RegExp("\\p{P}|\\p{S}","u")),unicodeWhitespace=regexCheck(/\s/);function regexCheck(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function factorySpace(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){if(markdownSpace(r))return e.enter(n),a(r);return t(r)};function a(r){return markdownSpace(r)&&i++<o?(e.consume(r),a):(e.exit(n),t(r))}}function factoryWhitespace(e,t){let n;return function r(o){if(markdownLineEnding(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(markdownSpace(o))return factorySpace(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}}function factoryAttributes(e,t,n,r,o,i,a,s,l,c,u,d,p,h,f){let A,m;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),g};function g(t){return 35===t?(A=a,y(t)):46===t?(A=s,y(t)):f&&markdownSpace(t)?factorySpace(e,g,"whitespace")(t):!f&&markdownLineEndingOrSpace(t)?factoryWhitespace(e,g)(t):null===t||markdownLineEnding(t)||unicodeWhitespace(t)||unicodePunctuation(t)&&45!==t&&95!==t?B(t):(e.enter(i),e.enter(l),e.consume(t),x)}function y(t){const n=A+"Marker";return e.enter(i),e.enter(A),e.enter(n),e.consume(t),e.exit(n),v}function v(t){if(null===t||34===t||35===t||39===t||46===t||60===t||61===t||62===t||96===t||125===t||markdownLineEndingOrSpace(t))return n(t);const r=A+"Value";return e.enter(r),e.consume(t),b}function b(t){if(null===t||34===t||39===t||60===t||61===t||62===t||96===t)return n(t);if(35===t||46===t||125===t||markdownLineEndingOrSpace(t)){const n=A+"Value";return e.exit(n),e.exit(A),e.exit(i),g(t)}return e.consume(t),b}function x(t){return null===t||markdownLineEnding(t)||unicodeWhitespace(t)||unicodePunctuation(t)&&45!==t&&46!==t&&58!==t&&95!==t?(e.exit(l),f&&markdownSpace(t)?factorySpace(e,w,"whitespace")(t):!f&&markdownLineEndingOrSpace(t)?factoryWhitespace(e,w)(t):w(t)):(e.consume(t),x)}function w(t){return 61===t?(e.enter(c),e.consume(t),e.exit(c),C):(e.exit(i),g(t))}function C(t){return null===t||60===t||61===t||62===t||96===t||125===t||f&&markdownLineEnding(t)?n(t):34===t||39===t?(e.enter(u),e.enter(p),e.consume(t),e.exit(p),m=t,_):f&&markdownSpace(t)?factorySpace(e,C,"whitespace")(t):!f&&markdownLineEndingOrSpace(t)?factoryWhitespace(e,C)(t):(e.enter(d),e.enter(h),e.consume(t),m=void 0,$)}function $(t){return null===t||34===t||39===t||60===t||61===t||62===t||96===t?n(t):125===t||markdownLineEndingOrSpace(t)?(e.exit(h),e.exit(d),e.exit(i),g(t)):(e.consume(t),$)}function _(t){return t===m?(e.enter(p),e.consume(t),e.exit(p),e.exit(u),e.exit(i),k):(e.enter(d),S(t))}function S(t){return t===m?(e.exit(d),_(t)):null===t?n(t):markdownLineEnding(t)?f?n(t):factoryWhitespace(e,S)(t):(e.enter(h),e.consume(t),E)}function E(t){return t===m||null===t||markdownLineEnding(t)?(e.exit(h),S(t)):(e.consume(t),E)}function k(e){return 125===e||markdownLineEndingOrSpace(e)?g(e):B(e)}function B(i){return 125===i?(e.enter(o),e.consume(i),e.exit(o),e.exit(r),t):n(i)}}function factoryLabel$1(e,t,n,r,o,i,a){let s,l=0,c=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),u};function u(n){return 93===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),d(n))}function d(t){if(93===t&&!c)return f(t);const n=e.enter("chunkText",{_contentTypeTextTrailing:!0,contentType:"text",previous:s});return s&&(s.next=n),s=n,p(t)}function p(t){return null===t||l>999||91===t&&++c>32?n(t):93!==t||c--?markdownLineEnding(t)?a?n(t):(e.consume(t),e.exit("chunkText"),d):(e.consume(t),92===t?h:p):(e.exit("chunkText"),f(t))}function h(t){return 91===t||92===t||93===t?(e.consume(t),l++,p):p(t)}function f(n){return e.exit(i),e.enter(o),e.consume(n),e.exit(o),e.exit(r),t}}function factoryName(e,t,n,r){const o=this;return function(t){if(null===t||markdownLineEnding(t)||unicodePunctuation(t)||unicodeWhitespace(t))return n(t);return e.enter(r),e.consume(t),i};function i(a){return null===a||markdownLineEnding(a)||unicodeWhitespace(a)||unicodePunctuation(a)&&45!==a&&95!==a?(e.exit(r),45===o.previous||95===o.previous?n(a):t(a)):(e.consume(a),i)}}const directiveContainer={tokenize:tokenizeDirectiveContainer,concrete:!0},label$2={tokenize:tokenizeLabel$2,partial:!0},attributes$2={tokenize:tokenizeAttributes$2,partial:!0},nonLazyLine={tokenize:tokenizeNonLazyLine,partial:!0};function tokenizeDirectiveContainer(e,t,n){const r=this,o=r.events[r.events.length-1],i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0;let a,s=0;return function(t){return e.enter("directiveContainer"),e.enter("directiveContainerFence"),e.enter("directiveContainerSequence"),l(t)};function l(t){return 58===t?(e.consume(t),s++,l):s<3?n(t):(e.exit("directiveContainerSequence"),factoryName.call(r,e,c,n,"directiveContainerName")(t))}function c(t){return 91===t?e.attempt(label$2,u,u)(t):u(t)}function u(t){return 123===t?e.attempt(attributes$2,d,d)(t):d(t)}function d(t){return factorySpace(e,p,"whitespace")(t)}function p(o){return e.exit("directiveContainerFence"),null===o?w(o):markdownLineEnding(o)?r.interrupt?t(o):e.attempt(nonLazyLine,h,w)(o):n(o)}function h(t){return null===t?w(t):markdownLineEnding(t)?e.check(nonLazyLine,y,w)(t):(e.enter("directiveContainerContent"),f(t))}function f(t){return e.attempt({tokenize:C,partial:!0},x,i?factorySpace(e,A,"linePrefix",i+1):A)(t)}function A(t){return null===t?x(t):markdownLineEnding(t)?e.check(nonLazyLine,g,x)(t):g(t)}function m(t){if(null===t){const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,x(t)}return markdownLineEnding(t)?e.check(nonLazyLine,v,b)(t):(e.consume(t),m)}function g(t){const n=e.enter("chunkDocument",{contentType:"document",previous:a});return a&&(a.next=n),a=n,m(t)}function y(t){return e.enter("directiveContainerContent"),f(t)}function v(t){e.consume(t);const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,f}function b(t){const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,x(t)}function x(t){return e.exit("directiveContainerContent"),w(t)}function w(n){return e.exit("directiveContainer"),t(n)}function C(e,t,n){let o=0;return factorySpace(e,function(t){return e.enter("directiveContainerFence"),e.enter("directiveContainerSequence"),i(t)},"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function i(t){return 58===t?(e.consume(t),o++,i):o<s?n(t):(e.exit("directiveContainerSequence"),factorySpace(e,a,"whitespace")(t))}function a(r){return null===r||markdownLineEnding(r)?(e.exit("directiveContainerFence"),t(r)):n(r)}}}function tokenizeLabel$2(e,t,n){return factoryLabel$1(e,t,n,"directiveContainerLabel","directiveContainerLabelMarker","directiveContainerLabelString",!0)}function tokenizeAttributes$2(e,t,n){return factoryAttributes(e,t,n,"directiveContainerAttributes","directiveContainerAttributesMarker","directiveContainerAttribute","directiveContainerAttributeId","directiveContainerAttributeClass","directiveContainerAttributeName","directiveContainerAttributeInitializerMarker","directiveContainerAttributeValueLiteral","directiveContainerAttributeValue","directiveContainerAttributeValueMarker","directiveContainerAttributeValueData",!0)}function tokenizeNonLazyLine(e,t,n){const r=this;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const directiveLeaf={tokenize:tokenizeDirectiveLeaf},label$1={tokenize:tokenizeLabel$1,partial:!0},attributes$1={tokenize:tokenizeAttributes$1,partial:!0};function tokenizeDirectiveLeaf(e,t,n){const r=this;return function(t){return e.enter("directiveLeaf"),e.enter("directiveLeafSequence"),e.consume(t),o};function o(t){return 58===t?(e.consume(t),e.exit("directiveLeafSequence"),factoryName.call(r,e,i,n,"directiveLeafName")):n(t)}function i(t){return 91===t?e.attempt(label$1,a,a)(t):a(t)}function a(t){return 123===t?e.attempt(attributes$1,s,s)(t):s(t)}function s(t){return factorySpace(e,l,"whitespace")(t)}function l(r){return null===r||markdownLineEnding(r)?(e.exit("directiveLeaf"),t(r)):n(r)}}function tokenizeLabel$1(e,t,n){return factoryLabel$1(e,t,n,"directiveLeafLabel","directiveLeafLabelMarker","directiveLeafLabelString",!0)}function tokenizeAttributes$1(e,t,n){return factoryAttributes(e,t,n,"directiveLeafAttributes","directiveLeafAttributesMarker","directiveLeafAttribute","directiveLeafAttributeId","directiveLeafAttributeClass","directiveLeafAttributeName","directiveLeafAttributeInitializerMarker","directiveLeafAttributeValueLiteral","directiveLeafAttributeValue","directiveLeafAttributeValueMarker","directiveLeafAttributeValueData",!0)}const directiveText={tokenize:tokenizeDirectiveText,previous:previous$2},label={tokenize:tokenizeLabel,partial:!0},attributes={tokenize:tokenizeAttributes,partial:!0};function previous$2(e){return 58!==e||"characterEscape"===this.events[this.events.length-1][1].type}function tokenizeDirectiveText(e,t,n){const r=this;return function(t){return e.enter("directiveText"),e.enter("directiveTextMarker"),e.consume(t),e.exit("directiveTextMarker"),factoryName.call(r,e,o,n,"directiveTextName")};function o(t){return 58===t?n(t):91===t?e.attempt(label,i,i)(t):i(t)}function i(t){return 123===t?e.attempt(attributes,a,a)(t):a(t)}function a(n){return e.exit("directiveText"),t(n)}}function tokenizeLabel(e,t,n){return factoryLabel$1(e,t,n,"directiveTextLabel","directiveTextLabelMarker","directiveTextLabelString")}function tokenizeAttributes(e,t,n){return factoryAttributes(e,t,n,"directiveTextAttributes","directiveTextAttributesMarker","directiveTextAttribute","directiveTextAttributeId","directiveTextAttributeClass","directiveTextAttributeName","directiveTextAttributeInitializerMarker","directiveTextAttributeValueLiteral","directiveTextAttributeValue","directiveTextAttributeValueMarker","directiveTextAttributeValueData")}function directive(){return{text:{58:directiveText},flow:{58:[directiveContainer,directiveLeaf]}}}const element=document.createElement("i");function decodeNamedCharacterReference(e){const t="&"+e+";";element.innerHTML=t;const n=element.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}const wwwPrefix={tokenize:tokenizeWwwPrefix,partial:!0},domain={tokenize:tokenizeDomain,partial:!0},path={tokenize:tokenizePath,partial:!0},trail={tokenize:tokenizeTrail,partial:!0},emailDomainDotTrail={tokenize:tokenizeEmailDomainDotTrail,partial:!0},wwwAutolink={name:"wwwAutolink",tokenize:tokenizeWwwAutolink,previous:previousWww},protocolAutolink={name:"protocolAutolink",tokenize:tokenizeProtocolAutolink,previous:previousProtocol},emailAutolink={name:"emailAutolink",tokenize:tokenizeEmailAutolink,previous:previousEmail},text$3={};function gfmAutolinkLiteral(){return{text:text$3}}let code$2=48;for(;code$2<123;)text$3[code$2]=emailAutolink,code$2++,58===code$2?code$2=65:91===code$2&&(code$2=97);function tokenizeEmailAutolink(e,t,n){const r=this;let o,i;return function(t){if(!gfmAtext(t)||!previousEmail.call(r,r.previous)||previousUnbalanced(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(t)};function a(t){return gfmAtext(t)?(e.consume(t),a):64===t?(e.consume(t),s):n(t)}function s(t){return 46===t?e.check(emailDomainDotTrail,c,l)(t):45===t||95===t||asciiAlphanumeric(t)?(i=!0,e.consume(t),s):c(t)}function l(t){return e.consume(t),o=!0,s}function c(a){return i&&o&&asciiAlpha(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(a)):n(a)}}function tokenizeWwwAutolink(e,t,n){const r=this;return function(t){if(87!==t&&119!==t||!previousWww.call(r,r.previous)||previousUnbalanced(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(wwwPrefix,e.attempt(domain,e.attempt(path,o),n),n)(t)};function o(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}}function tokenizeProtocolAutolink(e,t,n){const r=this;let o="",i=!1;return function(t){if((72===t||104===t)&&previousProtocol.call(r,r.previous)&&!previousUnbalanced(r.events))return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(t),e.consume(t),a;return n(t)};function a(t){if(asciiAlpha(t)&&o.length<5)return o+=String.fromCodePoint(t),e.consume(t),a;if(58===t){const n=o.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),i?l:(i=!0,s)):n(t)}function l(t){return null===t||asciiControl(t)||markdownLineEndingOrSpace(t)||unicodeWhitespace(t)||unicodePunctuation(t)?n(t):e.attempt(domain,e.attempt(path,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}}function tokenizeWwwPrefix(e,t,n){let r=0;return function t(i){if((87===i||119===i)&&r<3)return r++,e.consume(i),t;if(46===i&&3===r)return e.consume(i),o;return n(i)};function o(e){return null===e?n(e):t(e)}}function tokenizeDomain(e,t,n){let r,o,i;return a;function a(t){return 46===t||95===t?e.check(trail,l,s)(t):null===t||markdownLineEndingOrSpace(t)||unicodeWhitespace(t)||45!==t&&unicodePunctuation(t)?l(t):(i=!0,e.consume(t),a)}function s(t){return 95===t?r=!0:(o=r,r=void 0),e.consume(t),a}function l(e){return o||r||!i?n(e):t(e)}}function tokenizePath(e,t){let n=0,r=0;return o;function o(a){return 40===a?(n++,e.consume(a),o):41===a&&r<n?i(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(trail,t,i)(a):null===a||markdownLineEndingOrSpace(a)||unicodeWhitespace(a)?t(a):(e.consume(a),o)}function i(t){return 41===t&&r++,e.consume(t),o}}function tokenizeTrail(e,t,n){return r;function r(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),r):38===a?(e.consume(a),i):93===a?(e.consume(a),o):60===a||null===a||markdownLineEndingOrSpace(a)||unicodeWhitespace(a)?t(a):n(a)}function o(e){return null===e||40===e||91===e||markdownLineEndingOrSpace(e)||unicodeWhitespace(e)?t(e):r(e)}function i(e){return asciiAlpha(e)?a(e):n(e)}function a(t){return 59===t?(e.consume(t),r):asciiAlpha(t)?(e.consume(t),a):n(t)}}function tokenizeEmailDomainDotTrail(e,t,n){return function(t){return e.consume(t),r};function r(e){return asciiAlphanumeric(e)?n(e):t(e)}}function previousWww(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||markdownLineEndingOrSpace(e)}function previousProtocol(e){return!asciiAlpha(e)}function previousEmail(e){return!(47===e||gfmAtext(e))}function gfmAtext(e){return 43===e||45===e||46===e||95===e||asciiAlphanumeric(e)}function previousUnbalanced(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function splice(e,t,n,r){const o=e.length;let i,a=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<r.length;)i=r.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function push$1(e,t){return e.length>0?(splice(e,e.length,0,t),e):t}function classifyCharacter(e){return null===e||markdownLineEndingOrSpace(e)||unicodeWhitespace(e)?1:unicodePunctuation(e)?2:void 0}function resolveAll(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}text$3[43]=emailAutolink,text$3[45]=emailAutolink,text$3[46]=emailAutolink,text$3[95]=emailAutolink,text$3[72]=[emailAutolink,protocolAutolink],text$3[104]=[emailAutolink,protocolAutolink],text$3[87]=[emailAutolink,wwwAutolink],text$3[119]=[emailAutolink,wwwAutolink];const attention={name:"attention",resolveAll:resolveAllAttention,tokenize:tokenizeAttention};function resolveAllAttention(e,t){let n,r,o,i,a,s,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d={...e[n][1].end},p={...e[u][1].start};movePoint(d,-s),movePoint(p,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[u][1].start={...a.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=push$1(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=push$1(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=push$1(l,resolveAll(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=push$1(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=push$1(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,splice(e,n-1,u-n+3,l),u=n+l.length-c-2;break}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e}function tokenizeAttention(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=classifyCharacter(r);let i;return function(t){return i=t,e.enter("attentionSequence"),a(t)};function a(s){if(s===i)return e.consume(s),a;const l=e.exit("attentionSequence"),c=classifyCharacter(s),u=!c||2===c&&o||n.includes(s),d=!o||2===o&&c||n.includes(r);return l._open=Boolean(42===i?u:u&&(o||!d)),l._close=Boolean(42===i?d:d&&(c||!u)),t(s)}}function movePoint(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const autolink$2={name:"autolink",tokenize:tokenizeAutolink};function tokenizeAutolink(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return asciiAlpha(t)?(e.consume(t),i):64===t?n(t):l(t)}function i(e){return 43===e||45===e||46===e||asciiAlphanumeric(e)?(r=1,a(e)):l(e)}function a(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||asciiAlphanumeric(t))&&r++<32?(e.consume(t),a):(r=0,l(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||asciiControl(r)?n(r):(e.consume(r),s)}function l(t){return 64===t?(e.consume(t),c):asciiAtext(t)?(e.consume(t),l):n(t)}function c(e){return asciiAlphanumeric(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||asciiAlphanumeric(t))&&r++<63){const n=45===t?d:u;return e.consume(t),n}return n(t)}}const blankLine={partial:!0,tokenize:tokenizeBlankLine};function tokenizeBlankLine(e,t,n){return function(t){return markdownSpace(t)?factorySpace(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||markdownLineEnding(e)?t(e):n(e)}}const blockQuote={continuation:{tokenize:tokenizeBlockQuoteContinuation},exit:exit,name:"blockQuote",tokenize:tokenizeBlockQuoteStart};function tokenizeBlockQuoteStart(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return markdownSpace(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}function tokenizeBlockQuoteContinuation(e,t,n){const r=this;return function(t){if(markdownSpace(t))return factorySpace(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return o(t)};function o(r){return e.attempt(blockQuote,t,n)(r)}}function exit(e){e.exit("blockQuote")}const characterEscape={name:"characterEscape",tokenize:tokenizeCharacterEscape};function tokenizeCharacterEscape(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return asciiPunctuation(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}const characterReference={name:"characterReference",tokenize:tokenizeCharacterReference};function tokenizeCharacterReference(e,t,n){const r=this;let o,i,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,i=asciiAlphanumeric,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=asciiHexDigit,c):(e.enter("characterReferenceValue"),o=7,i=asciiDigit,c(t))}function c(s){if(59===s&&a){const o=e.exit("characterReferenceValue");return i!==asciiAlphanumeric||decodeNamedCharacterReference(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&a++<o?(e.consume(s),c):n(s)}}const nonLazyContinuation$1={partial:!0,tokenize:tokenizeNonLazyContinuation$1},codeFenced={concrete:!0,name:"codeFenced",tokenize:tokenizeCodeFenced};function tokenizeCodeFenced(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a};function a(t){return e.enter("codeFencedFence"),markdownSpace(t)?factorySpace(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===i?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===i?(o++,e.consume(t),c):o>=s?(e.exit("codeFencedFenceSequence"),markdownSpace(t)?factorySpace(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||markdownLineEnding(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,a=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===i?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),markdownSpace(t)?factorySpace(e,c,"whitespace")(t):c(t))}function c(n){return null===n||markdownLineEnding(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(nonLazyContinuation$1,h,y)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||markdownLineEnding(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):markdownSpace(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),factorySpace(e,d,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),u)}function d(t){return null===t||markdownLineEnding(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(t))}function p(t){return null===t||markdownLineEnding(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===i?n(t):(e.consume(t),p)}function h(t){return e.attempt(o,y,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),A}function A(t){return a>0&&markdownSpace(t)?factorySpace(e,m,"linePrefix",a+1)(t):m(t)}function m(t){return null===t||markdownLineEnding(t)?e.check(nonLazyContinuation$1,h,y)(t):(e.enter("codeFlowValue"),g(t))}function g(t){return null===t||markdownLineEnding(t)?(e.exit("codeFlowValue"),m(t)):(e.consume(t),g)}function y(n){return e.exit("codeFenced"),t(n)}}function tokenizeNonLazyContinuation$1(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const codeIndented={name:"codeIndented",tokenize:tokenizeCodeIndented},furtherStart={partial:!0,tokenize:tokenizeFurtherStart};function tokenizeCodeIndented(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),factorySpace(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?s(t):markdownLineEnding(t)?e.attempt(furtherStart,i,s)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||markdownLineEnding(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),a)}function s(n){return e.exit("codeIndented"),t(n)}}function tokenizeFurtherStart(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):markdownLineEnding(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):factorySpace(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):markdownLineEnding(e)?o(e):n(e)}}const codeText={name:"codeText",previous:previous$1,resolve:resolveCodeText,tokenize:tokenizeCodeText};function resolveCodeText(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e}function previous$1(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type}function tokenizeCodeText(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),a(t)};function a(t){return 96===t?(e.consume(t),i++,a):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(o=e.enter("codeTextSequence"),r=0,c(t)):markdownLineEnding(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||markdownLineEnding(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}}class SpliceBuffer{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&chunkedPush(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),chunkedPush(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),chunkedPush(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);chunkedPush(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);chunkedPush(this.left,t.reverse())}}}function chunkedPush(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 subtokenize(e){const t={};let n,r,o,i,a,s,l,c=-1;const u=new SpliceBuffer(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(s=n[1]._tokenizer.events,o=0,o<s.length&&"lineEndingBlank"===s[o][1].type&&(o+=2),o<s.length&&"content"===s[o][1].type))for(;++o<s.length&&"content"!==s[o][1].type;)"chunkText"===s[o][1].type&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,subcontent(u,c)),c=t[c],l=!0);else if(n[1]._container){for(o=c,r=void 0;o--;)if(i=u.get(o),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if("linePrefix"!==i[1].type&&"listItemIndent"!==i[1].type)break;r&&(n[1].end={...u.get(r)[1].start},a=u.slice(r,c),a.unshift(n),u.splice(r,c-r+1,a))}}return splice(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!l}function subcontent(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,p=-1,h=n,f=0,A=0;const m=[A];for(;h;){for(;e.get(++o)[1]!==h;);i.push(o),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),d&&a.defineSkip(h.start),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++p<s.length;)"exit"===s[p][0]&&"enter"===s[p-1][0]&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(A=p+1,m.push(A),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(a.events=[],h?(h._tokenizer=void 0,h.previous=void 0):m.pop(),p=m.length;p--;){const t=s.slice(m[p],m[p+1]),n=i.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),p=-1;++p<l.length;)c[f+l[p][0]]=f+l[p][1],f+=l[p][1]-l[p][0]-1;return c}const content$1={resolve:resolveContent,tokenize:tokenizeContent},continuationConstruct={partial:!0,tokenize:tokenizeContinuation};function resolveContent(e){return subtokenize(e),e}function tokenizeContent(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):markdownLineEnding(t)?e.check(continuationConstruct,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function tokenizeContinuation(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),factorySpace(e,o,"linePrefix")};function o(o){if(null===o||markdownLineEnding(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function factoryDestination(e,t,n,r,o,i,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){if(60===t)return e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),d;if(null===t||32===t||41===t||asciiControl(t))return n(t);return e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),f(t)};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||markdownLineEnding(t)?n(t):(e.consume(t),92===t?h:p)}function h(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function f(o){return u||null!==o&&41!==o&&!markdownLineEndingOrSpace(o)?u<c&&40===o?(e.consume(o),u++,f):41===o?(e.consume(o),u--,f):null===o||32===o||40===o||asciiControl(o)?n(o):(e.consume(o),92===o?A:f):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o))}function A(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function factoryLabel(e,t,n,r,o,i){const a=this;let s,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),c};function c(d){return l>999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):markdownLineEnding(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||markdownLineEnding(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!markdownSpace(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function factoryTitle(e,t,n,r,o,i){let a;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(o),e.consume(t),e.exit(o),a=40===t?41:t,s;return n(t)};function s(n){return n===a?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===a?(e.exit(i),s(a)):null===t?n(t):markdownLineEnding(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),factorySpace(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||markdownLineEnding(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function normalizeIdentifier(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const definition={name:"definition",tokenize:tokenizeDefinition},titleBefore={partial:!0,tokenize:tokenizeTitleBefore};function tokenizeDefinition(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return factoryLabel.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=normalizeIdentifier(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return markdownLineEndingOrSpace(t)?factoryWhitespace(e,s)(t):s(t)}function s(t){return factoryDestination(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(titleBefore,c,c)(t)}function c(t){return markdownSpace(t)?factorySpace(e,u,"whitespace")(t):u(t)}function u(i){return null===i||markdownLineEnding(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}function tokenizeTitleBefore(e,t,n){return function(t){return markdownLineEndingOrSpace(t)?factoryWhitespace(e,r)(t):n(t)};function r(t){return factoryTitle(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return markdownSpace(t)?factorySpace(e,i,"whitespace")(t):i(t)}function i(e){return null===e||markdownLineEnding(e)?t(e):n(e)}}const hardBreakEscape={name:"hardBreakEscape",tokenize:tokenizeHardBreakEscape};function tokenizeHardBreakEscape(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return markdownLineEnding(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}const headingAtx={name:"headingAtx",resolve:resolveHeadingAtx,tokenize:tokenizeHeadingAtx};function resolveHeadingAtx(e,t){let n,r,o=e.length-2,i=3;return"whitespace"===e[i][1].type&&(i+=2),o-2>i&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4),o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},splice(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e}function tokenizeHeadingAtx(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||markdownLineEndingOrSpace(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||markdownLineEnding(n)?(e.exit("atxHeading"),t(n)):markdownSpace(n)?factorySpace(e,i,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),i(t))}function s(t){return null===t||35===t||markdownLineEndingOrSpace(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),s)}}const htmlBlockNames=["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"],htmlRawNames=["pre","script","style","textarea"],htmlFlow={concrete:!0,name:"htmlFlow",resolveTo:resolveToHtmlFlow,tokenize:tokenizeHtmlFlow},blankLineBefore={partial:!0,tokenize:tokenizeBlankLineBefore},nonLazyContinuationStart={partial:!0,tokenize:tokenizeNonLazyContinuationStart};function resolveToHtmlFlow(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(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 tokenizeHtmlFlow(e,t,n){const r=this;let o,i,a,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),i=!0,h):63===s?(e.consume(s),o=3,r.interrupt?t:M):asciiAlpha(s)?(e.consume(s),a=String.fromCharCode(s),f):n(s)}function u(i){return 45===i?(e.consume(i),o=2,d):91===i?(e.consume(i),o=5,s=0,p):asciiAlpha(i)?(e.consume(i),o=4,r.interrupt?t:M):n(i)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:M):n(o)}function p(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:S:p):n(o)}function h(t){return asciiAlpha(t)?(e.consume(t),a=String.fromCharCode(t),f):n(t)}function f(s){if(null===s||47===s||62===s||markdownLineEndingOrSpace(s)){const l=47===s,c=a.toLowerCase();return l||i||!htmlRawNames.includes(c)?htmlBlockNames.includes(a.toLowerCase())?(o=6,l?(e.consume(s),A):r.interrupt?t(s):S(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?m(s):g(s)):(o=1,r.interrupt?t(s):S(s))}return 45===s||asciiAlphanumeric(s)?(e.consume(s),a+=String.fromCharCode(s),f):n(s)}function A(o){return 62===o?(e.consume(o),r.interrupt?t:S):n(o)}function m(t){return markdownSpace(t)?(e.consume(t),m):$(t)}function g(t){return 47===t?(e.consume(t),$):58===t||95===t||asciiAlpha(t)?(e.consume(t),y):markdownSpace(t)?(e.consume(t),g):$(t)}function y(t){return 45===t||46===t||58===t||95===t||asciiAlphanumeric(t)?(e.consume(t),y):v(t)}function v(t){return 61===t?(e.consume(t),b):markdownSpace(t)?(e.consume(t),v):g(t)}function b(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,x):markdownSpace(t)?(e.consume(t),b):w(t)}function x(t){return t===l?(e.consume(t),l=null,C):null===t||markdownLineEnding(t)?n(t):(e.consume(t),x)}function w(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||markdownLineEndingOrSpace(t)?v(t):(e.consume(t),w)}function C(e){return 47===e||62===e||markdownSpace(e)?g(e):n(e)}function $(t){return 62===t?(e.consume(t),_):n(t)}function _(t){return null===t||markdownLineEnding(t)?S(t):markdownSpace(t)?(e.consume(t),_):n(t)}function S(t){return 45===t&&2===o?(e.consume(t),P):60===t&&1===o?(e.consume(t),T):62===t&&4===o?(e.consume(t),D):63===t&&3===o?(e.consume(t),M):93===t&&5===o?(e.consume(t),L):!markdownLineEnding(t)||6!==o&&7!==o?null===t||markdownLineEnding(t)?(e.exit("htmlFlowData"),E(t)):(e.consume(t),S):(e.exit("htmlFlowData"),e.check(blankLineBefore,N,E)(t))}function E(t){return e.check(nonLazyContinuationStart,k,N)(t)}function k(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),B}function B(t){return null===t||markdownLineEnding(t)?E(t):(e.enter("htmlFlowData"),S(t))}function P(t){return 45===t?(e.consume(t),M):S(t)}function T(t){return 47===t?(e.consume(t),a="",I):S(t)}function I(t){if(62===t){const n=a.toLowerCase();return htmlRawNames.includes(n)?(e.consume(t),D):S(t)}return asciiAlpha(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),I):S(t)}function L(t){return 93===t?(e.consume(t),M):S(t)}function M(t){return 62===t?(e.consume(t),D):45===t&&2===o?(e.consume(t),M):S(t)}function D(t){return null===t||markdownLineEnding(t)?(e.exit("htmlFlowData"),N(t)):(e.consume(t),D)}function N(n){return e.exit("htmlFlow"),t(n)}}function tokenizeNonLazyContinuationStart(e,t,n){const r=this;return function(t){if(markdownLineEnding(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o;return n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function tokenizeBlankLineBefore(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(blankLine,t,n)}}const htmlText={name:"htmlText",tokenize:tokenizeHtmlText};function tokenizeHtmlText(e,t,n){const r=this;let o,i,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),b):63===t?(e.consume(t),y):asciiAlpha(t)?(e.consume(t),C):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,h):asciiAlpha(t)?(e.consume(t),g):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):markdownLineEnding(t)?(a=u,I(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?T(e):45===e?d(e):u(e)}function h(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?f:h):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),A):markdownLineEnding(t)?(a=f,I(t)):(e.consume(t),f)}function A(t){return 93===t?(e.consume(t),m):f(t)}function m(t){return 62===t?T(t):93===t?(e.consume(t),m):f(t)}function g(t){return null===t||62===t?T(t):markdownLineEnding(t)?(a=g,I(t)):(e.consume(t),g)}function y(t){return null===t?n(t):63===t?(e.consume(t),v):markdownLineEnding(t)?(a=y,I(t)):(e.consume(t),y)}function v(e){return 62===e?T(e):y(e)}function b(t){return asciiAlpha(t)?(e.consume(t),x):n(t)}function x(t){return 45===t||asciiAlphanumeric(t)?(e.consume(t),x):w(t)}function w(t){return markdownLineEnding(t)?(a=w,I(t)):markdownSpace(t)?(e.consume(t),w):T(t)}function C(t){return 45===t||asciiAlphanumeric(t)?(e.consume(t),C):47===t||62===t||markdownLineEndingOrSpace(t)?$(t):n(t)}function $(t){return 47===t?(e.consume(t),T):58===t||95===t||asciiAlpha(t)?(e.consume(t),_):markdownLineEnding(t)?(a=$,I(t)):markdownSpace(t)?(e.consume(t),$):T(t)}function _(t){return 45===t||46===t||58===t||95===t||asciiAlphanumeric(t)?(e.consume(t),_):S(t)}function S(t){return 61===t?(e.consume(t),E):markdownLineEnding(t)?(a=S,I(t)):markdownSpace(t)?(e.consume(t),S):$(t)}function E(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,k):markdownLineEnding(t)?(a=E,I(t)):markdownSpace(t)?(e.consume(t),E):(e.consume(t),B)}function k(t){return t===o?(e.consume(t),o=void 0,P):null===t?n(t):markdownLineEnding(t)?(a=k,I(t)):(e.consume(t),k)}function B(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||markdownLineEndingOrSpace(t)?$(t):(e.consume(t),B)}function P(e){return 47===e||62===e||markdownLineEndingOrSpace(e)?$(e):n(e)}function T(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function I(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),L}function L(t){return markdownSpace(t)?factorySpace(e,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):M(t)}function M(t){return e.enter("htmlTextData"),a(t)}}const labelEnd={name:"labelEnd",resolveAll:resolveAllLabelEnd,resolveTo:resolveToLabelEnd,tokenize:tokenizeLabelEnd},resourceConstruct={tokenize:tokenizeResource},referenceFullConstruct={tokenize:tokenizeReferenceFull},referenceCollapsedConstruct={tokenize:tokenizeReferenceCollapsed};function resolveAllLabelEnd(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&splice(e,0,e.length,n),e}function resolveToLabelEnd(e,t){let n,r,o,i,a=e.length,s=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(o=a);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",l,t],["enter",c,t]],i=push$1(i,e.slice(r+1,r+s+3)),i=push$1(i,[["enter",u,t]]),i=push$1(i,resolveAll(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=push$1(i,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),i=push$1(i,e.slice(o+1)),i=push$1(i,[["exit",l,t]]),splice(e,r,e.length,i),e}function tokenizeLabelEnd(e,t,n){const r=this;let o,i,a=r.events.length;for(;a--;)if(("labelImage"===r.events[a][1].type||"labelLink"===r.events[a][1].type)&&!r.events[a][1]._balanced){o=r.events[a][1];break}return function(t){if(!o)return n(t);if(o._inactive)return u(t);return i=r.parser.defined.includes(normalizeIdentifier(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(resourceConstruct,c,i?c:u)(t):91===t?e.attempt(referenceFullConstruct,c,i?l:u)(t):i?c(t):u(t)}function l(t){return e.attempt(referenceCollapsedConstruct,c,u)(t)}function c(e){return t(e)}function u(e){return o._balanced=!0,n(e)}}function tokenizeResource(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return markdownLineEndingOrSpace(t)?factoryWhitespace(e,o)(t):o(t)}function o(t){return 41===t?c(t):factoryDestination(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return markdownLineEndingOrSpace(t)?factoryWhitespace(e,s)(t):c(t)}function a(e){return n(e)}function s(t){return 34===t||39===t||40===t?factoryTitle(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return markdownLineEndingOrSpace(t)?factoryWhitespace(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}function tokenizeReferenceFull(e,t,n){const r=this;return function(t){return factoryLabel.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(normalizeIdentifier(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}function tokenizeReferenceCollapsed(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}const labelStartImage={name:"labelStartImage",resolveAll:labelEnd.resolveAll,tokenize:tokenizeLabelStartImage};function tokenizeLabelStartImage(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}const labelStartLink={name:"labelStartLink",resolveAll:labelEnd.resolveAll,tokenize:tokenizeLabelStartLink};function tokenizeLabelStartLink(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}const lineEnding={name:"lineEnding",tokenize:tokenizeLineEnding};function tokenizeLineEnding(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),factorySpace(e,t,"linePrefix")}}const thematicBreak={name:"thematicBreak",tokenize:tokenizeThematicBreak};function tokenizeThematicBreak(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),a(i)):o>=3&&(null===i||markdownLineEnding(i))?(e.exit("thematicBreak"),t(i)):n(i)}function a(t){return t===r?(e.consume(t),o++,a):(e.exit("thematicBreakSequence"),markdownSpace(t)?factorySpace(e,i,"whitespace")(t):i(t))}}const list$5={continuation:{tokenize:tokenizeListContinuation},exit:tokenizeListEnd,name:"list",tokenize:tokenizeListStart},listItemPrefixWhitespaceConstruct={partial:!0,tokenize:tokenizeListItemPrefixWhitespace},indentConstruct={partial:!0,tokenize:tokenizeIndent$1};function tokenizeListStart(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,a=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:asciiDigit(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(thematicBreak,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return asciiDigit(t)&&++a<10?(e.consume(t),s):(!r.interrupt||a<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(blankLine,r.interrupt?n:c,e.attempt(listItemPrefixWhitespaceConstruct,d,u))}function c(e){return r.containerState.initialBlankLine=!0,i++,d(e)}function u(t){return markdownSpace(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}function tokenizeListContinuation(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(blankLine,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,factorySpace(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){if(r.containerState.furtherBlankLines||!markdownSpace(n))return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n);return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(indentConstruct,t,o)(n)});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,factorySpace(e,e.attempt(list$5,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function tokenizeIndent$1(e,t,n){const r=this;return factorySpace(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}function tokenizeListEnd(e){e.exit(this.containerState.type)}function tokenizeListItemPrefixWhitespace(e,t,n){const r=this;return factorySpace(e,function(e){const o=r.events[r.events.length-1];return!markdownSpace(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}const setextUnderline={name:"setextUnderline",resolveTo:resolveToSetextUnderline,tokenize:tokenizeSetextUnderline};function resolveToSetextUnderline(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",a,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=a,e.push(["exit",a,t]),e}function tokenizeSetextUnderline(e,t,n){const r=this;let o;return function(t){let a,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){a="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||a))return e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t);return n(t)};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),markdownSpace(t)?factorySpace(e,a,"lineSuffix")(t):a(t))}function a(r){return null===r||markdownLineEnding(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}const indent={tokenize:tokenizeIndent,partial:!0};function gfmFootnote(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:tokenizeDefinitionStart,continuation:{tokenize:tokenizeDefinitionContinuation},exit:gfmFootnoteDefinitionEnd}},text:{91:{name:"gfmFootnoteCall",tokenize:tokenizeGfmFootnoteCall},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:tokenizePotentialGfmFootnoteCall,resolveTo:resolveToPotentialGfmFootnoteCall}}}}function tokenizePotentialGfmFootnoteCall(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;o--;){const e=r.events[o][1];if("labelImage"===e.type){a=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!a||!a._balanced)return n(o);const s=normalizeIdentifier(r.sliceSerialize({start:a.end,end:r.now()}));if(94!==s.codePointAt(0)||!i.includes(s.slice(1)))return n(o);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)}}function resolveToPotentialGfmFootnoteCall(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){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)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function tokenizeGfmFootnoteCall(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(s){if(a>999||93===s&&!i||null===s||91===s||markdownLineEndingOrSpace(s))return n(s);if(93===s){e.exit("chunkString");const i=e.exit("gfmFootnoteCallString");return o.includes(normalizeIdentifier(r.sliceSerialize(i)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return markdownLineEndingOrSpace(s)||(i=!0),a++,e.consume(s),92===s?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,l):l(t)}}function tokenizeDefinitionStart(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!a||null===t||91===t||markdownLineEndingOrSpace(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return i=normalizeIdentifier(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return markdownLineEndingOrSpace(t)||(a=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(i)||o.push(i),factorySpace(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}function tokenizeDefinitionContinuation(e,t,n){return e.check(blankLine,t,e.attempt(indent,t,n))}function gfmFootnoteDefinitionEnd(e){e.exit("gfmFootnoteDefinition")}function tokenizeIndent(e,t,n){const r=this;return factorySpace(e,function(e){const o=r.events[r.events.length-1];return o&&"gfmFootnoteDefinitionIndent"===o[1].type&&4===o[2].sliceSerialize(o[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)}class EditMap{constructor(){this.map=[]}add(e,t,n){addImplementation(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function addImplementation(e,t,n,r){let o=0;if(0!==n||0!==r.length){for(;o<e.map.length;){if(e.map[o][0]===t)return e.map[o][1]+=n,void e.map[o][2].push(...r);o+=1}e.map.push([t,n,r])}}function gfmTableAlign(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if("enter"===o[0])"tableContent"===o[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===o[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===o[1].type)break}else"enter"===o[0]&&"tableDelimiterRow"===o[1].type&&(n=!0);t+=1}return r}function gfmTable$1(){return{flow:{null:{name:"table",tokenize:tokenizeTable,resolveAll:resolveTable}}}}function tokenizeTable(e,t,n){const r=this;let o,i=0,a=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const o=t>-1?r.events[t][1].type:null,i="tableHead"===o||"tableRow"===o?b:s;if(i===b&&r.parser.lazy[r.now().line])return n(e);return i(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return l(e);return o=!0,a+=1,l(e)}(t)}function l(t){return null===t?n(t):markdownLineEnding(t)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):markdownSpace(t)?factorySpace(e,l,"whitespace")(t):(a+=1,o&&(o=!1,i+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),o=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||markdownLineEndingOrSpace(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),o=!1,markdownSpace(t)?factorySpace(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t))}function p(t){return 45===t||58===t?f(t):124===t?(o=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):v(t)}function h(t){return markdownSpace(t)?factorySpace(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),A):45===t?(a+=1,A(t)):null===t||markdownLineEnding(t)?y(t):v(t)}function A(t){return 45===t?(e.enter("tableDelimiterFiller"),m(t)):v(t)}function m(t){return 45===t?(e.consume(t),m):58===t?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(t))}function g(t){return markdownSpace(t)?factorySpace(e,y,"whitespace")(t):y(t)}function y(n){return 124===n?p(n):(null===n||markdownLineEnding(n))&&o&&i===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):v(n)}function v(e){return n(e)}function b(t){return e.enter("tableRow"),x(t)}function x(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),x):null===n||markdownLineEnding(n)?(e.exit("tableRow"),t(n)):markdownSpace(n)?factorySpace(e,x,"whitespace")(n):(e.enter("data"),w(n))}function w(t){return null===t||124===t||markdownLineEndingOrSpace(t)?(e.exit("data"),x(t)):(e.consume(t),92===t?C:w)}function C(t){return 92===t||124===t?(e.consume(t),w):w(t)}}function resolveTable(e,t){let n,r,o,i=-1,a=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const p=new EditMap;for(;++i<e.length;){const h=e[i],f=h[1];"enter"===h[0]?"tableHead"===f.type?(u=!1,0!==d&&(flushTableEnd(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(i,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(a=!0,o=void 0,l=[0,0,0,0],c=[0,i+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(i,0,[["enter",r,t]])),s="tableDelimiterRow"===f.type?2:r?3:1):!s||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type?"tableCellDivider"===f.type&&(a?a=!1:(0!==l[1]&&(c[0]=c[1],o=flushCell(p,t,l,s,void 0,o)),l=c,c=[l[1],i,0,0])):(a=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],o=flushCell(p,t,l,s,void 0,o),l=[0,0,0,0]),c[2]=i)):"tableHead"===f.type?(u=!0,d=i):"tableRow"===f.type||"tableDelimiterRow"===f.type?(d=i,0!==l[1]?(c[0]=c[1],o=flushCell(p,t,l,s,i,o)):0!==c[1]&&(o=flushCell(p,t,c,s,i,o)),s=0):!s||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type||(c[3]=i)}for(0!==d&&flushTableEnd(p,t,d,n,r),p.consume(t.events),i=-1;++i<t.events.length;){const e=t.events[i];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=gfmTableAlign(t.events,i))}return e}function flushCell(e,t,n,r,o,i){const a=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(i.end=Object.assign({},getPoint(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const s=getPoint(t.events,n[1]);if(i={type:a,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",i,t]]),0!==n[2]){const o=getPoint(t.events,n[2]),i=getPoint(t.events,n[3]),a={type:"tableContent",start:Object.assign({},o),end:Object.assign({},i)};if(e.add(n[2],0,[["enter",a,t]]),2!==r){const r=t.events[n[2]],o=t.events[n[3]];if(r[1].end=Object.assign({},o[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==o&&(i.end=Object.assign({},getPoint(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function flushTableEnd(e,t,n,r,o){const i=[],a=getPoint(t.events,n);o&&(o.end=Object.assign({},a),i.push(["exit",o,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function getPoint(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const mathFlow={tokenize:tokenizeMathFenced,concrete:!0,name:"mathFlow"},nonLazyContinuation={tokenize:tokenizeNonLazyContinuation,partial:!0};function tokenizeMathFenced(e,t,n){const r=this,o=r.events[r.events.length-1],i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0;let a=0;return function(t){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),s(t)};function s(t){return 36===t?(e.consume(t),a++,s):a<2?n(t):(e.exit("mathFlowFenceSequence"),factorySpace(e,l,"whitespace")(t))}function l(t){return null===t||markdownLineEnding(t)?u(t):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return null===t||markdownLineEnding(t)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),u(t)):36===t?n(t):(e.consume(t),c)}function u(n){return e.exit("mathFlowFence"),r.interrupt?t(n):e.attempt(nonLazyContinuation,d,A)(n)}function d(t){return e.attempt({tokenize:m,partial:!0},A,p)(t)}function p(t){return(i?factorySpace(e,h,"linePrefix",i+1):h)(t)}function h(t){return null===t?A(t):markdownLineEnding(t)?e.attempt(nonLazyContinuation,d,A)(t):(e.enter("mathFlowValue"),f(t))}function f(t){return null===t||markdownLineEnding(t)?(e.exit("mathFlowValue"),h(t)):(e.consume(t),f)}function A(n){return e.exit("mathFlow"),t(n)}function m(e,t,n){let o=0;return factorySpace(e,function(t){return e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),i(t)},"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function i(t){return 36===t?(o++,e.consume(t),i):o<a?n(t):(e.exit("mathFlowFenceSequence"),factorySpace(e,s,"whitespace")(t))}function s(r){return null===r||markdownLineEnding(r)?(e.exit("mathFlowFence"),t(r)):n(r)}}}function tokenizeNonLazyContinuation(e,t,n){const r=this;return function(n){if(null===n)return t(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function mathText(e){let t={}.singleDollarTextMath;return null==t&&(t=!0),{tokenize:function(e,n,r){let o,i,a=0;return function(t){return e.enter("mathText"),e.enter("mathTextSequence"),s(t)};function s(n){return 36===n?(e.consume(n),a++,s):a<2&&!t?r(n):(e.exit("mathTextSequence"),l(n))}function l(t){return null===t?r(t):36===t?(i=e.enter("mathTextSequence"),o=0,u(t)):32===t?(e.enter("space"),e.consume(t),e.exit("space"),l):markdownLineEnding(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):(e.enter("mathTextData"),c(t))}function c(t){return null===t||32===t||36===t||markdownLineEnding(t)?(e.exit("mathTextData"),l(t)):(e.consume(t),c)}function u(t){return 36===t?(e.consume(t),o++,u):o===a?(e.exit("mathTextSequence"),e.exit("mathText"),n(t)):(i.type="mathTextData",c(t))}},resolve:resolveMathText,previous:previous,name:"mathText"}}function resolveMathText(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("mathTextData"===e[t][1].type){e[r][1].type="mathTextPadding",e[o][1].type="mathTextPadding",o+=2,r-=2;break}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="mathTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e}function previous(e){return 36!==e||"characterEscape"===this.events[this.events.length-1][1].type}function math(e){return{flow:{36:mathFlow},text:{36:mathText()}}}const hasOwnProperty$1={}.hasOwnProperty;function combineExtensions(e){const t={};let n=-1;for(;++n<e.length;)syntaxExtension(t,e[n]);return t}function syntaxExtension(e,t){let n;for(n in t){const r=(hasOwnProperty$1.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){hasOwnProperty$1.call(r,i)||(r[i]=[]);const e=o[i];constructs(r[i],Array.isArray(e)?e:e?[e]:[])}}}function constructs(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);splice(e,0,0,r)}const content={tokenize:initializeContent};function initializeContent(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),factorySpace(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):markdownLineEnding(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}const document$3={tokenize:initializeDocument},containerConstruct={tokenize:tokenizeContainer};function initializeDocument(e){const t=this,n=[];let r,o,i,a=0;return s;function s(r){if(a<n.length){const o=n[a];return t.containerState=o[1],e.attempt(o[0].continuation,l,c)(r)}return c(r)}function l(e){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&y();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}g(a);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return splice(t.events,i+1,0,t.events.slice(n)),t.events.length=s,c(e)}return s(e)}function c(o){if(a===n.length){if(!r)return p(o);if(r.currentConstruct&&r.currentConstruct.concrete)return f(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(containerConstruct,u,d)(o)}function u(e){return r&&y(),g(a),p(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,i=t.now().offset,f(e)}function p(n){return t.containerState={},e.attempt(containerConstruct,h,f)(n)}function h(e){return a++,n.push([t.currentConstruct,t.containerState]),p(e)}function f(n){return null===n?(r&&y(),g(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),A(n))}function A(n){return null===n?(m(e.exit("chunkFlow"),!0),g(0),void e.consume(n)):markdownLineEnding(n)?(e.consume(n),m(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),A)}function m(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){s=t.events[l][1].end;break}o=!0}for(g(a),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;splice(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function g(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function y(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function tokenizeContainer(e,t,n){return factorySpace(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const flow$1={tokenize:initializeFlow};function initializeFlow(e){const t=this,n=e.attempt(blankLine,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,factorySpace(e,e.attempt(this.parser.constructs.flow,r,e.attempt(content$1,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}const resolver={resolveAll:createResolver()},string$1=initializeFactory("string"),text$2=initializeFactory("text");function initializeFactory(e){return{resolveAll:createResolver("text"===e?resolveAllLineSuffixes:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,a);return i;function i(e){return l(e)?o(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function createResolver(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function resolveAllLineSuffixes(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,a=o.length,s=-1,l=0;for(;a--;){const e=o[a];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)l++,s--;if(s)break;s=-1}else if(-2===e)i=!0,l++;else if(-1!==e){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const o={type:n===e.length||i||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const document$2={42:list$5,43:list$5,45:list$5,48:list$5,49:list$5,50:list$5,51:list$5,52:list$5,53:list$5,54:list$5,55:list$5,56:list$5,57:list$5,62:blockQuote},contentInitial={91:definition},flowInitial={[-2]:codeIndented,[-1]:codeIndented,32:codeIndented},flow={35:headingAtx,42:thematicBreak,45:[setextUnderline,thematicBreak],60:htmlFlow,61:setextUnderline,95:thematicBreak,96:codeFenced,126:codeFenced},string={38:characterReference,92:characterEscape},text$1={[-5]:lineEnding,[-4]:lineEnding,[-3]:lineEnding,33:labelStartImage,38:characterReference,42:attention,60:[autolink$2,htmlText],91:labelStartLink,92:[hardBreakEscape,characterEscape],93:labelEnd,95:attention,96:codeText},insideSpan={null:[attention,resolver]},attentionMarkers={null:[42,95]},disable={null:[]},defaultConstructs=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:attentionMarkers,contentInitial:contentInitial,disable:disable,document:document$2,flow:flow,flowInitial:flowInitial,insideSpan:insideSpan,string:string,text:text$1},Symbol.toStringTag,{value:"Module"}));function createTokenizer(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 o={},i=[];let a=[],s=[];const l={attempt:m(function(e,t){g(e,t.from)}),check:m(A),consume:function(e){markdownLineEnding(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,y()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));c.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=p(),c.events.push(["enter",n,c]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=p(),c.events.push(["exit",t,c]),t},interrupt:m(A,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,y()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return serializeChunks(d(e),t)},sliceStream:d,write:function(e){if(a=push$1(a,e),h(),null!==a[a.length-1])return[];return g(t,0),c.events=resolveAll(i,c.events,c),c.events}};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(e){return sliceChunks(a,e)}function p(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function h(){let e;for(;r._index<a.length;){const t=a[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)f(t.charCodeAt(r._bufferIndex));else f(t)}}function f(e){u=u(e)}function A(e,t){t.restore()}function m(e,t){return function(n,o,i){let a,u,d,h;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function f(e){return a=e,u=0,0===e.length?i:A(e[u])}function A(e){return function(n){h=function(){const e=p(),t=c.previous,n=c.currentConstruct,o=c.events.length,i=Array.from(s);return{from:o,restore:a};function a(){r=e,c.previous=t,c.currentConstruct=n,c.events.length=o,s=i,y()}}(),d=e,e.partial||(c.currentConstruct=e);if(e.name&&c.parser.constructs.disable.null.includes(e.name))return g();return e.tokenize.call(t?Object.assign(Object.create(c),t):c,l,m,g)(n)}}function m(t){return e(d,h),o}function g(e){return h.restore(),++u<a.length?A(a[u]):i}}}function g(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&splice(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function y(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function sliceChunks(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const e=a[0];"string"==typeof e?a[0]=e.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}function serializeChunks(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if("string"==typeof i)a=i;else switch(i){case-5:a="\r";break;case-4:a="\n";break;case-3:a="\r\n";break;case-2:a=t?" ":"\t";break;case-1:if(!t&&o)continue;a=" ";break;default:a=String.fromCharCode(i)}o=-2===i,r.push(a)}return r.join("")}function parse$9(e){const t={constructs:combineExtensions([defaultConstructs,...(e||{}).extensions||[]]),content:n(content),defined:[],document:n(document$3),flow:n(flow$1),lazy:{},string:n(string$1),text:n(text$2)};return t;function n(e){return function(n){return createTokenizer(t,e,n)}}}function postprocess(e){for(;!subtokenize(e););return e}const search=/[\0\t\n\r]/g;function preprocess(){let e,t=1,n="",r=!0;return function(o,i,a){const s=[];let l,c,u,d,p;o=n+("string"==typeof o?o.toString():new TextDecoder(i||void 0).decode(o)),u=0,n="",r&&(65279===o.charCodeAt(0)&&u++,r=void 0);for(;u<o.length;){if(search.lastIndex=u,l=search.exec(o),d=l&&void 0!==l.index?l.index:o.length,p=o.charCodeAt(d),!l){n=o.slice(u);break}if(10===p&&u===d&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),u<d&&(s.push(o.slice(u,d)),t+=d-u),p){case 0:s.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),s.push(-2);t++<c;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}u=d+1}a&&(e&&s.push(-5),n&&s.push(n),s.push(null));return s}}var sharedExports=requireShared();function getText$1(e,t){return e.slice(t.start.offset,t.end.offset)}function getEvents$1(e,t={}){const n=[directive(),gfmAutolinkLiteral(),gfmFootnote(),gfmTable$1(),math(),...t.extensions||[]],r=[],o=labelEnd.tokenize;try{labelEnd.tokenize=function(t,n,i){const a=this,s=a.events;return o.call(a,t,n,t=>{let n=s.length;for(;--n>=0;){const e=s[n],[t,r]=e;if("enter"===t){const{type:e}=r;if("labelImage"===e||"labelLink"===e)break}}if(n>=0){const t=s[n],[,o]=t,i=s[s.length-1],[,l]=i,c={type:"undefinedReferenceShortcut",start:o.start,end:l.end},u={type:"undefinedReference",start:o.start,end:l.end},d=s.slice(n).filter(e=>{const[,t]=e,{type:n}=t;return"data"===n||"lineEnding"===n}),p=r.length>0&&r[r.length-1][0],h=p&&p[1];h&&h.end.line===c.start.line&&h.end.column===c.start.column&&(0===d.length?(h.type="undefinedReferenceCollapsed",h.end=l.end):(c.type="undefinedReferenceFull",c.start=h.start,r.pop()));const f=d.filter(e=>"enter"===e[0]).map(t=>getText$1(e,t[1])).join("").trim();if(f.length>0&&!f.includes("]")){const e=[];e.push(["enter",c,a],["enter",u,a]);for(const t of d){const[n,r]=t;e.push([n,{...r},a])}e.push(["exit",u,a],["exit",c,a]),r.push(e)}}return i(t)})};const i=void 0,a=!0,s=parse$9({...t,extensions:n}),l=preprocess()(e,i,a);return postprocess(s.document().write(l)).concat(...r)}finally{labelEnd.tokenize=o}}function parseInternal(e,t={},n={},r=0,o=void 0){const i=Boolean(t.freezeTokens),a=getEvents$1(e,n),s=[];let l=[];const c={type:"data",startLine:-1,startColumn:-1,endLine:-1,endColumn:-1,text:"ROOT",children:s,parent:null},u=[c];let d=c,p=null,h=null,f=!1;for(const A of a){const[a,s]=A,{type:m,start:g,end:y}=s,{column:v,line:b}=g,{column:x,line:w}=y,C=getText$1(e,s);if("enter"!==a||f)"exit"===a&&("htmlFlow"===m&&(f=!1),f||(i&&(Object.freeze(d.children),Object.freeze(d)),d=u.pop()));else{const i=d;if(u.push(i),d={type:m,startLine:b+r,startColumn:v,endLine:w+r,endColumn:x,text:C,children:[],parent:i===c?o||null:i},o&&Object.defineProperty(d,sharedExports.htmlFlowSymbol,{value:!0}),i.children.push(d),l.push(d),"htmlFlow"===d.type&&!micromarkHelpersExports.isHtmlFlowComment(d)){f=!0,p&&h||(p={...n,extensions:[{disable:{null:["codeIndented","htmlFlow"]}}]},h=e.split(sharedExports.newLineRe));const r=parseInternal(h.slice(d.startLine-1,d.endLine).join("\n"),t,p,d.startLine-1,d);d.children=r,l=l.concat(r[sharedExports.flatTokensSymbol])}}}return Object.defineProperty(s,sharedExports.flatTokensSymbol,{value:l}),i&&Object.freeze(s),s}function parse$8(e,t){return parseInternal(e,t)}const ignoredChildTypes=new Set(["codeFencedFence","definition","reference","resource"]),md044={names:["MD044","proper-names"],description:"Proper names should have the correct capitalization",tags:["spelling"],parser:"micromark",function:function(e,t){let n=e.config.names;if(n=Array.isArray(n)?n:[],n.sort((e,t)=>t.length-e.length||e.localeCompare(t)),0===n.length)return;const r=e.config.code_blocks,o=void 0===r||!!r,i=e.config.html_elements,a=void 0===i||!!i,s=new Set(["data"]);o&&(s.add("codeFlowValue"),s.add("codeTextData")),a&&(s.add("htmlFlowData"),s.add("htmlTextData"));const l=micromarkHelpersExports.filterByPredicate(e.parsers.micromark.tokens,e=>s.has(e.type),e=>e.children.filter(e=>!ignoredChildTypes.has(e.type))),c=[],u=new Set;for(const d of n){const e=helpersExports.escapeForRegExp(d),r=/^\W/.test(d)?"":"\\b_*",o=/\W$/.test(d)?"":"_*\\b",i=new RegExp(`(${r})(${e})${o}`,"gi");for(const a of l){let e=null;for(;null!==(e=i.exec(a.text));){const[,r,o]=e,i=a.startColumn+e.index+r.length,s=o.length,l=a.startLine,p={startLine:l,startColumn:i,endLine:l,endColumn:i+s-1};if(!n.includes(o)&&!c.some(e=>helpersExports.hasOverlap(e,p))){let e=[];u.has(a)||(e=micromarkHelpersExports.filterByTypes(parse$8(a.text),["literalAutolink"]).map(e=>({startLine:l,startColumn:a.startColumn+e.startColumn-1,endLine:l,endColumn:a.endColumn+e.endColumn-1})),c.push(...e),u.add(a)),e.some(e=>helpersExports.hasOverlap(e,p))||helpersExports.addErrorDetailIf(t,a.startLine,d,o,void 0,void 0,[i,s],{editColumn:i,deleteCount:s,insertText:d})}c.push(p)}}}}},altRe=helpersExports.getHtmlAttributeRe("alt"),ariaHiddenRe=helpersExports.getHtmlAttributeRe("aria-hidden"),md045={names:["MD045","no-alt-text"],description:"Images should have alternate text (alt text)",tags:["accessibility","images"],parser:"micromark",function:function(e,t){var n;const r=filterByTypesCached(["image"]);for(const i of r){if(micromarkHelpersExports.getDescendantsByType(i,["label","labelText"]).some(e=>0===e.text.length)){const e=i.startLine===i.endLine?[i.startColumn,i.endColumn-i.startColumn]:void 0;helpersExports.addError(t,i.startLine,void 0,void 0,e)}}const o=filterByTypesCached(["htmlText"],!0);for(const i of o){const{startColumn:e,startLine:r,text:o}=i,a=micromarkHelpersExports.getHtmlTagInfo(i);if(a&&!a.close&&"img"===a.name.toLowerCase()&&!altRe.test(o)&&"true"!==(null==(n=ariaHiddenRe.exec(o))?void 0:n[1].toLowerCase())){const n=[e,o.replace(helpersExports.nextLinesRe,"").length];helpersExports.addError(t,r,void 0,void 0,n)}}}},tokenTypeToStyle={codeFenced:"fenced",codeIndented:"indented"},md046={names:["MD046","code-block-style"],description:"Code block style",tags:["code"],parser:"micromark",function:function(e,t){let n=String(e.config.style||"consistent");for(const r of filterByTypesCached(["codeFenced","codeIndented"])){const{startLine:e,type:o}=r;"consistent"===n&&(n=tokenTypeToStyle[o]),helpersExports.addErrorDetailIf(t,e,n,tokenTypeToStyle[o])}}},md047={names:["MD047","single-trailing-newline"],description:"Files should end with a single newline character",tags:["blank_lines"],parser:"none",function:function(e,t){const n=e.lines.length,r=e.lines[n-1];helpersExports.isBlankLine(r)||helpersExports.addError(t,n,void 0,void 0,[r.length,1],{insertText:"\n",editColumn:r.length+1})}};function fencedCodeBlockStyleFor(e){return"~"===e[0]?"tilde":"backtick"}const md048={names:["MD048","code-fence-style"],description:"Code fence style",tags:["code"],parser:"micromark",function:function(e,t){let n=String(e.config.style||"consistent");const r=filterByTypesCached(["codeFenced"]);for(const o of r){const e=micromarkHelpersExports.getDescendantsByType(o,["codeFencedFence","codeFencedFenceSequence"])[0],{startLine:r,text:i}=e;"consistent"===n&&(n=fencedCodeBlockStyleFor(i)),helpersExports.addErrorDetailIf(t,r,n,fencedCodeBlockStyleFor(i))}}},intrawordRe=/^\w$/;function emphasisOrStrongStyleFor(e){return"*"===e[0]?"asterisk":"underscore"}const impl=(e,t,n,r,o,i,a="consistent")=>{const{lines:s,parsers:l}=e,c=micromarkHelpersExports.filterByPredicate(l.micromark.tokens,e=>e.type===n,e=>"htmlFlow"===e.type?[]:e.children);for(const u of c){const e=micromarkHelpersExports.getDescendantsByType(u,[r]),n=e[0],l=e[e.length-1];if(n&&l){const e=emphasisOrStrongStyleFor(n.text);if("consistent"===a&&(a=e),a!==e){if(!("underscore"===a&&(intrawordRe.test(s[n.startLine-1][n.startColumn-2])||intrawordRe.test(s[l.endLine-1][l.endColumn-1]))))for(const r of[n,l])helpersExports.addError(t,r.startLine,`Expected: ${a}; Actual: ${e}`,void 0,[r.startColumn,r.text.length],{editColumn:r.startColumn,deleteCount:r.text.length,insertText:"asterisk"===a?o:i})}}}},md049md050=[{names:["MD049","emphasis-style"],description:"Emphasis style",tags:["emphasis"],parser:"micromark",function:function(e,t){return impl(e,t,"emphasis","emphasisSequence","*","_",e.config.style||void 0)}},{names:["MD050","strong-style"],description:"Strong style",tags:["emphasis"],parser:"micromark",function:function(e,t){return impl(e,t,"strong","strongSequence","**","__",e.config.style||void 0)}}],idRe=helpersExports.getHtmlAttributeRe("id"),nameRe=helpersExports.getHtmlAttributeRe("name"),anchorRe=/\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu,lineFragmentRe=/^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/,childrenExclude=new Set(["image","reference","resource"]),tokensInclude=new Set(["characterEscapeValue","codeTextData","data","mathTextData"]);function convertHeadingToHTMLFragment(e){const t=micromarkHelpersExports.filterByPredicate(e.children,e=>tokensInclude.has(e.type),e=>childrenExclude.has(e.type)?[]:e.children).map(e=>e.text).join("");return"#"+encodeURIComponent(t.toLowerCase().replace(/[^\p{Letter}\p{Mark}\p{Number}\p{Connector_Punctuation}\- ]/gu,"").replace(/ /gu,"-"))}function unescapeStringTokenText(e){return micromarkHelpersExports.filterByTypes(e.children,["characterEscapeValue","data"]).map(e=>e.text).join("")}const md051={names:["MD051","link-fragments"],description:"Link fragments should be valid",tags:["links"],parser:"micromark",function:function(e,t){const n=e.config.ignore_case||!1,r=e.config.ignored_pattern||"",o=new RegExp(r||"^$"),i=new Map([["#top",0]]),a=filterByTypesCached(["atxHeadingText","setextHeadingText"]);for(const l of a){const e=convertHeadingToHTMLFragment(l);if("#"!==e){const t=i.get(e)||0;t&&i.set(`${e}-${t}`,0),i.set(e,t+1);let n=null;for(;null!==(n=anchorRe.exec(l.text));){const[,e]=n;i.has(e)||i.set(e,1)}}}for(const l of filterByTypesCached(["htmlText"],!0)){const e=micromarkHelpersExports.getHtmlTagInfo(l);if(e&&!e.close){const t=idRe.exec(l.text)||"a"===e.name.toLowerCase()&&nameRe.exec(l.text);t&&t.length>0&&i.set(`#${t[1]}`,0)}}const s=[["link","resourceDestinationString"],["definition","definitionDestinationString"]];for(const[l,c]of s){const e=filterByTypesCached([l]).filter(e=>{var t;return!("atxHeadingText"===(null==(t=e.parent)?void 0:t.type)&µmarkHelpersExports.isDocfxTab(e.parent.parent))});for(const r of e){const e=micromarkHelpersExports.filterByTypes(r.children,[c]);for(const a of e){const{endColumn:e,startColumn:s}=a,l=unescapeStringTokenText(a),c=l.slice(1),u=`#${encodeURIComponent(c)}`;if(l.length>1&&l.startsWith("#")&&!i.has(u)&&!lineFragmentRe.test(u)&&!o.test(c)){let o,a,c;r.startLine===r.endLine&&(o=r.text,a=[r.startColumn,r.endColumn-r.startColumn],c={editColumn:s,deleteCount:e-s});const u=l.toLowerCase(),d=[...i.keys()].find(e=>u===e.toLowerCase());d?((c||{}).insertText=d,n||d===l||helpersExports.addError(t,r.startLine,`Expected: ${d}; Actual: ${l}`,o,a,c)):helpersExports.addError(t,r.startLine,void 0,o,a)}}}}}},md052={names:["MD052","reference-links-images"],description:"Reference links and images should use a label that is defined",tags:["images","links"],parser:"none",function:function(e,t){const{config:n,lines:r}=e,o=n.shortcut_syntax||!1,i=new Set(n.ignored_labels||["x"]),{definitions:a,references:s,shortcuts:l}=getReferenceLinkImageData(),c=o?[...s.entries(),...l.entries()]:s.entries();for(const u of c){const[e,n]=u;if(!a.has(e)&&!i.has(e))for(const o of n){const[n,i,a]=o,s=r[n].slice(i,i+a);helpersExports.addError(t,n+1,`Missing link or image reference definition: "${e}"`,s,[i+1,s.length])}}}},linkReferenceDefinitionRe=/^ {0,3}\[([^\]]*[^\\])\]:/,md053={names:["MD053","link-image-reference-definitions"],description:"Link and image reference definitions should be needed",tags:["images","links"],parser:"none",function:function(e,t){const n=new Set(e.config.ignored_definitions||["//"]),r=e.lines,{references:o,shortcuts:i,definitions:a,duplicateDefinitions:s}=getReferenceLinkImageData(),l=e=>e.replace(linkReferenceDefinitionRe,"").trim().length>0,c={deleteCount:-1};for(const u of a.entries()){const[e,[a]]=u;if(!n.has(e)&&!o.has(e)&&!i.has(e)){const n=r[a];helpersExports.addError(t,a+1,`Unused link or image reference definition: "${e}"`,helpersExports.ellipsify(n),[1,n.length],l(n)?c:void 0)}}for(const u of s){const[e,o]=u;if(!n.has(e)){const n=r[o];helpersExports.addError(t,o+1,`Duplicate link or image reference definition: "${e}"`,helpersExports.ellipsify(n),[1,n.length],l(n)?c:void 0)}}}},backslashEscapeRe=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,removeBackslashEscapes=e=>e.replace(backslashEscapeRe,"$1"),autolinkDisallowedRe=/[ <>]/,autolinkAble=e=>{try{new URL(e)}catch{return!1}return!autolinkDisallowedRe.test(e)},md054={names:["MD054","link-image-style"],description:"Link and image style",tags:["images","links"],parser:"micromark",function:(e,t)=>{var n,r,o,i;const a=e.config,s=void 0===a.autolink||!!a.autolink,l=void 0===a.inline||!!a.inline,c=void 0===a.full||!!a.full,u=void 0===a.collapsed||!!a.collapsed,d=void 0===a.shortcut||!!a.shortcut,p=void 0===a.url_inline||!!a.url_inline;if(s&&l&&c&&u&&d&&p)return;const{definitions:h}=getReferenceLinkImageData(),f=filterByTypesCached(["autolink","image","link"]);for(const A of f){let e=null,a=null;const{endColumn:f,endLine:m,startColumn:g,startLine:y,text:v,type:b}=A,x="image"===b;let w=!1;if("autolink"===b)a=null==(n=micromarkHelpersExports.getDescendantsByType(A,[["autolinkEmail","autolinkProtocol"]])[0])?void 0:n.text,e=a,w=!s&&Boolean(a);else if(e=micromarkHelpersExports.getDescendantsByType(A,["label","labelText"])[0].text,a=null==(r=micromarkHelpersExports.getDescendantsByType(A,["resource","resourceDestination",["resourceDestinationLiteral","resourceDestinationRaw"],"resourceDestinationString"])[0])?void 0:r.text,a){const t=null==(o=micromarkHelpersExports.getDescendantsByType(A,["resource","resourceTitle","resourceTitleString"])[0])?void 0:o.text;w=!l||!p&&s&&!x&&!t&&e===a&&autolinkAble(a)}else{const t=0===micromarkHelpersExports.getDescendantsByType(A,["reference"]).length,n=null==(i=micromarkHelpersExports.getDescendantsByType(A,["reference","referenceString"])[0])?void 0:i.text,r=void 0===n,o=h.get(n||e);a=o&&o[1],w=a&&(t?!d:r?!u:!c)}if(w){let n,r;if(y===m){n=[g,f-g];let t=null;const o=l&&e,i=s&&!x&&autolinkAble(a);if(!o||!p&&i)i&&(t=`<${removeBackslashEscapes(a)}>`);else{t=`${x?"!":""}[${e.replace(/[[\]]/g,"\\$&")}](${a.replace(/[()]/g,"\\$&")})`}t&&(r={editColumn:n[0],insertText:t,deleteCount:n[1]})}helpersExports.addErrorContext(t,y,v.replace(helpersExports.nextLinesRe,""),void 0,void 0,n,r)}}}},whitespaceTypes=new Set(["linePrefix","whitespace"]),ignoreWhitespace=e=>e.filter(e=>!whitespaceTypes.has(e.type)),firstOrNothing=e=>e[0],lastOrNothing=e=>e[e.length-1],makeRange$1=(e,t)=>[e,t-e+1],md055={names:["MD055","table-pipe-style"],description:"Table pipe style",tags:["table"],parser:"micromark",function:function(e,t){let n=String(e.config.style||"consistent"),r="no_leading_or_trailing"!==n&&"trailing_only"!==n,o="no_leading_or_trailing"!==n&&"leading_only"!==n;const i=filterByTypesCached(["tableDelimiterRow","tableRow"]);for(const a of i){const e=firstOrNothing(a.children),i="tableCellDivider"===firstOrNothing(ignoreWhitespace(e.children)).type,s=lastOrNothing(a.children),l="tableCellDivider"===lastOrNothing(ignoreWhitespace(s.children)).type,c=i?l?"leading_and_trailing":"leading_only":l?"trailing_only":"no_leading_or_trailing";"consistent"===n&&(n=c,r=i,o=l),i!==r&&helpersExports.addErrorDetailIf(t,e.startLine,n,c,(r?"Missing":"Unexpected")+" leading pipe",void 0,makeRange$1(a.startColumn,e.startColumn)),l!==o&&helpersExports.addErrorDetailIf(t,s.endLine,n,c,(o?"Missing":"Unexpected")+" trailing pipe",void 0,makeRange$1(s.endColumn-1,a.endColumn-1))}}},makeRange=(e,t)=>[e,t-e+1],md056={names:["MD056","table-column-count"],description:"Table column count",tags:["table"],parser:"micromark",function:function(e,t){const n=filterByTypesCached(["tableDelimiterRow","tableRow"]);let r=0,o=null;for(const i of n){const e=micromarkHelpersExports.getParentOfType(i,["table"]);o!==e&&(r=0,o=e);const n=i.children.filter(e=>["tableData","tableDelimiter","tableHeader"].includes(e.type)),a=n.length;let s,l;r||=a,a<r?(s="Too few cells, row will be missing data",l=[i.endColumn-1,1]):r<a&&(s="Too many cells, extra data will be missing",l=makeRange(n[r].startColumn,i.endColumn-1)),helpersExports.addErrorDetailIf(t,i.endLine,r,a,s,void 0,l)}}},md058={names:["MD058","blanks-around-tables"],description:"Tables should be surrounded by blank lines",tags:["table"],parser:"micromark",function:function(e,t){const{lines:n}=e,r=filterByTypesCached(["blockQuotePrefix","linePrefix"]),o=filterByTypesCached(["table"]);for(const i of o){const e=i.startLine;helpersExports.isBlankLine(n[e-2])||helpersExports.addErrorContext(t,e,n[e-1].trim(),void 0,void 0,void 0,{insertText:micromarkHelpersExports.getBlockQuotePrefixText(r,e)});const o=i.endLine;helpersExports.isBlankLine(n[o])||helpersExports.addErrorContext(t,o,n[o-1].trim(),void 0,void 0,void 0,{lineNumber:o+1,insertText:micromarkHelpersExports.getBlockQuotePrefixText(r,o)})}}},allowedChildrenTypes=new Set(["codeText","htmlText"]),defaultProhibitedTexts=["click here","here","link","more"];function normalize$1(e){return e.replace(/[\W_]+/g," ").replace(/\s+/g," ").toLowerCase().trim()}const md059={names:["MD059","descriptive-link-text"],description:"Link text should be descriptive",tags:["accessibility","links"],parser:"micromark",function:function(e,t){const n=new Set((e.config.prohibited_texts||defaultProhibitedTexts).map(normalize$1));if(n.size>0){const e=filterByTypesCached(["link"]);for(const r of e){const e=micromarkHelpersExports.getDescendantsByType(r,["label","labelText"]);for(const r of e){const{children:e,endColumn:o,endLine:i,parent:a,startColumn:s,startLine:l,text:c}=r;if(!e.some(e=>allowedChildrenTypes.has(e.type))&&n.has(normalize$1(c))){const e=l===i?[s,o-s]:void 0;helpersExports.addErrorContext(t,l,a.text,void 0,void 0,e)}}}}}},[md019,md021]=md019md021,[md049,md050]=md049md050,rules=[md001,md003,md004,md005,md007,md009,md010,md011,md012,md013,md014,md018,md019,md020,md021,md022,md023,md024,md025,md026,md027,md028,md029,md030,md031,md032,md033,md034,md035,md036,md037,md038,md039,md040,md041,md042,md043,md044,md045,md046,md047,md048,md049,md050,md051,md052,md053,md054,md055,md056,md058,md059];for(const Wp of rules){const e=Wp.names[0].toLowerCase();Wp.information=new URL(`${homepage}/blob/v${version}/doc/${e}.md`)}function parseConfiguration(e,t,n){let r=null,o=null;const i=[];let a=0;return(n||[JSON.parse]).every(e=>{try{const n=e(t);return r=n&&"object"==typeof n&&!Array.isArray(n)?n:{},!1}catch(n){i.push(`Parser ${a++}: ${n.message}`)}return!0})&&(i.unshift(`Unable to parse '${e}'`),o=i.join("; ")),{config:r,message:o}}function validateRuleList(e,t){let n=null;if(e.length===rules.length)return n;const r={};for(const[o,i]of e.entries()){let e=function(e,n){return new Error(`Property '${e}' of custom rule at index ${t} is incorrect: '${n}'.`)};const t=o-rules.length;for(const r of["names","tags"]){const t=i[r];n||t&&Array.isArray(t)&&0!==t.length&&t.every(helpersExports.isString)&&!t.some(helpersExports.isEmptyString)||(n=e(r,t))}for(const r of[["description","string"],["function","function"]]){const t=r[0],o=i[t];n||o&&typeof o===r[1]||(n=e(t,o))}if(n||void 0===i.parser||"markdownit"===i.parser||"micromark"===i.parser||"none"===i.parser||(n=e("parser",i.parser)),n||!i.information||helpersExports.isUrl(i.information)||(n=e("information",i.information)),n||void 0===i.asynchronous||"boolean"==typeof i.asynchronous||(n=e("asynchronous",i.asynchronous)),!n&&i.asynchronous,!n){for(const e of i.names){const o=e.toUpperCase();n||void 0===r[o]||(n=new Error("Name '"+e+"' of custom rule at index "+t+" is already used as a name or tag.")),r[o]=!0}for(const e of i.tags){const o=e.toUpperCase();!n&&r[o]&&(n=new Error("Tag '"+e+"' of custom rule at index "+t+" is already used as a name.")),r[o]=!1}}}return n}function newResults(e){const t={};return Object.defineProperty(t,"toString",{value:function(n){let r=null;const o=[],i=Object.keys(t);i.sort();for(const a of i){const i=t[a];if(Array.isArray(i))for(const e of i){const t=e.ruleNames?e.ruleNames.join("/"):e.ruleName+"/"+e.ruleAlias;o.push(a+": "+e.lineNumber+": "+t+" "+e.ruleDescription+(e.errorDetail?" ["+e.errorDetail+"]":"")+(e.errorContext?' [Context: "'+e.errorContext+'"]':""))}else{if(!r){r={};for(const t of e){r[t.names[0].toUpperCase()]=t}}for(const[e,t]of Object.entries(i)){const i=r[e.toUpperCase()];for(const e of t){const t=Math.min(n?1:0,i.names.length-1),r=a+": "+e+": "+i.names[t]+" "+i.description;o.push(r)}}}}return o.join("\n")}}),t}function removeFrontMatter(e,t){let n=[];if(t){const r=e.match(t);if(r&&!r.index){const t=r[0];e=e.slice(t.length),n=t.split(helpersExports.newLineRe),n.length>0&&""===n[n.length-1]&&n.length--}}return{content:e,frontMatterLines:n}}function mapAliasToRuleNames(e){const t={};for(const n of e){const e=n.names[0].toUpperCase();for(const r of n.names){t[r.toUpperCase()]=[e]}for(const r of n.tags){const n=r.toUpperCase(),o=t[n]||[];o.push(e),t[n]=o}}return t}function getEffectiveConfig(e,t,n){const r=Object.keys(t).filter(e=>"DEFAULT"===e.toUpperCase()),o=0===r.length||!!t[r[0]],i={};for(const a of e){i[a.names[0].toUpperCase()]=o}for(const a of Object.keys(t)){let e=t[a];e?e instanceof Object||(e={}):e=!1;const r=a.toUpperCase();for(const t of n[r]||[])i[t]=e}return i}function getEnabledRulesPerLineNumber(e,t,n,r,o,i,a){let s={},l={};const c=[],u=new Array(1+n.length);function d(e,t,n){for(const[o,i]of e.entries()){if(!r){let e=null;for(;e=helpersExports.inlineCommentStartRe.exec(i);){const n=e[2].toUpperCase(),r=e.index+e[1].length,a=i.indexOf("--\x3e",r);if(-1===a)break;t(n,i.slice(r,a),o+1)}}n&&n()}}function p(e,t,n){n={...n};const r=e.startsWith("ENABLE"),o=t&&t.trim(),i=o?o.toUpperCase().split(/\s+/):c;for(const s of i)for(const e of a[s]||[])n[e]=r;return n}d([t.join("\n")],function(e,t){if("CONFIGURE-FILE"===e){const{config:e}=parseConfiguration("CONFIGURE-FILE",t,i);e&&(o={...o,...e})}});const h=getEffectiveConfig(e,o,a);for(const A of e){const e=A.names[0].toUpperCase();c.push(e),s[e]=!!h[e]}l=s,d(t,function(e,t){"ENABLE-FILE"!==e&&"DISABLE-FILE"!==e||(s=p(e,t,s))}),d(t,function(e,t){"CAPTURE"===e?l=s:"RESTORE"===e?s=l:"ENABLE"!==e&&"DISABLE"!==e||(s=p(e,t,s))},function(){u.push(s)}),d(t,function(e,t,r){const o="DISABLE-NEXT-LINE"===e;if("DISABLE-LINE"===e||o){const i=n.length+r+(o?1:0);u[i]=p(e,t,u[i])}});const f=[];for(const[A,m]of c.entries())u.some(e=>e[m])&&f.push(e[A]);return{effectiveConfig:h,enabledRulesPerLineNumber:u,enabledRuleList:f}}function lintContent(e,t,n,r,o,i,a,s,l,c,u,d,p){const h=e=>p(e instanceof Error?e:new Error(e)),f=removeFrontMatter(r=r.replace(/^\uFEFF/,""),s),{frontMatterLines:A}=f;r=f.content;const{effectiveConfig:m,enabledRulesPerLineNumber:g,enabledRuleList:y}=getEnabledRulesPerLineNumber(e,r.split(helpersExports.newLineRe),A,c,i,a,t),v=y.some(e=>"markdownit"===e.parser||void 0===e.parser),b=y.some(e=>"micromark"===e.parser),x=e.length!==rules.length,w=b?parse$8(r,{freezeTokens:x}):[],C=r,$=(r=helpersExports.clearHtmlCommentText(r)).split(helpersExports.newLineRe),_=e=>{const t=Object.freeze({markdownit:Object.freeze({tokens:e})}),r=Object.freeze({micromark:Object.freeze({tokens:w})}),o=Object.freeze({}),i={name:n,version:version,lines:Object.freeze($),frontMatterLines:Object.freeze(A)};initialize({...i,parsers:r,config:null});let a=[];const s=s=>{const c=s.names[0].toUpperCase(),u={};let d=o;void 0===s.parser?(u.tokens=e,d=t):"markdownit"===s.parser?d=t:"micromark"===s.parser&&(d=r);const p={...i,...u,parsers:d,config:m[c]};function h(e){throw new Error(`Value of '${e}' passed to onError by '${c}' is incorrect for '${n}'.`)}function f(e){(!e||!helpersExports.isNumber(e.lineNumber)||e.lineNumber<1||e.lineNumber>$.length)&&h("lineNumber");const t=e.lineNumber+A.length;if(!g[t][c])return;e.detail&&!helpersExports.isString(e.detail)&&h("detail"),e.context&&!helpersExports.isString(e.context)&&h("context"),e.information&&!helpersExports.isUrl(e.information)&&h("information"),e.range&&(!Array.isArray(e.range)||2!==e.range.length||!helpersExports.isNumber(e.range[0])||e.range[0]<1||!helpersExports.isNumber(e.range[1])||e.range[1]<1||e.range[0]+e.range[1]-1>$[e.lineNumber-1].length)&&h("range");const n=e.fixInfo,r={};if(n){helpersExports.isObject(n)||h("fixInfo"),void 0!==n.lineNumber&&((!helpersExports.isNumber(n.lineNumber)||n.lineNumber<1||n.lineNumber>$.length)&&h("fixInfo.lineNumber"),r.lineNumber=n.lineNumber+A.length);const t=n.lineNumber||e.lineNumber;void 0!==n.editColumn&&((!helpersExports.isNumber(n.editColumn)||n.editColumn<1||n.editColumn>$[t-1].length+1)&&h("fixInfo.editColumn"),r.editColumn=n.editColumn),void 0!==n.deleteCount&&((!helpersExports.isNumber(n.deleteCount)||n.deleteCount<-1||n.deleteCount>$[t-1].length)&&h("fixInfo.deleteCount"),r.deleteCount=n.deleteCount),void 0!==n.insertText&&(helpersExports.isString(n.insertText)||h("fixInfo.insertText"),r.insertText=n.insertText)}const o=e.information||s.information;a.push({lineNumber:t,ruleName:s.names[0],ruleNames:s.names,ruleDescription:s.description,ruleInformation:o?o.href:null,errorDetail:e.detail||null,errorContext:e.context||null,errorRange:e.range?[...e.range]:null,fixInfo:n?r:null})}const y=e=>f({lineNumber:1,detail:`This rule threw an exception: ${e.message||e}`}),v=()=>s.function(p,f);if(s.asynchronous){const e=Promise.resolve().then(v);return l?e.catch(y):e}try{v()}catch(b){if(!l)throw b;y(b)}return null},c=y.filter(e=>e.asynchronous),d=y.filter(e=>!e.asynchronous),f=[...c,...d],v=()=>p(null,(()=>{if(a.sort((e,t)=>e.ruleName.localeCompare(t.ruleName)||e.lineNumber-t.lineNumber),u<3){const e={ruleName:null,lineNumber:-1};a=a.filter((t,n,r)=>{delete t.fixInfo;const o=r[n-1]||e;return t.ruleName!==o.ruleName||t.lineNumber!==o.lineNumber})}if(0===u){const e={};for(const t of a){const n=e[t.ruleName]||[];n.push(t.lineNumber),e[t.ruleName]=n}a=e}else if(1===u)for(const e of a)e.ruleAlias=e.ruleNames[1]||e.ruleName,delete e.ruleNames;else for(const e of a)delete e.ruleName;return a})());try{const e=f.map(s);c.length>0?Promise.all(e.slice(0,c.length)).then(v).catch(h):v()}catch(b){h(b)}finally{initialize()}};if(!v||d){const e=v?deferRequire.requireMarkdownItCjs().getMarkdownItTokens(o(),C,$):[];_(e)}else Promise.all([__vitePreload(()=>import("./markdownit-B5MND-Q3.js").then(e=>e.m),[]),new Promise(e=>e(o()))]).then(([e,t])=>{const n=e.getMarkdownItTokens(t,C,$);_(n)}).catch(h)}function lintFile(e,t,n,r,o,i,a,s,l,c,u,d,p){u.readFile(n,"utf8",function(u,h){return u?p(u):lintContent(e,t,n,h,r,o,i,a,s,l,c,d,p)})}function lintInput(e,t,n){n=n||function(){};const r=[(e=e||{}).customRules||[]].flat().map(e=>({names:helpersExports.cloneIfArray(e.names),description:e.description,information:helpersExports.cloneIfUrl(e.information),tags:helpersExports.cloneIfArray(e.tags),parser:e.parser,asynchronous:e.asynchronous,function:e.function})),o=rules.concat(r),i=validateRuleList(o,t);if(i)return void n(i);let a=[];Array.isArray(e.files)?a=[...e.files]:e.files&&(a=[String(e.files)]);const s=e.strings||{},l=Object.keys(s),c=e.config||{default:!0},u=e.configParsers||void 0,d=void 0===e.frontMatter?helpersExports.frontMatterRe:e.frontMatter,p=!!e.handleRuleFailures,h=!!e.noInlineConfig,f=void 0===e.resultVersion?3:e.resultVersion,A=e.markdownItFactory||(()=>{throw new Error("The option 'markdownItFactory' was required (due to the option 'customRules' including a rule requiring the 'markdown-it' parser), but 'markdownItFactory' was not set.")}),m=e.fs||fs,g=mapAliasToRuleNames(o),y=newResults(o);let v=!1,b=0;function x(){let e=null;function r(t,r){return b--,t?(v=!0,n(t)):(y[e]=r,x(),null)}if(v);else if(a.length>0)b++,e=a.shift(),lintFile(o,g,e,A,c,u,d,p,h,f,m,t,r);else if(e=l.shift())b++,lintContent(o,g,e,s[e]||"",A,c,u,d,p,h,f,t,r);else if(0===b)return v=!0,n(null,y);return null}x(),x(),x(),x(),x(),x(),x(),x()}function lintAsync(e,t){return lintInput(e,!1,t)}function lintPromise(e){return new Promise((t,n)=>{lintAsync(e,(e,r)=>{e||!r?n(e):t(r)})})}function normalizeFixInfo(e,t=0){return{lineNumber:e.lineNumber||t,editColumn:e.editColumn||1,deleteCount:e.deleteCount||0,insertText:e.insertText||""}}function applyFix(e,t,n="\n"){const{editColumn:r,deleteCount:o,insertText:i}=normalizeFixInfo(t),a=r-1;return-1===o?null:e.slice(0,a)+i.replace(/\n/g,n)+e.slice(a+o)}function applyFixes(e,t){const n=helpersExports.getPreferredLineEnding(e,os),r=e.split(helpersExports.newLineRe);let o=t.filter(e=>e.fixInfo).map(e=>normalizeFixInfo(e.fixInfo,e.lineNumber));o.sort((e,t)=>{const n=-1===e.deleteCount,r=-1===t.deleteCount;return t.lineNumber-e.lineNumber||(n?1:r?-1:0)||t.editColumn-e.editColumn||t.insertText.length-e.insertText.length});let i={};o=o.filter(e=>{const t=e.lineNumber!==i.lineNumber||e.editColumn!==i.editColumn||e.deleteCount!==i.deleteCount||e.insertText!==i.insertText;return i=e,t}),i={lineNumber:-1};for(const l of o)l.lineNumber===i.lineNumber&&l.editColumn===i.editColumn&&!l.insertText&&l.deleteCount>0&&i.insertText&&!i.deleteCount&&(l.insertText=i.insertText,i.lineNumber=0),i=l;o=o.filter(e=>e.lineNumber);let a=-1,s=-1;for(const l of o){const{lineNumber:e,editColumn:t,deleteCount:o}=l,i=e-1,c=t-1;(i!==a||-1===o||c+o<=s-(o>0?0:1))&&(r[i]=applyFix(r[i],l,n)),a=i,s=c}return r.filter(e=>null!==e).join(n)}function _getDefaults(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _defaults=_getDefaults();function changeDefaults(e){_defaults=e}var noopTest={exec:()=>null};function edit(e,t=""){let n="string"==typeof e?e:e.source;const r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(other.caret,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}var other={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},newline$1=/^(?:[ \t]*(?:\n|$))+/,blockCode=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,fences=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr$1=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading$1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bullet=/(?:[*+-]|\d{1,9}[.)])/,lheadingCore=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lheading$1=edit(lheadingCore).replace(/bull/g,bullet).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),lheadingGfm=edit(lheadingCore).replace(/bull/g,bullet).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),_paragraph=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,blockText=/^[^\n]+/,_blockLabel=/(?!\s*\])(?:\\.|[^\[\]\\])+/,def=edit(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",_blockLabel).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),list$4=edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,bullet).getRegex(),_tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",_comment=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,html=edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",_comment).replace("tag",_tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),paragraph$1=edit(_paragraph).replace("hr",hr$1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex(),blockquote$1=edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",paragraph$1).getRegex(),blockNormal={blockquote:blockquote$1,code:blockCode,def:def,fences:fences,heading:heading$1,hr:hr$1,html:html,lheading:lheading$1,list:list$4,newline:newline$1,paragraph:paragraph$1,table:noopTest,text:blockText},gfmTable=edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",hr$1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex(),blockGfm={...blockNormal,lheading:lheadingGfm,table:gfmTable,paragraph:edit(_paragraph).replace("hr",hr$1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gfmTable).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex()},blockPedantic={...blockNormal,html:edit("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",_comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:noopTest,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:edit(_paragraph).replace("hr",hr$1).replace("heading"," *#{1,6} *[^\n]").replace("lheading",lheading$1).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},escape$2=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,inlineCode=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br=/^( {2,}|\\)\n(?!\s*$)/,inlineText=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_punctuation=/[\p{P}\p{S}]/u,_punctuationOrSpace=/[\s\p{P}\p{S}]/u,_notPunctuationOrSpace=/[^\s\p{P}\p{S}]/u,punctuation=edit(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,_punctuationOrSpace).getRegex(),_punctuationGfmStrongEm=/(?!~)[\p{P}\p{S}]/u,_punctuationOrSpaceGfmStrongEm=/(?!~)[\s\p{P}\p{S}]/u,_notPunctuationOrSpaceGfmStrongEm=/(?:[^\s\p{P}\p{S}]|~)/u,blockSkip=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,emStrongLDelimCore=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,emStrongLDelim=edit(emStrongLDelimCore,"u").replace(/punct/g,_punctuation).getRegex(),emStrongLDelimGfm=edit(emStrongLDelimCore,"u").replace(/punct/g,_punctuationGfmStrongEm).getRegex(),emStrongRDelimAstCore="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",emStrongRDelimAst=edit(emStrongRDelimAstCore,"gu").replace(/notPunctSpace/g,_notPunctuationOrSpace).replace(/punctSpace/g,_punctuationOrSpace).replace(/punct/g,_punctuation).getRegex(),emStrongRDelimAstGfm=edit(emStrongRDelimAstCore,"gu").replace(/notPunctSpace/g,_notPunctuationOrSpaceGfmStrongEm).replace(/punctSpace/g,_punctuationOrSpaceGfmStrongEm).replace(/punct/g,_punctuationGfmStrongEm).getRegex(),emStrongRDelimUnd=edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_notPunctuationOrSpace).replace(/punctSpace/g,_punctuationOrSpace).replace(/punct/g,_punctuation).getRegex(),anyPunctuation=edit(/\\(punct)/,"gu").replace(/punct/g,_punctuation).getRegex(),autolink$1=edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),_inlineComment=edit(_comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),tag=edit("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",_inlineComment).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_inlineLabel=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,link$1=edit(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",_inlineLabel).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),reflink=edit(/^!?\[(label)\]\[(ref)\]/).replace("label",_inlineLabel).replace("ref",_blockLabel).getRegex(),nolink=edit(/^!?\[(ref)\](?:\[\])?/).replace("ref",_blockLabel).getRegex(),reflinkSearch=edit("reflink|nolink(?!\\()","g").replace("reflink",reflink).replace("nolink",nolink).getRegex(),inlineNormal={_backpedal:noopTest,anyPunctuation:anyPunctuation,autolink:autolink$1,blockSkip:blockSkip,br:br,code:inlineCode,del:noopTest,emStrongLDelim:emStrongLDelim,emStrongRDelimAst:emStrongRDelimAst,emStrongRDelimUnd:emStrongRDelimUnd,escape:escape$2,link:link$1,nolink:nolink,punctuation:punctuation,reflink:reflink,reflinkSearch:reflinkSearch,tag:tag,text:inlineText,url:noopTest},inlinePedantic={...inlineNormal,link:edit(/^!?\[(label)\]\((.*?)\)/).replace("label",_inlineLabel).getRegex(),reflink:edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_inlineLabel).getRegex()},inlineGfm={...inlineNormal,emStrongRDelimAst:emStrongRDelimAstGfm,emStrongLDelim:emStrongLDelimGfm,url:edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},inlineBreaks={...inlineGfm,br:edit(br).replace("{2,}","*").getRegex(),text:edit(inlineGfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},block$3={normal:blockNormal,gfm:blockGfm,pedantic:blockPedantic},inline$1={normal:inlineNormal,gfm:inlineGfm,breaks:inlineBreaks,pedantic:inlinePedantic},escapeReplacements={"&":"&","<":"<",">":">",'"':""","'":"'"},getEscapeReplacement=e=>escapeReplacements[e];function escape2(e,t){if(t){if(other.escapeTest.test(e))return e.replace(other.escapeReplace,getEscapeReplacement)}else if(other.escapeTestNoEncode.test(e))return e.replace(other.escapeReplaceNoEncode,getEscapeReplacement);return e}function cleanUrl(e){try{e=encodeURI(e).replace(other.percentDecode,"%")}catch{return null}return e}function splitCells(e,t){var n;const r=e.replace(other.findPipe,(e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(other.splitPipe);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!(null==(n=r.at(-1))?void 0:n.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(other.slashPipe,"|");return r}function rtrim(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){if(e.charAt(r-o-1)!==t)break;o++}return e.slice(0,r-o)}function findClosingBracket(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function outputLink(e,t,n,r,o){const i=t.href,a=t.title||null,s=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:i,title:a,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,l}function indentCodeCompensation(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(null===r)return t;const o=r[1];return t.split("\n").map(e=>{const t=e.match(n.other.beginningSpace);if(null===t)return e;const[r]=t;return r.length>=o.length?e.slice(o.length):e}).join("\n")}var _Tokenizer=class{options;rules;lexer;constructor(e){this.options=e||_defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:rtrim(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=indentCodeCompensation(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){const t=rtrim(e,"#");this.options.pedantic?e=t.trim():t&&!this.rules.other.endingSpaceChar.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:rtrim(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=rtrim(t[0],"\n").split("\n"),n="",r="";const o=[];for(;e.length>0;){let t=!1;const i=[];let a;for(a=0;a<e.length;a++)if(this.rules.other.blockquoteStart.test(e[a]))i.push(e[a]),t=!0;else{if(t)break;i.push(e[a])}e=e.slice(a);const s=i.join("\n"),l=s.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${s}`:s,r=r?`${r}\n${l}`:l;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,o,!0),this.lexer.state.top=c,0===e.length)break;const u=o.at(-1);if("code"===(null==u?void 0:u.type))break;if("blockquote"===(null==u?void 0:u.type)){const t=u,i=t.raw+"\n"+e.join("\n"),a=this.blockquote(i);o[o.length-1]=a,n=n.substring(0,n.length-t.raw.length)+a.raw,r=r.substring(0,r.length-t.text.length)+a.text;break}if("list"===(null==u?void 0:u.type)){const t=u,i=t.raw+"\n"+e.join("\n"),a=this.list(i);o[o.length-1]=a,n=n.substring(0,n.length-u.raw.length)+a.raw,r=r.substring(0,r.length-t.raw.length)+a.raw,e=i.substring(o.at(-1).raw.length).split("\n");continue}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let a=!1;for(;e;){let n=!1,r="",s="";if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,e=>" ".repeat(3*e.length)),c=e.split("\n",1)[0],u=!l.trim(),d=0;if(this.options.pedantic?(d=2,s=l.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=l.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),o=this.rules.other.fencesBeginRegex(d),i=this.rules.other.headingBeginRegex(d),a=this.rules.other.htmlBeginRegex(d);for(;e;){const p=e.split("\n",1)[0];let h;if(c=p,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),h=c):h=c.replace(this.rules.other.tabCharGlobal," "),o.test(c))break;if(i.test(c))break;if(a.test(c))break;if(t.test(c))break;if(n.test(c))break;if(h.search(this.rules.other.nonSpaceChar)>=d||!c.trim())s+="\n"+h.slice(d);else{if(u)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(o.test(l))break;if(i.test(l))break;if(n.test(l))break;s+="\n"+c}u||c.trim()||(u=!0),r+=p+"\n",e=e.substring(p.length+1),l=h.slice(d)}}o.loose||(a?o.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(a=!0));let p,h=null;this.options.gfm&&(h=this.rules.other.listIsTask.exec(s),h&&(p="[ ] "!==h[0],s=s.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:r,task:!!h,checked:p,loose:!1,text:s,tokens:[]}),o.raw+=r}const s=o.items.at(-1);if(!s)return;s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd(),o.raw=o.raw.trimEnd();for(let e=0;e<o.items.length;e++)if(this.lexer.state.top=!1,o.items[e].tokens=this.lexer.blockTokens(o.items[e].text,[]),!o.loose){const t=o.items[e].tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));o.loose=n}if(o.loose)for(let e=0;e<o.items.length;e++)o.items[e].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){var t;const n=this.rules.block.table.exec(e);if(!n)return;if(!this.rules.other.tableDelimiter.test(n[2]))return;const r=splitCells(n[1]),o=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(null==(t=n[3])?void 0:t.trim())?n[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],a={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===o.length){for(const e of o)this.rules.other.tableAlignRight.test(e)?a.align.push("right"):this.rules.other.tableAlignCenter.test(e)?a.align.push("center"):this.rules.other.tableAlignLeft.test(e)?a.align.push("left"):a.align.push(null);for(let e=0;e<r.length;e++)a.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:a.align[e]});for(const e of i)a.rows.push(splitCells(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const t=rtrim(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=findClosingBracket(t[2],"()");if(-2===e)return;if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),outputLink(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return outputLink(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let o,i,a=n,s=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=[...o].length,r[3]||r[4]){a+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){s+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+s);const t=[...r[0]][0].length,l=e.slice(0,n+r.index+t+i);if(Math.min(n,i)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){var t;let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=n[0],r="mailto:"+e;else{let o;do{o=n[0],n[0]=(null==(t=this.rules.inline._backpedal.exec(n[0]))?void 0:t[0])??""}while(o!==n[0]);e=n[0],r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},_Lexer=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||_defaults,this.options.tokenizer=this.options.tokenizer||new _Tokenizer,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:other,block:block$3.normal,inline:inline$1.normal};this.options.pedantic?(t.block=block$3.pedantic,t.inline=inline$1.pedantic):this.options.gfm&&(t.block=block$3.gfm,this.options.breaks?t.inline=inline$1.breaks:t.inline=inline$1.gfm),this.tokenizer.rules=t}static get rules(){return{block:block$3,inline:inline$1}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(other.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){var r,o,i;for(this.options.pedantic&&(e=e.replace(other.tabCharGlobal," ").replace(other.spaceLine,""));e;){let a;if(null==(o=null==(r=this.options.extensions)?void 0:r.block)?void 0:o.some(n=>!!(a=n.call({lexer:this},e,t))&&(e=e.substring(a.raw.length),t.push(a),!0)))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);const n=t.at(-1);1===a.raw.length&&void 0!==n?n.raw+="\n":t.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);const n=t.at(-1);"paragraph"===(null==n?void 0:n.type)||"text"===(null==n?void 0:n.type)?(n.raw+="\n"+a.raw,n.text+="\n"+a.text,this.inlineQueue.at(-1).src=n.text):t.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);const n=t.at(-1);"paragraph"===(null==n?void 0:n.type)||"text"===(null==n?void 0:n.type)?(n.raw+="\n"+a.raw,n.text+="\n"+a.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title});continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),t.push(a);continue}let s=e;if(null==(i=this.options.extensions)?void 0:i.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(a=this.tokenizer.paragraph(s))){const r=t.at(-1);n&&"paragraph"===(null==r?void 0:r.type)?(r.raw+="\n"+a.raw,r.text+="\n"+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(a),n=s.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);const n=t.at(-1);"text"===(null==n?void 0:n.type)?(n.raw+="\n"+a.raw,n.text+="\n"+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(a);continue}if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var n,r,o;let i=e,a=null;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(i));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.anyPunctuation.exec(i));)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(i));)i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,l="";for(;e;){let a;if(s||(l=""),s=!1,null==(r=null==(n=this.options.extensions)?void 0:n.inline)?void 0:r.some(n=>!!(a=n.call({lexer:this},e,t))&&(e=e.substring(a.raw.length),t.push(a),!0)))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);const n=t.at(-1);"text"===a.type&&"text"===(null==n?void 0:n.type)?(n.raw+=a.raw,n.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,i,l)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let c=e;if(null==(o=this.options.extensions)?void 0:o.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(c=e.substring(0,t+1))}if(a=this.tokenizer.inlineText(c)){e=e.substring(a.raw.length),"_"!==a.raw.slice(-1)&&(l=a.raw.slice(-1)),s=!0;const n=t.at(-1);"text"===(null==n?void 0:n.type)?(n.raw+=a.raw,n.text+=a.text):t.push(a);continue}if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},_Renderer=class{options;parser;constructor(e){this.options=e||_defaults}space(e){return""}code({text:e,lang:t,escaped:n}){var r;const o=null==(r=(t||"").match(other.notSpaceStart))?void 0:r[0],i=e.replace(other.endingNewline,"")+"\n";return o?'<pre><code class="language-'+escape2(o)+'">'+(n?i:escape2(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:escape2(i,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,n=e.start;let r="";for(let i=0;i<e.items.length;i++){const t=e.items[i];r+=this.listitem(t)}const o=t?"ol":"ul";return"<"+o+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+o+">\n"}listitem(e){var t;let n="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===(null==(t=e.tokens[0])?void 0:t.type)?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=r+" "+escape2(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):n+=r+" "}return n+=this.parser.parse(e.tokens,!!e.loose),`<li>${n}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let o=0;o<e.header.length;o++)n+=this.tablecell(e.header[o]);t+=this.tablerow({text:n});let r="";for(let o=0;o<e.rows.length;o++){const t=e.rows[o];n="";for(let e=0;e<t.length;e++)n+=this.tablecell(t[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${escape2(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),o=cleanUrl(e);if(null===o)return r;let i='<a href="'+(e=o)+'"';return t&&(i+=' title="'+escape2(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const o=cleanUrl(e);if(null===o)return escape2(n);let i=`<img src="${e=o}" alt="${n}"`;return t&&(i+=` title="${escape2(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:escape2(e.text)}},_TextRenderer=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},_Parser=class e{options;renderer;textRenderer;constructor(e){this.options=e||_defaults,this.options.renderer=this.options.renderer||new _Renderer,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _TextRenderer}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){var n,r;let o="";for(let i=0;i<e.length;i++){const a=e[i];if(null==(r=null==(n=this.options.extensions)?void 0:n.renderers)?void 0:r[a.type]){const e=a,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){o+=t||"";continue}}const s=a;switch(s.type){case"space":o+=this.renderer.space(s);continue;case"hr":o+=this.renderer.hr(s);continue;case"heading":o+=this.renderer.heading(s);continue;case"code":o+=this.renderer.code(s);continue;case"table":o+=this.renderer.table(s);continue;case"blockquote":o+=this.renderer.blockquote(s);continue;case"list":o+=this.renderer.list(s);continue;case"html":o+=this.renderer.html(s);continue;case"paragraph":o+=this.renderer.paragraph(s);continue;case"text":{let n=s,r=this.renderer.text(n);for(;i+1<e.length&&"text"===e[i+1].type;)n=e[++i],r+="\n"+this.renderer.text(n);o+=t?this.renderer.paragraph({type:"paragraph",raw:r,text:r,tokens:[{type:"text",raw:r,text:r,escaped:!0}]}):r;continue}default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return o}parseInline(e,t=this.renderer){var n,r;let o="";for(let i=0;i<e.length;i++){const a=e[i];if(null==(r=null==(n=this.options.extensions)?void 0:n.renderers)?void 0:r[a.type]){const e=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){o+=e||"";continue}}const s=a;switch(s.type){case"escape":case"text":o+=t.text(s);break;case"html":o+=t.html(s);break;case"link":o+=t.link(s);break;case"image":o+=t.image(s);break;case"strong":o+=t.strong(s);break;case"em":o+=t.em(s);break;case"codespan":o+=t.codespan(s);break;case"br":o+=t.br(s);break;case"del":o+=t.del(s);break;default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return o}},_Hooks=class{options;block;constructor(e){this.options=e||_defaults}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?_Lexer.lex:_Lexer.lexInline}provideParser(){return this.block?_Parser.parse:_Parser.parseInline}},Marked=class{defaults=_getDefaults();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=_Parser;Renderer=_Renderer;TextRenderer=_TextRenderer;Lexer=_Lexer;Tokenizer=_Tokenizer;Hooks=_Hooks;constructor(...e){this.use(...e)}walkTokens(e,t){var n,r;let o=[];for(const i of e)switch(o=o.concat(t.call(this,i)),i.type){case"table":{const e=i;for(const n of e.header)o=o.concat(this.walkTokens(n.tokens,t));for(const n of e.rows)for(const e of n)o=o.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=i;o=o.concat(this.walkTokens(e.items,t));break}default:{const e=i;(null==(r=null==(n=this.defaults.extensions)?void 0:n.childTokens)?void 0:r[e.type])?this.defaults.extensions.childTokens[e.type].forEach(n=>{const r=e[n].flat(1/0);o=o.concat(this.walkTokens(r,t))}):e.tokens&&(o=o.concat(this.walkTokens(e.tokens,t)))}}return o}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){const t=this.defaults.renderer||new _Renderer(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,o=e.renderer[r],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new _Tokenizer(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,o=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new _Hooks;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;const r=n,o=e.hooks[r],i=t[r];_Hooks.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(o.call(t,e)).then(e=>i.call(t,e));const n=o.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return _Lexer.lex(e,t??this.defaults)}parser(e,t){return _Parser.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{const r={...n},o={...this.defaults,...r},i=this.onError(!!o.silent,!!o.async);if(!0===this.defaults.async&&!1===r.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==t)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const a=o.hooks?o.hooks.provideLexer():e?_Lexer.lex:_Lexer.lexInline,s=o.hooks?o.hooks.provideParser():e?_Parser.parse:_Parser.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(t):t).then(e=>a(e,o)).then(e=>o.hooks?o.hooks.processAllTokens(e):e).then(e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then(()=>e):e).then(e=>s(e,o)).then(e=>o.hooks?o.hooks.postprocess(e):e).catch(i);try{o.hooks&&(t=o.hooks.preprocess(t));let e=a(t,o);o.hooks&&(e=o.hooks.processAllTokens(e)),o.walkTokens&&this.walkTokens(e,o.walkTokens);let n=s(e,o);return o.hooks&&(n=o.hooks.postprocess(n)),n}catch(e2){return i(e2)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+escape2(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},markedInstance=new Marked;function marked(e,t){return markedInstance.parse(e,t)}async function downloadMarkdown(e){if(!e)return void console.warn("No content provided for PDF export");const t=await(async()=>{try{const{content:t}=await lintPromise({strings:{content:e}});if(!t.length)return e;return applyFixes(e,t)||e}catch(t){return console.error("Markdown linting failed:",t),e}})();let n;marked.setOptions({breaks:!0,gfm:!0});try{n=await marked.parse(t)}catch(i){return void console.error("Markdown parsing failed:",i)}const r=document.createElement("div");r.innerHTML=n,r.style.padding="20px",r.style.fontFamily="Arial, sans-serif",r.style.fontSize="12pt",r.style.lineHeight="1.5";r.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(e=>{e.style.color="#2196f3",e.style.fontSize="1.5em",e.style.paddingTop="8px",e.style.paddingBottom="8px"});r.querySelectorAll("strong").forEach(e=>{e.style.fontWeight="bold",e.style.display="inline"});r.querySelectorAll("p").forEach(e=>{e.style.marginBottom="12px"});r.querySelectorAll("hr").forEach(e=>{e.style.marginTop="8px",e.style.marginBottom="16px",e.style.border="0",e.style.borderTop="1px solid #e0e0e0"});const o={margin:[.5,.5,.5,.5],filename:"document.pdf",image:{type:"jpeg",quality:.98},html2canvas:{scale:2,useCORS:!0},jsPDF:{unit:"in",format:"letter",orientation:"portrait"}};try{await html2pdf().from(r).set(o).output("blob").then(e=>{const t=URL.createObjectURL(e),n=ioc.routerService.listen(()=>{URL.revokeObjectURL(t),n()});ioc.layoutService.downloadFile(t,"document.pdf")})}catch(a){console.error("PDF generation failed:",a)}}marked.options=marked.setOptions=function(e){return markedInstance.setOptions(e),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.getDefaults=_getDefaults,marked.defaults=_defaults,marked.use=function(...e){return markedInstance.use(...e),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.walkTokens=function(e,t){return markedInstance.walkTokens(e,t)},marked.parseInline=markedInstance.parseInline,marked.Parser=_Parser,marked.parser=_Parser.parse,marked.Renderer=_Renderer,marked.TextRenderer=_TextRenderer,marked.Lexer=_Lexer,marked.lexer=_Lexer.lex,marked.Tokenizer=_Tokenizer,marked.Hooks=_Hooks,marked.parse=marked,marked.options,marked.setOptions,marked.use,marked.walkTokens,marked.parseInline,_Parser.parse,_Lexer.lex;class MarkdownHelperService{loggerService=YS(TYPES.loggerService);buildMarkdownFromFields=(e,t,n={})=>{this.loggerService.log("markdownHelperService buildMarkdownFromFields",{fields:e,data:t});const r=[],{visible:o}=nI(e,t,n,n.permissions),i=new Set(o),a=e=>{if(i.has(e))if(e.type!==Mn$1.Typography){if(e.type===Mn$1.Text){const o=e.compute?e.compute(t,n):e.name?lodashExports.get(t,e.name):void 0,i=e.title;if(o){const e=String(o);r.push(i?`**${i}:** ${e}`:e)}return}if(e.fields)for(const t of e.fields)a(t);e.child&&a(e.child)}else e.placeholder&&r.push(`\n## ${e.placeholder}\n`)};for(const s of e)a(s);return r.join("\n")};printFields=async(e,t,n={})=>{this.loggerService.log("markdownHelperService printFields",{fields:e,data:t});const r=this.buildMarkdownFromFields(e,t,n);await downloadMarkdown(r)}}class ExplorerHelperService{loggerService=YS(TYPES.loggerService);*deepFlat(e){this.loggerService.log("explorerHelperService deepFlat");const t=new Set,n=[...e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),"directory"===e.type&&n.push(...e.nodes),yield e)}}}zS(TYPES.errorService,()=>new ErrorService),zS(TYPES.alertService,()=>new AlertService),zS(TYPES.layoutService,()=>new LayoutService),zS(TYPES.loggerService,()=>new LoggerService),zS(TYPES.routerService,()=>new RouterService),zS(TYPES.linkService,()=>new LinkService),zS(TYPES.symbolGlobalService,()=>new SymbolGlobalService),zS(TYPES.priceGlobalService,()=>new PriceGlobalService),zS(TYPES.backtestGlobalService,()=>new BacktestGlobalService),zS(TYPES.liveGlobalService,()=>new LiveGlobalService),zS(TYPES.explorerHelperService,()=>new ExplorerHelperService),zS(TYPES.markdownHelperService,()=>new MarkdownHelperService),zS(TYPES.exchangeMockService,()=>new ExchangeMockService),zS(TYPES.notificationMockService,()=>new NotificationMockService),zS(TYPES.storageMockService,()=>new StorageMockService),zS(TYPES.logMockService,()=>new LogMockService),zS(TYPES.statusMockService,()=>new StatusMockService),zS(TYPES.markdownMockService,()=>new MarkdownMockService),zS(TYPES.explorerMockService,()=>new ExplorerMockService),zS(TYPES.signalMockService,()=>new SignalMockService),zS(TYPES.heatMockService,()=>new HeatMockService),zS(TYPES.exchangeViewService,()=>new ExchangeViewService),zS(TYPES.notificationViewService,()=>new NotificationViewService),zS(TYPES.storageViewService,()=>new StorageViewService),zS(TYPES.logViewService,()=>new LogViewService),zS(TYPES.statusViewService,()=>new StatusViewService),zS(TYPES.markdownViewService,()=>new MarkdownViewService),zS(TYPES.explorerViewService,()=>new ExplorerViewService),zS(TYPES.signalViewService,()=>new SignalViewService),zS(TYPES.heatViewService,()=>new HeatViewService);const baseServices={errorService:YS(TYPES.errorService),layoutService:YS(TYPES.layoutService),loggerService:YS(TYPES.loggerService),routerService:YS(TYPES.routerService),alertService:YS(TYPES.alertService),linkService:YS(TYPES.linkService)},globalServices={symbolGlobalService:YS(TYPES.symbolGlobalService),priceGlobalService:YS(TYPES.priceGlobalService),backtestGlobalService:YS(TYPES.backtestGlobalService),liveGlobalService:YS(TYPES.liveGlobalService)},helperServices={explorerHelperService:YS(TYPES.explorerHelperService),markdownHelperService:YS(TYPES.markdownHelperService)},mockServices={exchangeMockService:YS(TYPES.exchangeMockService),notificationMockService:YS(TYPES.notificationMockService),storageMockService:YS(TYPES.storageMockService),logMockService:YS(TYPES.logMockService),statusMockService:YS(TYPES.statusMockService),markdownMockService:YS(TYPES.markdownMockService),explorerMockService:YS(TYPES.explorerMockService),signalMockService:YS(TYPES.signalMockService),heatMockService:YS(TYPES.heatMockService)},viewServices={exchangeViewService:YS(TYPES.exchangeViewService),notificationViewService:YS(TYPES.notificationViewService),storageViewService:YS(TYPES.storageViewService),logViewService:YS(TYPES.logViewService),statusViewService:YS(TYPES.statusViewService),markdownViewService:YS(TYPES.markdownViewService),explorerViewService:YS(TYPES.explorerViewService),signalViewService:YS(TYPES.signalViewService),heatViewService:YS(TYPES.heatViewService)},ioc={...baseServices,...globalServices,...helperServices,...mockServices,...viewServices};ioc.routerService.listen(({action:e,location:t})=>{"/error_page"!==t.pathname&&"/offline_page"!==t.pathname&&"PUSH"===e&&console.clear()}),window.addEventListener("unhandledrejection",e=>{ioc.errorService.handleGlobalError(new Error(e.reason))}),window.addEventListener("error",e=>{ioc.errorService.handleGlobalError(new Error(mL(e)))}),Object.assign(window,{ioc:ioc});const AUTO_HIDE_DURATION=5e3,AlertProvider=({children:e})=>{const[t,n]=reactExports.useState(ioc.alertService.current);return Xf(()=>ioc.alertService.reloadSubject.subscribe(()=>{n(ioc.alertService.current)})),factory$1(Fragment,{children:[!!t&&factory$1(Snackbar,{open:!0,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:t.pin?void 0:AUTO_HIDE_DURATION,onClose:t.pin?void 0:ioc.alertService.hideCurrent,sx:{zIndex:9999999},message:t.message},t.key),e]})},createRedirect=e=>()=>factory$1(Dw,{handler:async()=>{await e()},height:"calc(100vh - 80px)"}),getMainRoute=async()=>new URL(location.href,location.origin).searchParams.has("pine")?"/pine_page":"/main",join$1=(...e)=>(e=e.flat(1)).flatMap(e=>Array.isArray(e)?join$1(e):e).filter(Boolean),str=(...e)=>join$1(...e).join(" ");str.newline=(...e)=>join$1(...e).join("\n"),str.space=(...e)=>join$1(...e).join(" "),str.comma=(...e)=>join$1(...e).join(", "),str.dot=(...e)=>join$1(...e).join(". "),str.semicolon=(...e)=>join$1(...e).join(";"),str.table=(...e)=>`| ${join$1(...e).join(" | ")} |`;const useStyles$t=makeStyles()(e=>({root:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,background:e.palette.background.default,height:"100vh",width:"100vw",display:"flex",alignItems:"center",flexDirection:"column",gap:20,padding:15},container:{position:"relative",overflow:"clip",minWidth:375,maxWidth:375,padding:15},reveal:{width:"auto !important"}})),ERROR_LABEL="Data is outdated. Please refresh the page",OFFLINE_LABEL="Disconnected from server",ErrorView=({onLine:e=navigator.onLine})=>{const{classes:t}=useStyles$t();return factory$1(mx,{children:factory$1(Box$1,{className:t.root,children:factory$1(Box$1,{className:t.reveal,children:factory$1(Paper,{className:t.container,children:factory$1(Stack,{direction:"column",gap:"15px",children:[factory$1("span",{children:e?ERROR_LABEL:OFFLINE_LABEL}),factory$1(Button,{variant:"contained",onClick:()=>window.location.reload(),children:e?"Reload page":"Reconnect"})]})})})})})},ErrorPage=()=>factory$1(ErrorView,{}),AccountBalance=createSvgIcon$1([factory$1("path",{d:"m6.29 6 5.21-2.74L16.71 6z",opacity:".3"},"0"),factory$1("path",{d:"M6.5 10h-2v7h2v-7zm6 0h-2v7h2v-7zm8.5 9H2v2h19v-2zm-2.5-9h-2v7h2v-7zm-7-9L2 6v2h19V6l-9.5-5zM6.29 6l5.21-2.74L16.71 6H6.29z"},"1")],"AccountBalanceTwoTone"),Analytics=createSvgIcon$1([factory$1("path",{d:"M5 5h14v14H5z",opacity:".3"},"0"),factory$1("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z"},"1"),factory$1("path",{d:"M7 12h2v5H7zm8-5h2v10h-2zm-4 7h2v3h-2zm0-4h2v2h-2z"},"2")],"AnalyticsTwoTone"),ArrowBack=createSvgIcon$1(factory$1("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"}),"ArrowBack"),ArrowForward=createSvgIcon$1(factory$1("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),Cancel=createSvgIcon$1(factory$1("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel"),Close=createSvgIcon$1(factory$1("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),CopyAll=createSvgIcon$1(factory$1("path",{d:"M18 2H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H9V4h9v12zM3 15v-2h2v2H3zm0-5.5h2v2H3v-2zM10 20h2v2h-2v-2zm-7-1.5v-2h2v2H3zM5 22c-1.1 0-2-.9-2-2h2v2zm3.5 0h-2v-2h2v2zm5 0v-2h2c0 1.1-.9 2-2 2zM5 6v2H3c0-1.1.9-2 2-2z"}),"CopyAll"),DataObject=createSvgIcon$1(factory$1("path",{d:"M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7zm17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4h-1z"}),"DataObject"),Description=createSvgIcon$1(factory$1("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"}),"Description"),DonutSmall=createSvgIcon$1([factory$1("path",{d:"M15.99 9h3.43C18.6 7 17 5.4 15 4.58v3.43c.37.28.71.62.99.99zM4 12c0 3.35 2.04 6.24 5 7.42v-3.44c-1.23-.93-2-2.4-2-3.99C7 10.4 7.77 8.93 9 8V4.58C6.04 5.76 4 8.65 4 12zm11 3.99v3.43c2-.82 3.6-2.42 4.42-4.42h-3.43c-.28.37-.62.71-.99.99z",opacity:".3"},"0"),factory$1("path",{d:"M14.82 11h7.13c-.47-4.72-4.23-8.48-8.95-8.95v7.13c.85.31 1.51.97 1.82 1.82zM15 4.58C17 5.4 18.6 7 19.42 9h-3.43c-.28-.37-.62-.71-.99-.99V4.58zM2 12c0 5.19 3.95 9.45 9 9.95v-7.13C9.84 14.4 9 13.3 9 12c0-1.3.84-2.4 2-2.82V2.05c-5.05.5-9 4.76-9 9.95zm7-7.42v3.44c-1.23.92-2 2.39-2 3.98 0 1.59.77 3.06 2 3.99v3.44C6.04 18.24 4 15.35 4 12c0-3.35 2.04-6.24 5-7.42zm4 10.24v7.13c4.72-.47 8.48-4.23 8.95-8.95h-7.13c-.31.85-.97 1.51-1.82 1.82zm2 1.17c.37-.28.71-.61.99-.99h3.43C18.6 17 17 18.6 15 19.42v-3.43z"},"1")],"DonutSmallTwoTone"),Download=createSvgIcon$1(factory$1("path",{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"}),"Download"),ErrorIcon=createSvgIcon$1(factory$1("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}),"Error"),GitHub=createSvgIcon$1(factory$1("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub"),HourglassTop=createSvgIcon$1(factory$1("path",{d:"m6 2 .01 6L10 12l-3.99 4.01L6 22h12v-6l-4-4 4-3.99V2H6zm10 14.5V20H8v-3.5l4-4 4 4z"}),"HourglassTop"),Info=createSvgIcon$1(factory$1("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info"),Layers=createSvgIcon$1([factory$1("path",{d:"M6.26 9 12 13.47 17.74 9 12 4.53z",opacity:".3"},"0"),factory$1("path",{d:"m19.37 12.8-7.38 5.74-7.37-5.73L3 14.07l9 7 9-7zM12 2 3 9l1.63 1.27L12 16l7.36-5.73L21 9l-9-7zm0 11.47L6.26 9 12 4.53 17.74 9 12 13.47z"},"1")],"LayersTwoTone"),LiveTv=createSvgIcon$1(factory$1("path",{d:"M21 6h-7.59l3.29-3.29L16 2l-4 4-4-4-.71.71L10.59 6H3c-1.1 0-2 .89-2 2v12c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.11-.9-2-2-2zm0 14H3V8h18v12zM9 10v8l7-4z"}),"LiveTv"),ManageSearch=createSvgIcon$1(factory$1("path",{d:"M7 9H2V7h5v2zm0 3H2v2h5v-2zm13.59 7-3.83-3.83c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L22 17.59 20.59 19zM17 11c0-1.65-1.35-3-3-3s-3 1.35-3 3 1.35 3 3 3 3-1.35 3-3zM2 19h10v-2H2v2z"}),"ManageSearch"),NotificationImportant=createSvgIcon$1(factory$1("path",{d:"M18 16v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-5 0h-2v-2h2v2zm0-4h-2V8h2v4zm-1 10c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2z"}),"NotificationImportant"),PictureAsPdf=createSvgIcon$1(factory$1("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}),"PictureAsPdf"),PlayArrow=createSvgIcon$1(factory$1("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),Print=createSvgIcon$1(factory$1("path",{d:"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"}),"Print"),ReportProblem=createSvgIcon$1(factory$1("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"ReportProblem"),RequestQuote=createSvgIcon$1([factory$1("path",{d:"M6 20V4h7v4h5v12H6zm5-1h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4v-2h-2V9h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1z",opacity:".3"},"0"),factory$1("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v4h5v12H6zm5-1h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4v-2h-2V9h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1z"},"1")],"RequestQuoteTwoTone"),Schedule=createSvgIcon$1([factory$1("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},"0"),factory$1("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"Schedule"),Search=createSvgIcon$1(factory$1("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search"),SwapVert=createSvgIcon$1(factory$1("path",{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3 5 6.99h3V14h2V6.99h3L9 3z"}),"SwapVert"),Timeline=createSvgIcon$1(factory$1("path",{d:"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2z"}),"Timeline"),TrendingDown=createSvgIcon$1(factory$1("path",{d:"m16 18 2.29-2.29-4.88-4.88-4 4L2 7.41 3.41 6l6 6 4-4 6.3 6.29L22 12v6z"}),"TrendingDown"),TrendingUp=createSvgIcon$1(factory$1("path",{d:"m16 6 2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"}),"TrendingUp"),Warning$4=createSvgIcon$1(factory$1("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning"),baseRoutes=[{path:"/error_page",noHeader:!0,element:ErrorPage},{path:"/pine_page",noHeader:!0,element:QI(()=>__vitePreload(()=>import("./index-BCP4aeGv.js"),[]))}],dashboardRoutes=[{path:"/main",element:QI(()=>__vitePreload(()=>import("./index-Cle4ryUi.js"),__vite__mapDeps([0,1,2])))},{path:"/overview",element:QI(()=>__vitePreload(()=>import("./index-DDXw0lYL.js"),__vite__mapDeps([3,2,4,5,6])))},{path:"/dashboard",tabs:[{label:"Backtest Measures",description:str.newline("KPI metrics computed from historical backtest simulation runs.","Includes success rate, trade performance, daily trade counts, and revenue aggregated across all symbols."),isActive:()=>!0,icon:HourglassTop,path:"/dashboard/backtest",navigate:()=>ioc.routerService.push("/dashboard/backtest")},{label:"Live Measures",description:str.newline("KPI metrics collected from real-time live trading activity.","Tracks live success rate, trade performance, daily trade counts, and revenue aggregated across all symbols."),isActive:()=>!1,icon:LiveTv,path:"/dashboard/live",navigate:()=>ioc.routerService.push("/dashboard/live")}],element:QI(()=>__vitePreload(()=>import("./index-D_xsPZ0X.js"),__vite__mapDeps([7,5,2,4])))},{path:"/dashboard/:mode",tabs:[{label:"Backtest Measures",description:str.newline("KPI metrics computed from historical backtest simulation runs.","Includes success rate, trade performance, daily trade counts, and revenue aggregated across all symbols."),isActive:({routeParams:e})=>"backtest"===e.mode,icon:HourglassTop,path:"/dashboard/backtest",navigate:()=>ioc.routerService.push("/dashboard/backtest")},{label:"Live Measures",description:str.newline("KPI metrics collected from real-time live trading activity.","Tracks live success rate, trade performance, daily trade counts, and revenue aggregated across all symbols."),isActive:({routeParams:e})=>"live"===e.mode,icon:LiveTv,path:"/dashboard/live",navigate:()=>ioc.routerService.push("/dashboard/live")}],element:QI(()=>__vitePreload(()=>import("./index-D_xsPZ0X.js"),__vite__mapDeps([7,5,2,4])))},{path:"/notifications",element:QI(()=>__vitePreload(()=>import("./index-mHMR_sVK.js"),__vite__mapDeps([8,2,4])))},{path:"/logs",element:QI(()=>__vitePreload(()=>import("./index-HmxUvvMu.js"),__vite__mapDeps([9,10,2,4])))},{path:"/status",element:QI(()=>__vitePreload(()=>import("./index-C_jQT6Zw.js"),__vite__mapDeps([11,12,5,2,4,6])))},{path:"/status/:id",element:QI(()=>__vitePreload(()=>import("./index-C_jQT6Zw.js"),__vite__mapDeps([11,12,5,2,4,6])))},{path:"/report",element:QI(()=>__vitePreload(()=>import("./index-Coo1fwWW.js"),__vite__mapDeps([13,12,5,2,4])))},{path:"/dump",element:QI(()=>__vitePreload(()=>import("./index-C4_OGd1K.js"),__vite__mapDeps([14,12,6,10,2,4])))},{path:"/dump/:search",element:QI(()=>__vitePreload(()=>import("./index-C4_OGd1K.js"),__vite__mapDeps([14,12,6,10,2,4])))},{path:"/heat",element:QI(()=>__vitePreload(()=>import("./index-AF9AvKwr.js"),__vite__mapDeps([15,12,1,5,2,4])))},{path:"/price_chart",element:QI(()=>__vitePreload(()=>import("./index-UiRxh0X0.js"),__vite__mapDeps([16,12,5,2,4])))},{path:"/price_chart/:symbol",element:QI(()=>__vitePreload(()=>import("./index-UiRxh0X0.js"),__vite__mapDeps([16,12,5,2,4])))},{path:"/price_chart/:symbol/:interval",element:QI(()=>__vitePreload(()=>import("./index-UiRxh0X0.js"),__vite__mapDeps([16,12,5,2,4])))}],routes$m=[{path:"/",element:createRedirect(async()=>{ioc.routerService.push(await getMainRoute())})},...baseRoutes,...dashboardRoutes],getRouteItem=(()=>{let e=null,t=null;return()=>{const{pathname:n}=ioc.routerService.location;return e!==n&&(t=GS(routes$m,ioc.routerService.location.pathname),e=n),t}})();window.getRouteItem=getRouteItem;const IconWrapper=({icon:e,color:t})=>{const n=reactExports.useMemo(()=>alpha$2(lighten(t,.5),.42),[t]);return factory$1(Box$1,{sx:{background:n,padding:"6px",marginTop:"6px",marginBottom:"6px",marginLeft:"-2px",marginRight:"12px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},children:factory$1(e,{sx:{color:t}})})};var Warning$3={},_interopRequireDefault$1=interopRequireDefaultExports;Object.defineProperty(Warning$3,"__esModule",{value:!0});var default_1$1=Warning$3.default=void 0,_createSvgIcon$1=_interopRequireDefault$1(requireCreateSvgIcon()),_jsxRuntime$1=require$$2$1,_default$1=(0,_createSvgIcon$1.default)((0,_jsxRuntime$1.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning");default_1$1=Warning$3.default=_default$1;const Context=reactExports.createContext(null);function useUniquePrefix(){const[e,t]=reactExports.useState(null);return reactExports.useEffect(()=>{t(`mui-p-${Math.round(1e5*Math.random())}`)},[]),e}function TabContext(e){const{children:t,value:n}=e,r=useUniquePrefix(),o=reactExports.useMemo(()=>({idPrefix:r,value:n}),[r,n]);return factory$1(Context.Provider,{value:o,children:t})}function useTabContext(){return reactExports.useContext(Context)}function getPanelId(e,t){const{idPrefix:n}=e;return null===n?null:`${e.idPrefix}-P-${t}`}function getTabId(e,t){const{idPrefix:n}=e;return null===n?null:`${e.idPrefix}-T-${t}`}const _excluded=["children"],TabList=reactExports.forwardRef(function(e,t){const{children:n}=e,r=_objectWithoutPropertiesLoose(e,_excluded),o=useTabContext();if(null===o)throw new TypeError("No TabContext provided");const i=reactExports.Children.map(n,e=>reactExports.isValidElement(e)?reactExports.cloneElement(e,{"aria-controls":getPanelId(o,e.props.value),id:getTabId(o,e.props.value)}):null);return factory$1(Tabs,_extends({},r,{ref:t,value:o.value,children:i}))}),sanitize={allowCustomElements:!0,allowElements:["text-underline","blank-link"],allowAttributes:{href:["blank-link"]}};var Notifications={},_interopRequireDefault=interopRequireDefaultExports;Object.defineProperty(Notifications,"__esModule",{value:!0});var default_1=Notifications.default=void 0,_createSvgIcon=_interopRequireDefault(requireCreateSvgIcon()),_jsxRuntime=require$$2$1,_default=(0,_createSvgIcon.default)((0,_jsxRuntime.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"}),"Notifications");default_1=Notifications.default=_default;const reloadSubject=new ar,Loader$1=()=>factory$1(Dw,{sx:{width:350,height:"calc(100% - 96px)"}}),useStyles$s=makeStyles()(e=>({list:{pt:1,pb:1,"& > *":{paddingTop:0,paddingBottom:0,"& > *":{paddingTop:0,paddingBottom:0}}},listItemAccient:{background:alpha$2(e.palette.getContrastText(e.palette.background.paper),.018)}})),getNotificationColor$1=e=>{switch(e.type){case"signal.opened":case"activate_scheduled.commit":case"signal_sync.open":return"#4CAF50";case"signal.closed":case"signal_sync.close":return"#2196F3";case"signal.scheduled":case"average_buy.commit":case"error.info":case"error.validation":return"#FF9800";case"signal.cancelled":case"cancel_scheduled.commit":return"#9E9E9E";case"partial_profit.available":case"partial_profit.commit":return"#8BC34A";case"partial_loss.available":case"partial_loss.commit":return"#FF5722";case"breakeven.available":case"breakeven.commit":return"#00BCD4";case"trailing_stop.commit":case"trailing_take.commit":return"#673AB7";case"close_pending.commit":return"#607D8B";case"risk.rejection":return"#F44336";case"error.critical":return"#D32F2F";case"signal.info":return"#9C27B0";default:return}},getNotificationIcon$1=e=>{const t={color:"white",mt:"-1px"};switch(e.type){case"signal.opened":case"partial_profit.available":case"partial_profit.commit":return factory$1(TrendingUp,{sx:t});case"signal.closed":case"signal_sync.close":case"close_pending.commit":return factory$1(Close,{sx:t});case"signal.scheduled":return factory$1(Schedule,{sx:t});case"signal.cancelled":case"cancel_scheduled.commit":return factory$1(Cancel,{sx:t});case"partial_loss.available":case"partial_loss.commit":case"average_buy.commit":return factory$1(TrendingDown,{sx:t});case"breakeven.available":case"breakeven.commit":return factory$1(SwapVert,{sx:t});case"activate_scheduled.commit":case"signal_sync.open":return factory$1(PlayArrow,{sx:t});case"trailing_stop.commit":case"trailing_take.commit":return factory$1(Timeline,{sx:t});case"risk.rejection":return factory$1(ReportProblem,{sx:t});case"error.info":case"error.validation":case"signal.info":return factory$1(NotificationImportant,{sx:t});case"error.critical":return factory$1(ErrorIcon,{sx:t});default:return factory$1(default_1$1,{sx:{...t,mt:"-2px"}})}},getNotificationTitle$1=e=>{switch(e.type){case"signal.opened":return`${t$1("Opened")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal.closed":return`${t$1("Closed")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;case"signal.scheduled":return`${t$1("Scheduled")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal.cancelled":return`${t$1("Cancelled")} ${e.symbol}`;case"partial_profit.available":return`${t$1("Partial profit")} ${e.level}% ${e.symbol}`;case"partial_profit.commit":return`${t$1("Profit fixed")} ${e.percentToClose}% ${e.symbol}`;case"partial_loss.available":return`${t$1("Partial loss")} ${e.level}% ${e.symbol}`;case"partial_loss.commit":return`${t$1("Loss fixed")} ${e.percentToClose}% ${e.symbol}`;case"breakeven.available":return`${t$1("Breakeven available")} ${e.symbol}`;case"breakeven.commit":return`${t$1("Breakeven set")} ${e.symbol}`;case"activate_scheduled.commit":return`${t$1("Activated")} ${e.position.toUpperCase()} ${e.symbol}`;case"average_buy.commit":return`${t$1("Average Buy")} ${e.symbol}`;case"trailing_stop.commit":return`${t$1("Trailing stop")} ${e.symbol}`;case"trailing_take.commit":return`${t$1("Trailing take")} ${e.symbol}`;case"signal_sync.open":return`${t$1("Sync Open")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal_sync.close":return`${t$1("Sync Close")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;case"cancel_scheduled.commit":return`${t$1("Cancel Scheduled")} ${e.symbol}`;case"close_pending.commit":return`${t$1("Close Pending")} ${e.symbol}`;case"risk.rejection":return`${t$1("Rejected")} ${e.position.toUpperCase()} ${e.symbol}`;case"error.info":return`${t$1("Error")}: ${e.message}`;case"error.validation":return`${t$1("Validation")}: ${e.message}`;case"error.critical":return`${t$1("Critical")}: ${e.message}`;case"signal.info":return`${t$1("Signal Info")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;default:return`${t$1("Unknown")} ${lodashExports.get(e,"type")}`}},handleNotificationClick$1=e=>{switch(e.type){case"risk.rejection":ioc.layoutService.pickRisk(e.id);break;case"signal.opened":ioc.layoutService.pickSignalOpened(e.id);break;case"signal.closed":ioc.layoutService.pickSignalClosed(e.id);break;case"signal.scheduled":ioc.layoutService.pickSignalScheduled(e.id);break;case"signal.cancelled":ioc.layoutService.pickSignalCancelled(e.id);break;case"partial_profit.available":ioc.layoutService.pickPartialProfitAvailable(e.id);break;case"partial_profit.commit":ioc.layoutService.pickPartialProfitCommit(e.id);break;case"partial_loss.available":ioc.layoutService.pickPartialLossAvailable(e.id);break;case"partial_loss.commit":ioc.layoutService.pickPartialLossCommit(e.id);break;case"breakeven.available":ioc.layoutService.pickBreakevenAvailable(e.id);break;case"breakeven.commit":ioc.layoutService.pickBreakevenCommit(e.id);break;case"trailing_stop.commit":ioc.layoutService.pickTrailingStop(e.id);break;case"trailing_take.commit":ioc.layoutService.pickTrailingTake(e.id);break;case"activate_scheduled.commit":ioc.layoutService.pickActivateScheduled(e.id);break;case"average_buy.commit":ioc.layoutService.pickAverageBuyCommit(e.id);break;case"signal_sync.open":ioc.layoutService.pickSignalSyncOpen(e.id);break;case"signal_sync.close":ioc.layoutService.pickSignalSyncClose(e.id);break;case"cancel_scheduled.commit":ioc.layoutService.pickCancelScheduled(e.id);break;case"close_pending.commit":ioc.layoutService.pickClosePending(e.id);break;case"signal.info":ioc.layoutService.pickSignalNotify(e.id)}},NotificationView$1=()=>{const[e,t]=reactExports.useState(),{classes:n}=useStyles$s(),[r,o]=reactExports.useState(0),[i,a]=reactExports.useState("all");return factory$1(Fragment,{children:[factory$1(Zl,{onClick:async({currentTarget:e})=>{reloadSubject.next(),t(e)},onLoadStart:()=>o(e=>e+1),onLoadEnd:()=>o(e=>e-1),color:"inherit",sx:{ml:{xs:1,md:2},mr:{xs:1,sm:2}},children:factory$1(Tooltip$2,{title:t$1("Notifications"),children:factory$1(default_1,{sx:{color:"white !important",opacity:r?.8:1}})})}),factory$1(Popover$1,{open:!!e,anchorEl:e,hidden:!1,onClose:()=>{t(null),a("all")},anchorOrigin:{vertical:"bottom",horizontal:"right"},children:factory$1(TabContext,{value:i,children:factory$1(List,{sx:{width:350,height:448},subheader:factory$1(Stack,{direction:"row",justifyContent:"space-between",children:[factory$1(ListSubheader,{component:Typography,sx:{fontWeight:"bold"},children:t$1("all"===i?"All":"Signals")}),factory$1(TabList,{onChange:(e,t)=>a(t),sx:{"& .MuiTabs-indicator":{background:"#3F51B5 !important"}},color:"secondary",variant:"standard",children:[factory$1(Tab,{icon:factory$1(ManageSearch,{}),value:"all"}),factory$1(Tab,{icon:factory$1(TrendingUp,{}),value:"signals"})]})]}),children:["all"===i&&factory$1(Jr,{Loader:Loader$1,children:async()=>{const e=await ioc.notificationViewService.getList();return factory$1(vi$1,{className:n.list,sx:{width:350,height:"calc(100% - 48px)"},children:e.map((e,r)=>factory$1(ListItem,{className:clsx$2({[n.listItemAccient]:r%2==0}),disableGutters:!0,children:factory$1(ListItemButton,{onClick:()=>{handleNotificationClick$1(e),t(null)},children:[factory$1(ListItemAvatar,{children:factory$1(Avatar,{sx:{background:getNotificationColor$1(e)},children:getNotificationIcon$1(e)})}),factory$1(ListItemText,{primary:factory$1(DE,{config:sanitize,handler:()=>getNotificationTitle$1(e)}),secondary:"timestamp"in e?J$2(e.timestamp).format("HH:mm DD/MM/YYYY"):"N/A"}),factory$1(IconButton,{disableRipple:!0,children:factory$1(default_1$k,{})})]})},e.id))})}}),"signals"===i&&factory$1(Jr,{Loader:Loader$1,children:async()=>{const e=(await ioc.notificationViewService.getList()).filter(e=>e.type.startsWith("signal.")||e.type.startsWith("signal_sync."));return factory$1(vi$1,{className:n.list,sx:{width:350,height:"calc(100% - 48px)"},children:e.map((e,r)=>factory$1(ListItem,{className:clsx$2({[n.listItemAccient]:r%2==0}),disableGutters:!0,children:factory$1(ListItemButton,{onClick:()=>{handleNotificationClick$1(e),t(null)},children:[factory$1(ListItemAvatar,{children:factory$1(Avatar,{sx:{background:getNotificationColor$1(e)},children:getNotificationIcon$1(e)})}),factory$1(ListItemText,{primary:factory$1(DE,{config:sanitize,handler:()=>getNotificationTitle$1(e)}),secondary:"timestamp"in e?J$2(e.timestamp).format("HH:mm DD/MM/YYYY"):"N/A"}),factory$1(IconButton,{disableRipple:!0,children:factory$1(default_1$k,{})})]})},e.id))})}})]})})})]})},Tooltip=({description:e,placement:t="left",children:n})=>{const{isDesktop:r}=tl(),o=reactExports.useMemo(()=>({popper:{sx:{pointerEvents:"none"},modifiers:r?[{name:"fallbackPlacements",options:{fallbackPlacements:["right","top","bottom"]}}]:void 0},tooltip:{sx:{background:"black",p:1.5,fontSize:"16px"}},arrow:{sx:{color:"black"}}}),[r]),i=reactExports.useMemo(()=>({placement:r?t:void 0}),[r,t]);return factory$1(Tooltip$2,{title:e,slotProps:o,...i,arrow:!0,children:n})},LOADER_HEIGHT=4,TAB_ACTION_PREFIX="tab-action-",LOGO_SRC="/logo/icon512_maskable.png",LOGO_CLASS="backtest-kit-logo",LOGO_SIDE=32,HEADER_HEIGHT$3="80px",MARGIN_BOTTOM="10px",useStyles$r=makeStyles()(e=>({root:{position:"sticky",top:0,zIndex:9,height:HEADER_HEIGHT$3,display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"},container:{flex:1,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"8px",paddingRight:"8px",position:"relative",marginBottom:MARGIN_BOTTOM,alignItems:"center",backdropFilter:"saturate(180%) blur(20px)",backgroundColor:alpha$2(darken$1(e.palette.primary.main,.2),.8),"&:hover":{[`& .${LOGO_CLASS}`]:{opacity:1}}},title:{color:"white",paddingLeft:e.spacing(1),paddingRight:e.spacing(3),transition:"opacity 500ms",opacity:"0.8",cursor:"pointer",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold"},loader:{position:"absolute",bottom:0,left:0,width:"100%",minHeight:`${LOADER_HEIGHT}px`,maxHeight:`${LOADER_HEIGHT}px`,marginTop:`-${LOADER_HEIGHT}px`,zIndex:2},logo:{transition:"opacity 500ms",marginLeft:"8px",marginRight:"-6px",opacity:"0.5"},actionMenu:{"& svg":{color:"white"}},stretch:{flex:1},tabsRoot:{minHeight:`calc(${HEADER_HEIGHT$3} - ${MARGIN_BOTTOM})`,height:`calc(${HEADER_HEIGHT$3} - ${MARGIN_BOTTOM})`,color:"white"},tabRoot:{minHeight:`calc(${HEADER_HEIGHT$3} - ${MARGIN_BOTTOM})`,height:`calc(${HEADER_HEIGHT$3} - ${MARGIN_BOTTOM})`,color:"white"},tabIndicator:{height:"4px",background:"white"}})),default_actions=[{action:"github-action",icon:()=>factory$1(IconWrapper,{icon:GitHub,color:"#6A1B9A "}),label:"Open GitHub"}],AppHeader=({routeItem:e,routeParams:t,pathname:n,loading:r})=>{const{classes:o,cx:i}=useStyles$r(),{activeTabPath:a,tabs:s}=reactExports.useMemo(()=>{if(!e.tabs)return{tabs:[],activeTabPath:""};const r=e.tabs.find(({isActive:r})=>r({routeItem:e,routeParams:t,pathname:n}));return{activeTabPath:(null==r?void 0:r.path)??"",tabs:e.tabs}},[e,t,n]),l=reactExports.useMemo(()=>a?s.filter(({isActive:r})=>!r({pathname:n,routeItem:e,routeParams:t})).map(({label:e,icon:t},n)=>({label:e,action:`${TAB_ACTION_PREFIX}${n}`,icon:t?()=>factory$1(IconWrapper,{icon:t,color:"#4caf50"}):void 0})):default_actions,[a,s]);if(e.noHeader)return null;return factory$1(Box$1,{className:o.root,children:factory$1(Box$1,{className:o.container,children:[factory$1(rb,{onClick:()=>ioc.routerService.push("/main"),className:i(o.logo,LOGO_CLASS),children:factory$1(Avatar,{style:{height:LOGO_SIDE,width:LOGO_SIDE},src:LOGO_SRC})}),factory$1(Typography,{variant:"h4",onClick:()=>ioc.routerService.push("/main"),className:i(o.title,LOGO_CLASS),sx:{display:{xs:"none",sm:"flex"},whiteSpace:"nowrap"},children:"Backtest Kit"}),s.length?factory$1(Tabs,{variant:"scrollable",value:a,textColor:"inherit",sx:{display:{xs:"none",sm:"flex"}},classes:{root:o.tabsRoot,indicator:o.tabIndicator},children:s.filter(({visible:e=!0})=>e).map(({label:r,icon:i,disabled:a,path:s,description:l,navigate:c},u,d)=>factory$1(Tab,{sx:{minWidth:128,fontWeight:"bold",mr:u<d.length-1?2:0},value:s,label:factory$1(Tooltip,{description:l,placement:"bottom",children:factory$1(Typography,{variant:"h6",children:r})}),onClick:()=>c({routeItem:e,routeParams:t,pathname:n}),disabled:a,icon:i&&factory$1(i,{}),iconPosition:"start",classes:{root:o.tabRoot}},`${s}-${u}`))},e.path):null,factory$1("div",{className:o.stretch}),factory$1(NotificationView$1,{}),factory$1(xa,{className:o.actionMenu,sx:{ml:{xs:1,md:2},mr:{xs:1,sm:2}},transparent:!0,onAction:async r=>{"github-action"===r&&ak("https://github.com/tripolskypetr/backtest-kit"),r.startsWith(TAB_ACTION_PREFIX)&&(r=>{const o=parseInt(r.slice(TAB_ACTION_PREFIX.length)),i=s.filter(({isActive:r})=>!r({pathname:n,routeItem:e,routeParams:t})).find((e,t)=>t===o);i&&i.navigate({routeItem:e,routeParams:t,pathname:n})})(r)},options:l}),!!r&&factory$1(LinearProgress,{className:o.loader})]})})};var define_process_env_default$1={},noop=function(){},_process$env;function createGetCachedLinkHref(){var e,t=getCreateObjectURL(),n=null;return function(r){return r===n?e:(t===noop&&(t=getCreateObjectURL()),e=(n=r)?t(new Blob([r],{type:"text/css"})):void 0)}}function getCreateObjectURL(){return"undefined"==typeof window?noop:(window.URL||window.webkitURL).createObjectURL||noop}var IS_PRODUCTION=void 0!==process$1&&"production"===(null==(_process$env=define_process_env_default$1)?void 0:_process$env.NODE_ENV),DEFAULT_OPTIONS={hasSourceMap:!IS_PRODUCTION,isMinified:IS_PRODUCTION,isPrefixed:!0},globalOptions=Object.assign({},DEFAULT_OPTIONS),hasOwnProperty=Object.prototype.hasOwnProperty;function normalizeOptions(e){var t,n=Object.assign({},globalOptions);for(t in e)hasOwnProperty.call(n,t)&&null!=e[t]&&(n[t]=!!e[t]);return n}function isName(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"-_*.:#[]".indexOf(e)>=0}function isQuote(e){return"'"===e||'"'===e}function isWhitespace$1(e){return" "===e||"\n"===e||"\t"===e||"\r"===e||"\f"===e}function beautify(e,t){void 0===t&&(t={}),e=e.replace(/\r\n/g,"\n");var n,r,o,i,a=t,s=a.autosemicolon,l=void 0!==s&&s,c=a.indent,u=void 0===c?" ":c,d=a.openbrace,p=void 0===d||d,h=0,f=e.length,A=[],m="",g=0,y=1,v=2,b=3,x=4,w=5,C=6,$=7,_=8,S=g,E=0,k=!1;function B(){for(var e=E;e>0;--e)m+=u}function P(){m=m.trimEnd(),p?m+=" {":(m+="\n",B(),m+="{"),"\n"!==r&&(m+="\n"),E+=1}function T(){var e;E-=1,(m=m.trimEnd()).length>0&&l&&";"!==(e=m.charAt(m.length-1))&&"{"!==e&&(m+=";"),m+="\n",B(),m+="}",A.push(m),m=""}for(;h<f;)if(n=e.charAt(h),r=e.charAt(h+1),++h,isQuote(i))m+=n,n===i&&(i=null),"\\"===n&&r===i&&(m+=r,++h);else if(isQuote(n))m+=n,i=n;else if(k)m+=n,"*"===n&&"/"===r&&(k=!1,m+=r,++h);else if("/"!==n||"*"!==r){if(S===g){if(0===A.length&&isWhitespace$1(n)&&0===m.length)continue;if(n<=" "||n.charCodeAt(0)>=128){S=g,m+=n;continue}if(isName(n)||"@"===n){if(0===(o=m.trimEnd()).length)A.length>0&&(m="\n\n");else{var I=o.charAt(o.length-1);if("}"===I||";"===I)m=o+"\n\n";else for(;" "===(r=m.charAt(m.length-1))||9===r.charCodeAt(0);)m=m.substr(0,m.length-1)}m+=n,S="@"===n?y:b;continue}}if(S!==y)if(S!==v)if(S!==b)if(S!==x)if(S!==w)if(S!==C)if(S!==$)S===_&&")"===n&&m.charAt(m.length-1!=="\\"?1:0)?(m+=n,S=$):m+=n;else{if("}"===n){T(),S=g,E>0&&(S=v);continue}if(";"===n){m=m.trimEnd(),m+=";\n",S=x;continue}if(m+=n,"("===n&&"l"===m.charAt(m.length-2)&&"r"===m.charAt(m.length-3)&&"u"===m.charAt(m.length-4)){S=_;continue}}else{if(!isWhitespace$1(n)){m+=n,S=$;continue}isQuote(r)&&(S=$)}else{if(":"===n){m=m.trimEnd(),m+=": ",S=$,isWhitespace$1(r)&&(S=C);continue}if("}"===n){T(),S=g,E>0&&(S=v);continue}m+=n}else{if("}"===n){T(),S=g,E>0&&(S=v);continue}if("\n"===n){m=m.trimEnd(),m+="\n";continue}if(!isWhitespace$1(n)){m=m.trimEnd(),m+="\n",B(),m+=n,S=w;continue}m+=n}else{if("{"===n){P(),S=x;continue}if("}"===n){T(),S=g;continue}m+=n}else{if(isName(n)){if(0===(o=m.trimEnd()).length)A.length>0&&(m="\n\n");else if("}"===o.charAt(o.length-1))m=o+"\n\n";else for(;" "===(r=m.charAt(m.length-1))||9===r.charCodeAt(0);)m=m.substr(0,m.length-1);B(),m+=n,S=b;continue}if("}"===n){T(),S=g;continue}m+=n}else{if(";"===n){m+=n,S=g;continue}if("{"===n){o=m.trimEnd(),P(),S="@font-face"===o?x:v;continue}m+=n}}else k=!0,m+=n,m+=r,++h;return m=A.join("")+m}function getProcessedStyles(e,t){return serialize(compile$1(e),t.isPrefixed?middleware([prefixer$1,stringify$8]):stringify$8)}function getRenderedStyles(e,t){var n=getProcessedStyles(e,t);return t.isMinified?n:beautify(n,{autosemicolon:!0,indent:" "})}var INTERNAL_PROPS={children:!0,hasSourceMap:!0,isMinified:!0,isPrefixed:!0};function useTagProps(e){var t={};for(var n in e)INTERNAL_PROPS[n]||(t[n]=e[n]);return t}function useStyle(e,t){var n=reactExports.useRef(e),r=reactExports.useRef();return r.current&&n.current===e||(r.current=getRenderedStyles(e,t),n.current=e),r.current}var Link=reactExports.forwardRef(function(e,t){var n=e.passedProps,r=e.style,o=reactExports.useMemo(createGetCachedLinkHref,[]);return reactExports.createElement("link",Object.assign({},n,{href:o(r),rel:"stylesheet",ref:t}))}),Style=reactExports.forwardRef(function(e,t){var n=e.hasSourceMap,r=e.isMinified,o=e.isPrefixed,i=useTagProps(e),a=reactExports.useMemo(function(){return normalizeOptions({hasSourceMap:n,isMinified:r,isPrefixed:o})},[n,r,o]),s=useStyle(e.children,a);return a.hasSourceMap?reactDomExports.createPortal(reactExports.createElement(Link,{passedProps:i,ref:t,style:s}),document.head):reactDomExports.createPortal(reactExports.createElement("style",Object.assign({},i,{ref:t}),s),document.head)});const IMAGE_SIDE="5vmin",IMAGE_LIST=["/images/cubes.png","/images/snow.png","/images/square.png","/images/triangle.png","/images/dots.png"],randomImage=()=>{const e=Math.floor(Date.now()/1e3/60)%IMAGE_LIST.length;return IMAGE_LIST[e]},BottomImage=()=>{const[e,t]=reactExports.useState(()=>randomImage());return reactExports.useEffect(()=>mr.fromInterval(6e4).connect(()=>t(randomImage())),[]),factory$1(Style,{children:`\n body {\n background-position: top calc(100vh - ${IMAGE_SIDE} - 24px) right 24px !important;\n background-size: ${IMAGE_SIDE}, auto, contain !important;\n background-image: url("${e}") !important;\n }\n `})},Loader=()=>factory$1(Box$1,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,height:"100vh",width:"100vw",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,background:e=>e.palette.background.paper},children:factory$1(eS,{})}),Fragment2=()=>factory$1(Fragment,{}),useStyles$q=makeStyles()(e=>({switch:{paddingLeft:e.spacing(1),paddingRight:e.spacing(1)}})),handleInit=so(async()=>{await WS.waitForProvide(!0),await WS.prefetch(!0)}),handleLoadStart=()=>{ioc.layoutService.setAppbarLoader(!0)},handleLoadEnd=()=>{ioc.layoutService.setAppbarLoader(!1)},App=()=>{const{classes:e}=useStyles$q(),[t,n]=reactExports.useState(()=>getRouteItem()),[r,o]=reactExports.useState(()=>KS(routes$m,ioc.routerService.location.pathname)),[i,a]=reactExports.useState(ioc.routerService.location.pathname),[s,l]=reactExports.useState(ioc.layoutService.hasAppbarLoader),[c,u]=reactExports.useState(ioc.layoutService.hasModalLoader);return Xf(()=>ioc.routerService.reloadSubject.subscribe(()=>{queueMicrotask(()=>reactDomExports.flushSync(()=>{n(getRouteItem()),o(KS(routes$m,ioc.routerService.location.pathname)),a(ioc.routerService.location.pathname)}))})),Xf(()=>ioc.layoutService.appbarSubject.subscribe(()=>{l(ioc.layoutService.hasAppbarLoader)})),Xf(()=>ioc.layoutService.modalSubject.subscribe(()=>{u(ioc.layoutService.hasModalLoader)})),factory$1(Fragment,{children:[!!t&&factory$1(AppHeader,{pathname:i,routeItem:t,routeParams:r,loading:s}),factory$1(Gg,{className:e.switch,Loader:Fragment2,history:ioc.routerService,items:routes$m,fallback:ioc.errorService.handleGlobalError,onLoadStart:handleLoadStart,onLoadEnd:handleLoadEnd,onInit:handleInit}),c&&factory$1(Loader,{}),factory$1(BottomImage,{})]})},lightPrimary={main:"#3F51B5",light:"#4E65C9"},lightSecondary={main:"#2196F3"},lightError={main:"#ec4c47"},lightWarning={main:"#d9822b"},lightInfo={main:"#1070CA"},lightSuccess={main:"#27AB6E"},lightBackground={muiTab:"#6974b066",muiAppBar:"#6974B0"},lightText={primary:"#000000DE",secondary:"#00000099",disabled:"#cccccc"},BREAKPOINTS={xs:0,sm:800,md:1100,lg:1300,xl:1736},muiTheme=createTheme$1({breakpoints:{values:BREAKPOINTS},palette:{mode:"light",primary:{main:lightPrimary.main},secondary:{main:lightSecondary.main},warning:{main:lightWarning.main},info:{main:lightInfo.main},success:{main:lightSuccess.main},error:{main:lightError.main},text:{primary:lightText.primary,secondary:lightText.secondary,disabled:lightText.disabled},background:{default:"#E8E9ED !important",paper:"#fff"}},shape:{borderRadius:12},shadows:["none","0px 1px 2px rgba(0, 0, 0, 0.1)","0px 2px 4px rgba(0, 0, 0, 0.1)","0px 3px 6px rgba(0, 0, 0, 0.2)","0px 4px 8px rgba(0, 0, 0, 0.2)","0px 5px 10px rgba(0, 0, 0, 0.3)","0px 6px 12px rgba(0, 0, 0, 0.3)","0px 7px 14px rgba(0, 0, 0, 0.4)","0px 8px 16px rgba(0, 0, 0, 0.4)","0px 9px 18px rgba(0, 0, 0, 0.5)","0px 10px 20px rgba(0, 0, 0, 0.5)","0px 11px 22px rgba(0, 0, 0, 0.6)","0px 12px 24px rgba(0, 0, 0, 0.6)","0px 13px 26px rgba(0, 0, 0, 0.7)","0px 14px 28px rgba(0, 0, 0, 0.7)","0px 15px 30px rgba(0, 0, 0, 0.8)","0px 16px 32px rgba(0, 0, 0, 0.8)","0px 17px 34px rgba(0, 0, 0, 0.9)","0px 18px 36px rgba(0, 0, 0, 0.9)","0px 19px 38px rgba(0, 0, 0, 1)","0px 20px 40px rgba(0, 0, 0, 1)","0px 21px 42px rgba(0, 0, 0, 1)","0px 22px 44px rgba(0, 0, 0, 1)","0px 23px 46px rgba(0, 0, 0, 1)","0px 24px 48px rgba(0, 0, 0, 1)"],components:{MuiModal:{styleOverrides:{backdrop:{backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)"}}},MuiPaper:{defaultProps:{elevation:3},styleOverrides:{root:{borderRadius:"12px",backgroundColor:"#ffffff",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.1)"}}},MuiCard:{styleOverrides:{root:{overflow:"clip"}}},MuiAppBar:{styleOverrides:{root:{background:lightBackground.muiAppBar}}},MuiTab:{styleOverrides:{fullWidth:{background:lightBackground.muiTab,color:"white !important",fontWeight:"bold"}}},MuiIconButton:{styleOverrides:{root:{borderRadius:6,padding:8},sizeSmall:{padding:4}}},MuiButton:{styleOverrides:{contained:{background:lightPrimary.main,"&:hover":{background:lightPrimary.light}}}},MuiBadge:{styleOverrides:{badge:{background:"#2e41a9"}}},MuiSnackbar:{styleOverrides:{root:{boxShadow:"none",border:"unset","& > *":{color:"black !important"},"& > .MuiPaper-root":{border:"1px solid black",borderRadius:"12px",boxShadow:"0 0 5px 2px grey"}}}}}}),mantineTheme=createTheme({});function getNextIndex({direction:e,levelIndex:t,rowIndex:n,cellIndex:r,size:o}){switch(e){case"up":return 0===t&&0===n?null:0===n?{levelIndex:t-1,rowIndex:r<=o[t-1][o[t-1].length-1]-1?o[t-1].length-1:o[t-1].length-2,cellIndex:r}:{levelIndex:t,rowIndex:n-1,cellIndex:r};case"down":return n===o[t].length-1||n===o[t].length-2&&r>=o[t][o[t].length-1]?{levelIndex:t+1,rowIndex:0,cellIndex:r}:{levelIndex:t,rowIndex:n+1,cellIndex:r};case"left":return 0===t&&0===n&&0===r?null:0===n&&0===r?{levelIndex:t-1,rowIndex:o[t-1].length-1,cellIndex:o[t-1][o[t-1].length-1]-1}:0===r?{levelIndex:t,rowIndex:n-1,cellIndex:o[t][n-1]-1}:{levelIndex:t,rowIndex:n,cellIndex:r-1};case"right":return n===o[t].length-1&&r===o[t][n]-1?{levelIndex:t+1,rowIndex:0,cellIndex:0}:r===o[t][n]-1?{levelIndex:t,rowIndex:n+1,cellIndex:0}:{levelIndex:t,rowIndex:n,cellIndex:r+1};default:return{levelIndex:t,rowIndex:n,cellIndex:r}}}function focusOnNextFocusableControl({controlsRef:e,direction:t,levelIndex:n,rowIndex:r,cellIndex:o,size:i}){var a,s,l;const c=getNextIndex({direction:t,size:i,rowIndex:r,cellIndex:o,levelIndex:n});if(!c)return;const u=null==(l=null==(s=null==(a=e.current)?void 0:a[c.levelIndex])?void 0:s[c.rowIndex])?void 0:l[c.cellIndex];u&&(u.disabled||u.getAttribute("data-hidden")||u.getAttribute("data-outside")?focusOnNextFocusableControl({controlsRef:e,direction:t,levelIndex:c.levelIndex,cellIndex:c.cellIndex,rowIndex:c.rowIndex,size:i}):u.focus())}function getDirection(e){switch(e){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function getControlsSize(e){var t;return null==(t=e.current)?void 0:t.map(e=>e.map(e=>e.length))}function handleControlKeyDown({controlsRef:e,levelIndex:t,rowIndex:n,cellIndex:r,event:o}){const i=getDirection(o.key);if(i){o.preventDefault();focusOnNextFocusableControl({controlsRef:e,direction:i,levelIndex:t,rowIndex:n,cellIndex:r,size:getControlsSize(e)})}}function assignTime(e,t){if(!e||!t)return t;const n=e.getHours(),r=e.getMinutes(),o=e.getSeconds(),i=e.getMilliseconds(),a=new Date(t);return a.setHours(n),a.setMinutes(r),a.setSeconds(o),a.setMilliseconds(i),a}var timezone={exports:{}};timezone.exports=function(){var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,o){var i,a=function(e,n,r){void 0===r&&(r={});var o=new Date(e);return function(e,n){void 0===n&&(n={});var r=n.timeZoneName||"short",o=e+"|"+r,i=t[o];return i||(i=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:r}),t[o]=i),i}(n,r).formatToParts(o)},s=function(t,n){for(var r=a(t,n),i=[],s=0;s<r.length;s+=1){var l=r[s],c=l.type,u=l.value,d=e[c];d>=0&&(i[d]=parseInt(u,10))}var p=i[3],h=24===p?0:p,f=i[0]+"-"+i[1]+"-"+i[2]+" "+h+":"+i[4]+":"+i[5]+":000",A=+t;return(o.utc(f).valueOf()-(A-=A%1e3))/6e4},l=r.prototype;l.tz=function(e,t){void 0===e&&(e=i);var n,r=this.utcOffset(),a=this.toDate(),s=a.toLocaleString("en-US",{timeZone:e}),l=Math.round((a-new Date(s))/1e3/60),c=15*-Math.round(a.getTimezoneOffset()/15)-l;if(Number(c)){if(n=o(s,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(c,!0),t){var u=n.utcOffset();n=n.add(r-u,"minute")}}else n=this.utcOffset(0,t);return n.$x.$timezone=e,n},l.offsetName=function(e){var t=this.$x.$timezone||o.tz.guess(),n=a(this.valueOf(),t,{timeZoneName:e}).find(function(e){return"timezonename"===e.type.toLowerCase()});return n&&n.value};var c=l.startOf;l.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var n=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return c.call(n,e,t).tz(this.$x.$timezone,!0)},o.tz=function(e,t,n){var r=n&&t,a=n||t||i,l=s(+o(),a);if("string"!=typeof e)return o(e).tz(a);var c=function(e,t,n){var r=e-60*t*1e3,o=s(r,n);if(t===o)return[r,t];var i=s(r-=60*(o-t)*1e3,n);return o===i?[r,o]:[e-60*Math.min(o,i)*1e3,Math.max(o,i)]}(o.utc(e,r).valueOf(),l,a),u=c[0],d=c[1],p=o(u).utcOffset(d);return p.$x.$timezone=a,p},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(e){i=e}}}();var timezoneExports=timezone.exports;const timezonePlugin=getDefaultExportFromCjs$1(timezoneExports);function getTimezoneOffset(e,t){return t?J$2(e).tz(t).utcOffset()+e.getTimezoneOffset():0}J$2.extend(utcPlugin),J$2.extend(timezonePlugin);const updateTimezone=(e,t,n)=>{if(!e)return null;if(!t)return e;let r=getTimezoneOffset(e,t);return"remove"===n&&(r*=-1),J$2(e).add(r,"minutes").toDate()};function shiftTimezone(e,t,n,r){return r||!t?t:Array.isArray(t)?t.map(t=>updateTimezone(t,n,e)):updateTimezone(t,n,e)}const DATES_PROVIDER_DEFAULT_SETTINGS={locale:"en",timezone:null,firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},DatesProviderContext=reactExports.createContext(DATES_PROVIDER_DEFAULT_SETTINGS);function useDatesContext(){const e=reactExports.useContext(DatesProviderContext),t=reactExports.useCallback(t=>t||e.locale,[e.locale]),n=reactExports.useCallback(t=>t||e.timezone||void 0,[e.timezone]),r=reactExports.useCallback(t=>"number"==typeof t?t:e.firstDayOfWeek,[e.firstDayOfWeek]),o=reactExports.useCallback(t=>Array.isArray(t)?t:e.weekendDays,[e.weekendDays]),i=reactExports.useCallback(t=>"string"==typeof t?t:e.labelSeparator,[e.labelSeparator]);return{...e,getLocale:t,getTimezone:n,getFirstDayOfWeek:r,getWeekendDays:o,getLabelSeparator:i}}function formatValue(e,t){if("range"===t&&Array.isArray(e)){const[t,n]=e;return t?n?`${t.toISOString()} – ${n.toISOString()}`:`${t.toISOString()} –`:""}return"multiple"===t&&Array.isArray(e)?e.map(e=>null==e?void 0:e.toISOString()).filter(Boolean).join(", "):!Array.isArray(e)&&e?e.toISOString():""}function HiddenDatesInput({value:e,type:t,name:n,form:r}){return factory$1("input",{type:"hidden",value:formatValue(e,t),name:n,form:r})}HiddenDatesInput.displayName="@mantine/dates/HiddenDatesInput";var classes$7={day:"m_396ce5cb"};const defaultProps$f={},varsResolver$3=createVarsResolver((e,{size:t})=>({day:{"--day-size":getSize(t,"day-size")}})),Day=factory((e,t)=>{const n=useProps("Day",defaultProps$f,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,date:c,disabled:u,__staticSelector:d,weekend:p,outside:h,selected:f,renderDay:A,inRange:m,firstInRange:g,lastInRange:y,hidden:v,static:b,highlightToday:x,...w}=n,C=useStyles$u({name:d||"Day",classes:classes$7,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$3,rootSelector:"day"}),$=useDatesContext();return factory$1(UnstyledButton,{...C("day",{style:v?{display:"none"}:void 0}),component:b?"div":"button",ref:t,disabled:u,"data-today":J$2(c).isSame(shiftTimezone("add",new Date,$.getTimezone()),"day")||void 0,"data-hidden":v||void 0,"data-highlight-today":x||void 0,"data-disabled":u||void 0,"data-weekend":!u&&!h&&p||void 0,"data-outside":!u&&h||void 0,"data-selected":!u&&f||void 0,"data-in-range":m&&!u||void 0,"data-first-in-range":g&&!u||void 0,"data-last-in-range":y&&!u||void 0,"data-static":b||void 0,unstyled:s,...w,children:(null==A?void 0:A(c))||c.getDate()})});function getWeekdayNames({locale:e,format:t="dd",firstDayOfWeek:n=1}){const r=J$2().day(n),o=[];for(let i=0;i<7;i+=1)"string"==typeof t?o.push(J$2(r).add(i,"days").locale(e).format(t)):o.push(t(J$2(r).add(i,"days").toDate()));return o}Day.classes=classes$7,Day.displayName="@mantine/dates/Day";var classes$6={weekday:"m_18a3eca"};const defaultProps$e={},varsResolver$2=createVarsResolver((e,{size:t})=>({weekdaysRow:{"--wr-fz":getFontSize(t),"--wr-spacing":getSpacing(t)}})),WeekdaysRow=factory((e,t)=>{const n=useProps("WeekdaysRow",defaultProps$e,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,locale:c,firstDayOfWeek:u,weekdayFormat:d,cellComponent:p="th",__staticSelector:h,...f}=n,A=useStyles$u({name:h||"WeekdaysRow",classes:classes$6,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$2,rootSelector:"weekdaysRow"}),m=useDatesContext(),g=getWeekdayNames({locale:m.getLocale(c),format:d,firstDayOfWeek:m.getFirstDayOfWeek(u)}).map((e,t)=>factory$1(p,{...A("weekday"),children:e}));return factory$1(Box,{component:"tr",ref:t,...A("weekdaysRow"),...f,children:g})});function getEndOfWeek(e,t=1){const n=new Date(e),r=0===t?6:t-1;for(;n.getDay()!==r;)n.setDate(n.getDate()+1);return n}function getStartOfWeek(e,t=1){const n=new Date(e);for(;n.getDay()!==t;)n.setDate(n.getDate()-1);return n}function getMonthDays({month:e,firstDayOfWeek:t=1,consistentWeeks:n}){const r=e.getMonth(),o=new Date(e.getFullYear(),r,1),i=getEndOfWeek(new Date(e.getFullYear(),e.getMonth()+1,0),t),a=getStartOfWeek(o,t),s=[];for(;a<=i;){const e=[];for(let t=0;t<7;t+=1)e.push(new Date(a)),a.setDate(a.getDate()+1);s.push(e)}if(n&&s.length<6){const e=s[s.length-1],t=e[e.length-1],n=new Date(t);for(n.setDate(n.getDate()+1);s.length<6;){const e=[];for(let t=0;t<7;t+=1)e.push(new Date(n)),n.setDate(n.getDate()+1);s.push(e)}}return s}function isSameMonth(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function isAfterMinDate(e,t){return!(t instanceof Date)||J$2(e).isAfter(J$2(t).subtract(1,"day"),"day")}function isBeforeMaxDate(e,t){return!(t instanceof Date)||J$2(e).isBefore(J$2(t).add(1,"day"),"day")}function getDateInTabOrder(e,t,n,r,o,i,a){const s=e.flat().filter(e=>{var s;return isBeforeMaxDate(e,n)&&isAfterMinDate(e,t)&&!(null==o?void 0:o(e))&&!(null==(s=null==r?void 0:r(e))?void 0:s.disabled)&&(!i||isSameMonth(e,a))}),l=s.find(e=>{var t;return null==(t=null==r?void 0:r(e))?void 0:t.selected});if(l)return l;const c=s.find(e=>J$2().isSame(e,"date"));return c||s[0]}WeekdaysRow.classes=classes$6,WeekdaysRow.displayName="@mantine/dates/WeekdaysRow";var classes$5={month:"m_cc9820d3",monthCell:"m_8f457cd5"};const defaultProps$d={withCellSpacing:!0},Month=factory((e,t)=>{const n=useProps("Month",defaultProps$d,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,__staticSelector:c,locale:u,firstDayOfWeek:d,weekdayFormat:p,month:h,weekendDays:f,getDayProps:A,excludeDate:m,minDate:g,maxDate:y,renderDay:v,hideOutsideDates:b,hideWeekdays:x,getDayAriaLabel:w,static:C,__getDayRef:$,__onDayKeyDown:_,__onDayClick:S,__onDayMouseEnter:E,__preventFocus:k,__stopPropagation:B,withCellSpacing:P,size:T,highlightToday:I,...L}=n,M=useStyles$u({name:c||"Month",classes:classes$5,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,rootSelector:"month"}),D=useDatesContext(),N=getMonthDays({month:h,firstDayOfWeek:D.getFirstDayOfWeek(d),consistentWeeks:D.consistentWeeks}),F=getDateInTabOrder(N,g,y,A,m,b,h),{resolvedClassNames:O,resolvedStyles:R}=useResolvedStylesApi({classNames:r,styles:a,props:n}),U=N.map((e,t)=>{const n=e.map((e,n)=>{const r=!isSameMonth(e,h),o=(null==w?void 0:w(e))||J$2(e).locale(u||D.locale).format("D MMMM YYYY"),i=null==A?void 0:A(e),a=J$2(e).isSame(F,"date");return factory$1("td",{...M("monthCell"),"data-with-spacing":P||void 0,children:factory$1(Day,{__staticSelector:c||"Month",classNames:O,styles:R,unstyled:s,"data-mantine-stop-propagation":B||void 0,highlightToday:I,renderDay:v,date:e,size:T,weekend:D.getWeekendDays(f).includes(e.getDay()),outside:r,hidden:!!b&&r,"aria-label":o,static:C,disabled:(null==m?void 0:m(e))||!isBeforeMaxDate(e,y)||!isAfterMinDate(e,g),ref:e=>null==$?void 0:$(t,n,e),...i,onKeyDown:r=>{var o;null==(o=null==i?void 0:i.onKeyDown)||o.call(i,r),null==_||_(r,{rowIndex:t,cellIndex:n,date:e})},onMouseEnter:t=>{var n;null==(n=null==i?void 0:i.onMouseEnter)||n.call(i,t),null==E||E(t,e)},onClick:t=>{var n;null==(n=null==i?void 0:i.onClick)||n.call(i,t),null==S||S(t,e)},onMouseDown:e=>{var t;null==(t=null==i?void 0:i.onMouseDown)||t.call(i,e),k&&e.preventDefault()},tabIndex:k||!a?-1:0})},e.toString())});return factory$1("tr",{...M("monthRow"),children:n})});return factory$1(Box,{component:"table",...M("month"),size:T,ref:t,...L,children:[!x&&factory$1("thead",{...M("monthThead"),children:factory$1(WeekdaysRow,{__staticSelector:c||"Month",locale:u,firstDayOfWeek:d,weekdayFormat:p,size:T,classNames:O,styles:R,unstyled:s})}),factory$1("tbody",{...M("monthTbody"),children:U})]})});Month.classes=classes$5,Month.displayName="@mantine/dates/Month";var classes$4={pickerControl:"m_dc6a3c71"};const defaultProps$c={},varsResolver$1=createVarsResolver((e,{size:t})=>({pickerControl:{"--dpc-fz":getFontSize(t),"--dpc-size":getSize(t,"dpc-size")}})),PickerControl=factory((e,t)=>{const n=useProps("PickerControl",defaultProps$c,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,firstInRange:c,lastInRange:u,inRange:d,__staticSelector:p,selected:h,disabled:f,...A}=n,m=useStyles$u({name:p||"PickerControl",classes:classes$4,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$1,rootSelector:"pickerControl"});return factory$1(UnstyledButton,{...m("pickerControl"),ref:t,unstyled:s,"data-picker-control":!0,"data-selected":h&&!f||void 0,"data-disabled":f||void 0,"data-in-range":d&&!f&&!h||void 0,"data-first-in-range":c&&!f||void 0,"data-last-in-range":u&&!f||void 0,disabled:f,...A})});function isYearDisabled(e,t,n){return!(!t&&!n)&&(!(!t||!J$2(e).isBefore(t,"year"))||!(!n||!J$2(e).isAfter(n,"year")))}function getYearInTabOrder(e,t,n,r){const o=e.flat().filter(e=>{var o;return!isYearDisabled(e,t,n)&&!(null==(o=null==r?void 0:r(e))?void 0:o.disabled)}),i=o.find(e=>{var t;return null==(t=null==r?void 0:r(e))?void 0:t.selected});if(i)return i;const a=o.find(e=>J$2().isSame(e,"year"));return a||o[0]}function getYearsData(e){const t=e.getFullYear(),n=t-t%10;let r=0;const o=[[],[],[],[]];for(let i=0;i<4;i+=1){const e=3===i?1:3;for(let t=0;t<e;t+=1)o[i].push(new Date(n+r,0)),r+=1}return o}PickerControl.classes=classes$4,PickerControl.displayName="@mantine/dates/PickerControl";var classes$3={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const defaultProps$b={yearsListFormat:"YYYY",withCellSpacing:!0},YearsList=factory((e,t)=>{const n=useProps("YearsList",defaultProps$b,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,decade:c,yearsListFormat:u,locale:d,minDate:p,maxDate:h,getYearControlProps:f,__staticSelector:A,__getControlRef:m,__onControlKeyDown:g,__onControlClick:y,__onControlMouseEnter:v,__preventFocus:b,__stopPropagation:x,withCellSpacing:w,size:C,...$}=n,_=useStyles$u({name:A||"YearsList",classes:classes$3,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,rootSelector:"yearsList"}),S=useDatesContext(),E=getYearsData(c),k=getYearInTabOrder(E,p,h,f),B=E.map((e,t)=>{const n=e.map((e,n)=>{const r=null==f?void 0:f(e),o=J$2(e).isSame(k,"year");return factory$1("td",{..._("yearsListCell"),"data-with-spacing":w||void 0,children:factory$1(PickerControl,{..._("yearsListControl"),size:C,unstyled:s,"data-mantine-stop-propagation":x||void 0,disabled:isYearDisabled(e,p,h),ref:e=>null==m?void 0:m(t,n,e),...r,onKeyDown:o=>{var i;null==(i=null==r?void 0:r.onKeyDown)||i.call(r,o),null==g||g(o,{rowIndex:t,cellIndex:n,date:e})},onClick:t=>{var n;null==(n=null==r?void 0:r.onClick)||n.call(r,t),null==y||y(t,e)},onMouseEnter:t=>{var n;null==(n=null==r?void 0:r.onMouseEnter)||n.call(r,t),null==v||v(t,e)},onMouseDown:e=>{var t;null==(t=null==r?void 0:r.onMouseDown)||t.call(r,e),b&&e.preventDefault()},tabIndex:b||!o?-1:0,children:J$2(e).locale(S.getLocale(d)).format(u)})})});return factory$1("tr",{..._("yearsListRow"),children:n})});return factory$1(Box,{component:"table",ref:t,size:C,..._("yearsList"),...$,children:factory$1("tbody",{children:B})})});function isMonthDisabled(e,t,n){return!(!t&&!n)&&(!(!t||!J$2(e).isBefore(t,"month"))||!(!n||!J$2(e).isAfter(n,"month")))}function getMonthInTabOrder(e,t,n,r){const o=e.flat().filter(e=>{var o;return!isMonthDisabled(e,t,n)&&!(null==(o=null==r?void 0:r(e))?void 0:o.disabled)}),i=o.find(e=>{var t;return null==(t=null==r?void 0:r(e))?void 0:t.selected});if(i)return i;const a=o.find(e=>J$2().isSame(e,"month"));return a||o[0]}function getMonthsData(e){const t=J$2(e).startOf("year").toDate(),n=[[],[],[],[]];let r=0;for(let o=0;o<4;o+=1)for(let e=0;e<3;e+=1)n[o].push(J$2(t).add(r,"months").toDate()),r+=1;return n}YearsList.classes=classes$3,YearsList.displayName="@mantine/dates/YearsList";var classes$2={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const defaultProps$a={monthsListFormat:"MMM",withCellSpacing:!0},MonthsList=factory((e,t)=>{const n=useProps("MonthsList",defaultProps$a,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,__staticSelector:c,year:u,monthsListFormat:d,locale:p,minDate:h,maxDate:f,getMonthControlProps:A,__getControlRef:m,__onControlKeyDown:g,__onControlClick:y,__onControlMouseEnter:v,__preventFocus:b,__stopPropagation:x,withCellSpacing:w,size:C,...$}=n,_=useStyles$u({name:c||"MonthsList",classes:classes$2,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,rootSelector:"monthsList"}),S=useDatesContext(),E=getMonthsData(u),k=getMonthInTabOrder(E,h,f,A),B=E.map((e,t)=>{const n=e.map((e,n)=>{const r=null==A?void 0:A(e),o=J$2(e).isSame(k,"month");return factory$1("td",{..._("monthsListCell"),"data-with-spacing":w||void 0,children:factory$1(PickerControl,{..._("monthsListControl"),size:C,unstyled:s,__staticSelector:c||"MonthsList","data-mantine-stop-propagation":x||void 0,disabled:isMonthDisabled(e,h,f),ref:e=>null==m?void 0:m(t,n,e),...r,onKeyDown:o=>{var i;null==(i=null==r?void 0:r.onKeyDown)||i.call(r,o),null==g||g(o,{rowIndex:t,cellIndex:n,date:e})},onClick:t=>{var n;null==(n=null==r?void 0:r.onClick)||n.call(r,t),null==y||y(t,e)},onMouseEnter:t=>{var n;null==(n=null==r?void 0:r.onMouseEnter)||n.call(r,t),null==v||v(t,e)},onMouseDown:e=>{var t;null==(t=null==r?void 0:r.onMouseDown)||t.call(r,e),b&&e.preventDefault()},tabIndex:b||!o?-1:0,children:J$2(e).locale(S.getLocale(p)).format(d)})})});return factory$1("tr",{..._("monthsListRow"),children:n})});return factory$1(Box,{component:"table",ref:t,size:C,..._("monthsList"),...$,children:factory$1("tbody",{children:B})})});MonthsList.classes=classes$2,MonthsList.displayName="@mantine/dates/MonthsList";var classes$1={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const defaultProps$9={nextDisabled:!1,previousDisabled:!1,hasNextLevel:!0,withNext:!0,withPrevious:!0},varsResolver=createVarsResolver((e,{size:t})=>({calendarHeader:{"--dch-control-size":getSize(t,"dch-control-size"),"--dch-fz":getFontSize(t)}})),CalendarHeader=factory((e,t)=>{const n=useProps("CalendarHeader",defaultProps$9,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,nextIcon:c,previousIcon:u,nextLabel:d,previousLabel:p,onNext:h,onPrevious:f,onLevelClick:A,label:m,nextDisabled:g,previousDisabled:y,hasNextLevel:v,levelControlAriaLabel:b,withNext:x,withPrevious:w,__staticSelector:C,__preventFocus:$,__stopPropagation:_,...S}=n,E=useStyles$u({name:C||"CalendarHeader",classes:classes$1,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver,rootSelector:"calendarHeader"}),k=$?e=>e.preventDefault():void 0;return factory$1(Box,{...E("calendarHeader"),ref:t,...S,children:[w&&factory$1(UnstyledButton,{...E("calendarHeaderControl"),"data-direction":"previous","aria-label":p,onClick:f,unstyled:s,onMouseDown:k,disabled:y,"data-disabled":y||void 0,tabIndex:$||y?-1:0,"data-mantine-stop-propagation":_||void 0,children:u||factory$1(AccordionChevron,{...E("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})}),factory$1(UnstyledButton,{component:v?"button":"div",...E("calendarHeaderLevel"),onClick:v?A:void 0,unstyled:s,onMouseDown:v?k:void 0,disabled:!v,"data-static":!v||void 0,"aria-label":b,tabIndex:$||!v?-1:0,"data-mantine-stop-propagation":_||void 0,children:m}),x&&factory$1(UnstyledButton,{...E("calendarHeaderControl"),"data-direction":"next","aria-label":d,onClick:h,unstyled:s,onMouseDown:k,disabled:g,"data-disabled":g||void 0,tabIndex:$||g?-1:0,"data-mantine-stop-propagation":_||void 0,children:c||factory$1(AccordionChevron,{...E("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})})]})});function getDecadeRange(e){const t=getYearsData(e);return[t[0][0],t[3][0]]}CalendarHeader.classes=classes$1,CalendarHeader.displayName="@mantine/dates/CalendarHeader";const defaultProps$8={decadeLabelFormat:"YYYY"},DecadeLevel=factory((e,t)=>{const n=useProps("DecadeLevel",defaultProps$8,e),{decade:r,locale:o,minDate:i,maxDate:a,yearsListFormat:s,getYearControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:p,withCellSpacing:h,__preventFocus:f,nextIcon:A,previousIcon:m,nextLabel:g,previousLabel:y,onNext:v,onPrevious:b,nextDisabled:x,previousDisabled:w,levelControlAriaLabel:C,withNext:$,withPrevious:_,decadeLabelFormat:S,classNames:E,styles:k,unstyled:B,__staticSelector:P,__stopPropagation:T,size:I,...L}=n,M=useDatesContext(),[D,N]=getDecadeRange(r),F={__staticSelector:P||"DecadeLevel",classNames:E,styles:k,unstyled:B,size:I},O="boolean"==typeof x?x:!!a&&!J$2(N).endOf("year").isBefore(a),R="boolean"==typeof w?w:!!i&&!J$2(D).startOf("year").isAfter(i),U=(e,t)=>J$2(e).locale(o||M.locale).format(t);return factory$1(Box,{"data-decade-level":!0,size:I,ref:t,...L,children:[factory$1(CalendarHeader,{label:"function"==typeof S?S(D,N):`${U(D,S)} – ${U(N,S)}`,__preventFocus:f,__stopPropagation:T,nextIcon:A,previousIcon:m,nextLabel:g,previousLabel:y,onNext:v,onPrevious:b,nextDisabled:O,previousDisabled:R,hasNextLevel:!1,levelControlAriaLabel:C,withNext:$,withPrevious:_,...F}),factory$1(YearsList,{decade:r,locale:o,minDate:i,maxDate:a,yearsListFormat:s,getYearControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:p,__preventFocus:f,__stopPropagation:T,withCellSpacing:h,...F})]})});DecadeLevel.classes={...YearsList.classes,...CalendarHeader.classes},DecadeLevel.displayName="@mantine/dates/DecadeLevel";const defaultProps$7={yearLabelFormat:"YYYY"},YearLevel=factory((e,t)=>{const n=useProps("YearLevel",defaultProps$7,e),{year:r,locale:o,minDate:i,maxDate:a,monthsListFormat:s,getMonthControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:p,withCellSpacing:h,__preventFocus:f,nextIcon:A,previousIcon:m,nextLabel:g,previousLabel:y,onNext:v,onPrevious:b,onLevelClick:x,nextDisabled:w,previousDisabled:C,hasNextLevel:$,levelControlAriaLabel:_,withNext:S,withPrevious:E,yearLabelFormat:k,__staticSelector:B,__stopPropagation:P,size:T,classNames:I,styles:L,unstyled:M,...D}=n,N=useDatesContext(),F={__staticSelector:B||"YearLevel",classNames:I,styles:L,unstyled:M,size:T},O="boolean"==typeof w?w:!!a&&!J$2(r).endOf("year").isBefore(a),R="boolean"==typeof C?C:!!i&&!J$2(r).startOf("year").isAfter(i);return factory$1(Box,{"data-year-level":!0,size:T,ref:t,...D,children:[factory$1(CalendarHeader,{label:"function"==typeof k?k(r):J$2(r).locale(o||N.locale).format(k),__preventFocus:f,__stopPropagation:P,nextIcon:A,previousIcon:m,nextLabel:g,previousLabel:y,onNext:v,onPrevious:b,onLevelClick:x,nextDisabled:O,previousDisabled:R,hasNextLevel:$,levelControlAriaLabel:_,withNext:S,withPrevious:E,...F}),factory$1(MonthsList,{year:r,locale:o,minDate:i,maxDate:a,monthsListFormat:s,getMonthControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:p,__preventFocus:f,__stopPropagation:P,withCellSpacing:h,...F})]})});YearLevel.classes={...CalendarHeader.classes,...MonthsList.classes},YearLevel.displayName="@mantine/dates/YearLevel";const defaultProps$6={monthLabelFormat:"MMMM YYYY"},MonthLevel=factory((e,t)=>{const n=useProps("MonthLevel",defaultProps$6,e),{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:a,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:d,renderDay:p,hideOutsideDates:h,hideWeekdays:f,getDayAriaLabel:A,__getDayRef:m,__onDayKeyDown:g,__onDayClick:y,__onDayMouseEnter:v,withCellSpacing:b,highlightToday:x,__preventFocus:w,__stopPropagation:C,nextIcon:$,previousIcon:_,nextLabel:S,previousLabel:E,onNext:k,onPrevious:B,onLevelClick:P,nextDisabled:T,previousDisabled:I,hasNextLevel:L,levelControlAriaLabel:M,withNext:D,withPrevious:N,monthLabelFormat:F,classNames:O,styles:R,unstyled:U,__staticSelector:j,size:H,static:Q,...z}=n,V=useDatesContext(),W={__staticSelector:j||"MonthLevel",classNames:O,styles:R,unstyled:U,size:H},Y="boolean"==typeof T?T:!!d&&!J$2(r).endOf("month").isBefore(d),G="boolean"==typeof I?I:!!u&&!J$2(r).startOf("month").isAfter(u);return factory$1(Box,{"data-month-level":!0,size:H,ref:t,...z,children:[factory$1(CalendarHeader,{label:"function"==typeof F?F(r):J$2(r).locale(o||V.locale).format(F),__preventFocus:w,__stopPropagation:C,nextIcon:$,previousIcon:_,nextLabel:S,previousLabel:E,onNext:k,onPrevious:B,onLevelClick:P,nextDisabled:Y,previousDisabled:G,hasNextLevel:L,levelControlAriaLabel:M,withNext:D,withPrevious:N,...W}),factory$1(Month,{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:a,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:d,renderDay:p,hideOutsideDates:h,hideWeekdays:f,getDayAriaLabel:A,__getDayRef:m,__onDayKeyDown:g,__onDayClick:y,__onDayMouseEnter:v,__preventFocus:w,__stopPropagation:C,static:Q,withCellSpacing:b,highlightToday:x,...W})]})});MonthLevel.classes={...Month.classes,...CalendarHeader.classes},MonthLevel.displayName="@mantine/dates/MonthLevel";var classes={levelsGroup:"m_30b26e33"};const defaultProps$5={},LevelsGroup=factory((e,t)=>{const n=useProps("LevelsGroup",defaultProps$5,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,__staticSelector:c,...u}=n,d=useStyles$u({name:c||"LevelsGroup",classes:classes,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,rootSelector:"levelsGroup"});return factory$1(Box,{ref:t,...d("levelsGroup"),...u})});LevelsGroup.classes=classes,LevelsGroup.displayName="@mantine/dates/LevelsGroup";const defaultProps$4={numberOfColumns:1},DecadeLevelGroup=factory((e,t)=>{const n=useProps("DecadeLevelGroup",defaultProps$4,e),{decade:r,locale:o,minDate:i,maxDate:a,yearsListFormat:s,getYearControlProps:l,__onControlClick:c,__onControlMouseEnter:u,withCellSpacing:d,__preventFocus:p,nextIcon:h,previousIcon:f,nextLabel:A,previousLabel:m,onNext:g,onPrevious:y,nextDisabled:v,previousDisabled:b,classNames:x,styles:w,unstyled:C,__staticSelector:$,__stopPropagation:_,numberOfColumns:S,levelControlAriaLabel:E,decadeLabelFormat:k,size:B,vars:P,...T}=n,I=reactExports.useRef([]),L=Array(S).fill(0).map((e,t)=>{const n=J$2(r).add(10*t,"years").toDate();return factory$1(DecadeLevel,{size:B,yearsListFormat:s,decade:n,withNext:t===S-1,withPrevious:0===t,decadeLabelFormat:k,__onControlClick:c,__onControlMouseEnter:u,__onControlKeyDown:(e,n)=>handleControlKeyDown({levelIndex:t,rowIndex:n.rowIndex,cellIndex:n.cellIndex,event:e,controlsRef:I}),__getControlRef:(e,n,r)=>{Array.isArray(I.current[t])||(I.current[t]=[]),Array.isArray(I.current[t][e])||(I.current[t][e]=[]),I.current[t][e][n]=r},levelControlAriaLabel:"function"==typeof E?E(n):E,locale:o,minDate:i,maxDate:a,__preventFocus:p,__stopPropagation:_,nextIcon:h,previousIcon:f,nextLabel:A,previousLabel:m,onNext:g,onPrevious:y,nextDisabled:v,previousDisabled:b,getYearControlProps:l,__staticSelector:$||"DecadeLevelGroup",classNames:x,styles:w,unstyled:C,withCellSpacing:d})});return factory$1(LevelsGroup,{classNames:x,styles:w,__staticSelector:$||"DecadeLevelGroup",ref:t,size:B,unstyled:C,...T,children:L})});DecadeLevelGroup.classes={...LevelsGroup.classes,...DecadeLevel.classes},DecadeLevelGroup.displayName="@mantine/dates/DecadeLevelGroup";const defaultProps$3={numberOfColumns:1},YearLevelGroup=factory((e,t)=>{const n=useProps("YearLevelGroup",defaultProps$3,e),{year:r,locale:o,minDate:i,maxDate:a,monthsListFormat:s,getMonthControlProps:l,__onControlClick:c,__onControlMouseEnter:u,withCellSpacing:d,__preventFocus:p,nextIcon:h,previousIcon:f,nextLabel:A,previousLabel:m,onNext:g,onPrevious:y,onLevelClick:v,nextDisabled:b,previousDisabled:x,hasNextLevel:w,classNames:C,styles:$,unstyled:_,__staticSelector:S,__stopPropagation:E,numberOfColumns:k,levelControlAriaLabel:B,yearLabelFormat:P,size:T,vars:I,...L}=n,M=reactExports.useRef([]),D=Array(k).fill(0).map((e,t)=>{const n=J$2(r).add(t,"years").toDate();return factory$1(YearLevel,{size:T,monthsListFormat:s,year:n,withNext:t===k-1,withPrevious:0===t,yearLabelFormat:P,__stopPropagation:E,__onControlClick:c,__onControlMouseEnter:u,__onControlKeyDown:(e,n)=>handleControlKeyDown({levelIndex:t,rowIndex:n.rowIndex,cellIndex:n.cellIndex,event:e,controlsRef:M}),__getControlRef:(e,n,r)=>{Array.isArray(M.current[t])||(M.current[t]=[]),Array.isArray(M.current[t][e])||(M.current[t][e]=[]),M.current[t][e][n]=r},levelControlAriaLabel:"function"==typeof B?B(n):B,locale:o,minDate:i,maxDate:a,__preventFocus:p,nextIcon:h,previousIcon:f,nextLabel:A,previousLabel:m,onNext:g,onPrevious:y,onLevelClick:v,nextDisabled:b,previousDisabled:x,hasNextLevel:w,getMonthControlProps:l,classNames:C,styles:$,unstyled:_,__staticSelector:S||"YearLevelGroup",withCellSpacing:d})});return factory$1(LevelsGroup,{classNames:C,styles:$,__staticSelector:S||"YearLevelGroup",ref:t,size:T,unstyled:_,...L,children:D})});YearLevelGroup.classes={...YearLevel.classes,...LevelsGroup.classes},YearLevelGroup.displayName="@mantine/dates/YearLevelGroup";const defaultProps$2={numberOfColumns:1},MonthLevelGroup=factory((e,t)=>{const n=useProps("MonthLevelGroup",defaultProps$2,e),{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:a,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:d,renderDay:p,hideOutsideDates:h,hideWeekdays:f,getDayAriaLabel:A,__onDayClick:m,__onDayMouseEnter:g,withCellSpacing:y,highlightToday:v,__preventFocus:b,nextIcon:x,previousIcon:w,nextLabel:C,previousLabel:$,onNext:_,onPrevious:S,onLevelClick:E,nextDisabled:k,previousDisabled:B,hasNextLevel:P,classNames:T,styles:I,unstyled:L,numberOfColumns:M,levelControlAriaLabel:D,monthLabelFormat:N,__staticSelector:F,__stopPropagation:O,size:R,static:U,vars:j,...H}=n,Q=reactExports.useRef([]),z=Array(M).fill(0).map((e,t)=>{const n=J$2(r).add(t,"months").toDate();return factory$1(MonthLevel,{month:n,withNext:t===M-1,withPrevious:0===t,monthLabelFormat:N,__stopPropagation:O,__onDayClick:m,__onDayMouseEnter:g,__onDayKeyDown:(e,n)=>handleControlKeyDown({levelIndex:t,rowIndex:n.rowIndex,cellIndex:n.cellIndex,event:e,controlsRef:Q}),__getDayRef:(e,n,r)=>{Array.isArray(Q.current[t])||(Q.current[t]=[]),Array.isArray(Q.current[t][e])||(Q.current[t][e]=[]),Q.current[t][e][n]=r},levelControlAriaLabel:"function"==typeof D?D(n):D,locale:o,firstDayOfWeek:i,weekdayFormat:a,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:d,renderDay:p,hideOutsideDates:h,hideWeekdays:f,getDayAriaLabel:A,__preventFocus:b,nextIcon:x,previousIcon:w,nextLabel:C,previousLabel:$,onNext:_,onPrevious:S,onLevelClick:E,nextDisabled:k,previousDisabled:B,hasNextLevel:P,classNames:T,styles:I,unstyled:L,__staticSelector:F||"MonthLevelGroup",size:R,static:U,withCellSpacing:y,highlightToday:v})});return factory$1(LevelsGroup,{classNames:T,styles:I,__staticSelector:F||"MonthLevelGroup",ref:t,size:R,...H,children:z})});MonthLevelGroup.classes={...LevelsGroup.classes,...MonthLevel.classes},MonthLevelGroup.displayName="@mantine/dates/MonthLevelGroup";const getEmptyValue=e=>"range"===e?[null,null]:"multiple"===e?[]:null;function useUncontrolledDates({type:e,value:t,defaultValue:n,onChange:r,applyTimezone:o=!0}){const i=reactExports.useRef(e),a=useDatesContext(),[s,l,c]=useUncontrolled({value:shiftTimezone("add",t,a.getTimezone(),!o),defaultValue:shiftTimezone("add",n,a.getTimezone(),!o),finalValue:getEmptyValue(e),onChange:e=>{null==r||r(shiftTimezone("remove",e,a.getTimezone(),!o))}});let u=s;return i.current!==e&&(i.current=e,void 0===t&&(u=void 0!==n?n:getEmptyValue(e),l(u))),[u,l,c]}function levelToNumber(e,t){return e?"month"===e?0:"year"===e?1:2:t||0}function levelNumberToLevel(e){return 0===e?"month":1===e?"year":"decade"}function clampLevel(e,t,n){return levelNumberToLevel(clamp$2(levelToNumber(e,0),levelToNumber(t,0),levelToNumber(n,2)))}const defaultProps$1={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0},Calendar=factory((e,t)=>{const n=useProps("Calendar",defaultProps$1,e),{vars:r,maxLevel:o,minLevel:i,defaultLevel:a,level:s,onLevelChange:l,date:c,defaultDate:u,onDateChange:d,numberOfColumns:p,columnsToScroll:h,ariaLabels:f,onYearSelect:A,onMonthSelect:m,onYearMouseEnter:g,onMonthMouseEnter:y,__updateDateOnYearSelect:v,__updateDateOnMonthSelect:b,firstDayOfWeek:x,weekdayFormat:w,weekendDays:C,getDayProps:$,excludeDate:_,renderDay:S,hideOutsideDates:E,hideWeekdays:k,getDayAriaLabel:B,monthLabelFormat:P,nextIcon:T,previousIcon:I,__onDayClick:L,__onDayMouseEnter:M,withCellSpacing:D,highlightToday:N,monthsListFormat:F,getMonthControlProps:O,yearLabelFormat:R,yearsListFormat:U,getYearControlProps:j,decadeLabelFormat:H,classNames:Q,styles:z,unstyled:V,minDate:W,maxDate:Y,locale:G,__staticSelector:K,size:q,__preventFocus:J,__stopPropagation:Z,onNextDecade:X,onPreviousDecade:ee,onNextYear:te,onPreviousYear:ne,onNextMonth:re,onPreviousMonth:oe,static:ie,__timezoneApplied:ae,...se}=n,{resolvedClassNames:le,resolvedStyles:ce}=useResolvedStylesApi({classNames:Q,styles:z,props:n}),[ue,de]=useUncontrolled({value:s?clampLevel(s,i,o):void 0,defaultValue:a?clampLevel(a,i,o):void 0,finalValue:clampLevel(void 0,i,o),onChange:l}),[pe,he]=useUncontrolledDates({type:"default",value:c,defaultValue:u,onChange:d,applyTimezone:!ae}),fe={__staticSelector:K||"Calendar",styles:ce,classNames:le,unstyled:V,size:q},Ae=useDatesContext(),me=h||p||1,ge=new Date,ye=pe||shiftTimezone("add",W&&W>ge?W:ge,Ae.getTimezone());return factory$1(Box,{ref:t,size:q,"data-calendar":!0,...se,children:["month"===ue&&factory$1(MonthLevelGroup,{month:ye,minDate:W,maxDate:Y,firstDayOfWeek:x,weekdayFormat:w,weekendDays:C,getDayProps:$,excludeDate:_,renderDay:S,hideOutsideDates:E,hideWeekdays:k,getDayAriaLabel:B,onNext:()=>{const e=J$2(ye).add(me,"month").toDate();null==re||re(e),he(e)},onPrevious:()=>{const e=J$2(ye).subtract(me,"month").toDate();null==oe||oe(e),he(e)},hasNextLevel:"month"!==o,onLevelClick:()=>de("year"),numberOfColumns:p,locale:G,levelControlAriaLabel:null==f?void 0:f.monthLevelControl,nextLabel:null==f?void 0:f.nextMonth,nextIcon:T,previousLabel:null==f?void 0:f.previousMonth,previousIcon:I,monthLabelFormat:P,__onDayClick:L,__onDayMouseEnter:M,__preventFocus:J,__stopPropagation:Z,static:ie,withCellSpacing:D,highlightToday:N,...fe}),"year"===ue&&factory$1(YearLevelGroup,{year:ye,numberOfColumns:p,minDate:W,maxDate:Y,monthsListFormat:F,getMonthControlProps:O,locale:G,onNext:()=>{const e=J$2(ye).add(me,"year").toDate();null==te||te(e),he(e)},onPrevious:()=>{const e=J$2(ye).subtract(me,"year").toDate();null==ne||ne(e),he(e)},hasNextLevel:"month"!==o&&"year"!==o,onLevelClick:()=>de("decade"),levelControlAriaLabel:null==f?void 0:f.yearLevelControl,nextLabel:null==f?void 0:f.nextYear,nextIcon:T,previousLabel:null==f?void 0:f.previousYear,previousIcon:I,yearLabelFormat:R,__onControlMouseEnter:y,__onControlClick:(e,t)=>{b&&he(t),de(clampLevel("month",i,o)),null==m||m(t)},__preventFocus:J,__stopPropagation:Z,withCellSpacing:D,...fe}),"decade"===ue&&factory$1(DecadeLevelGroup,{decade:ye,minDate:W,maxDate:Y,yearsListFormat:U,getYearControlProps:j,locale:G,onNext:()=>{const e=J$2(ye).add(10*me,"year").toDate();null==X||X(e),he(e)},onPrevious:()=>{const e=J$2(ye).subtract(10*me,"year").toDate();null==ee||ee(e),he(e)},numberOfColumns:p,nextLabel:null==f?void 0:f.nextDecade,nextIcon:T,previousLabel:null==f?void 0:f.previousDecade,previousIcon:I,decadeLabelFormat:H,__onControlMouseEnter:g,__onControlClick:(e,t)=>{v&&he(t),de(clampLevel("year",i,o)),null==A||A(t)},__preventFocus:J,__stopPropagation:Z,withCellSpacing:D,...fe})]})});function pickCalendarProps(e){const{maxLevel:t,minLevel:n,defaultLevel:r,level:o,onLevelChange:i,nextIcon:a,previousIcon:s,date:l,defaultDate:c,onDateChange:u,numberOfColumns:d,columnsToScroll:p,ariaLabels:h,onYearSelect:f,onMonthSelect:A,onYearMouseEnter:m,onMonthMouseEnter:g,onNextMonth:y,onPreviousMonth:v,onNextYear:b,onPreviousYear:x,onNextDecade:w,onPreviousDecade:C,withCellSpacing:$,highlightToday:_,__updateDateOnYearSelect:S,__updateDateOnMonthSelect:E,firstDayOfWeek:k,weekdayFormat:B,weekendDays:P,getDayProps:T,excludeDate:I,renderDay:L,hideOutsideDates:M,hideWeekdays:D,getDayAriaLabel:N,monthLabelFormat:F,monthsListFormat:O,getMonthControlProps:R,yearLabelFormat:U,yearsListFormat:j,getYearControlProps:H,decadeLabelFormat:Q,allowSingleDateInRange:z,allowDeselect:V,minDate:W,maxDate:Y,locale:G,...K}=e;return{calendarProps:{maxLevel:t,minLevel:n,defaultLevel:r,level:o,onLevelChange:i,nextIcon:a,previousIcon:s,date:l,defaultDate:c,onDateChange:u,numberOfColumns:d,columnsToScroll:p,ariaLabels:h,onYearSelect:f,onMonthSelect:A,onYearMouseEnter:m,onMonthMouseEnter:g,onNextMonth:y,onPreviousMonth:v,onNextYear:b,onPreviousYear:x,onNextDecade:w,onPreviousDecade:C,withCellSpacing:$,highlightToday:_,__updateDateOnYearSelect:S,__updateDateOnMonthSelect:E,firstDayOfWeek:k,weekdayFormat:B,weekendDays:P,getDayProps:T,excludeDate:I,renderDay:L,hideOutsideDates:M,hideWeekdays:D,getDayAriaLabel:N,monthLabelFormat:F,monthsListFormat:O,getMonthControlProps:R,yearLabelFormat:U,yearsListFormat:j,getYearControlProps:H,decadeLabelFormat:Q,allowSingleDateInRange:z,allowDeselect:V,minDate:W,maxDate:Y,locale:G},others:K}}function dateStringParser(e,t){if(null===e)return null;const n=shiftTimezone("add",new Date(e),t);return Number.isNaN(n.getTime())||!e?null:n}function isDateValid({date:e,maxDate:t,minDate:n}){return null!=e&&(!Number.isNaN(e.getTime())&&((!t||!J$2(e).isAfter(t,"date"))&&(!n||!J$2(e).isBefore(n,"date"))))}Calendar.classes={...DecadeLevelGroup.classes,...YearLevelGroup.classes,...MonthLevelGroup.classes},Calendar.displayName="@mantine/dates/Calendar";const defaultProps={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,preserveTime:!0},DateInput=factory((e,t)=>{const n=useInputProps("DateInput",defaultProps,e),{inputProps:r,wrapperProps:o,value:i,defaultValue:a,onChange:s,clearable:l,clearButtonProps:c,popoverProps:u,getDayProps:d,locale:p,valueFormat:h,dateParser:f,minDate:A,maxDate:m,fixOnBlur:g,onFocus:y,onBlur:v,onClick:b,readOnly:x,name:w,form:C,rightSection:$,unstyled:_,classNames:S,styles:E,allowDeselect:k,preserveTime:B,date:P,defaultDate:T,onDateChange:I,...L}=n,[M,D]=reactExports.useState(!1),{calendarProps:N,others:F}=pickCalendarProps(L),O=useDatesContext(),R=f||(e=>{const t=J$2(e,h,O.getLocale(p)).toDate();return Number.isNaN(t.getTime())?dateStringParser(e,O.getTimezone()):t}),U=void 0!==k?k:l,j=e=>e?J$2(e).locale(O.getLocale(p)).format(h):"",[H,Q,z]=useUncontrolledDates({type:"default",value:i,defaultValue:a,onChange:s}),[V,W]=useUncontrolledDates({type:"default",value:P,defaultValue:a||T,onChange:I});reactExports.useEffect(()=>{z&&W(i)},[z,i]);const[Y,G]=reactExports.useState(j(H));reactExports.useEffect(()=>{G(j(H))},[O.getLocale(p)]);const K=$||(l&&H&&!x?factory$1(CloseButton,{variant:"transparent",onMouseDown:e=>e.preventDefault(),tabIndex:-1,onClick:()=>{Q(null),!z&&G(""),D(!1)},unstyled:_,size:r.size||"sm",...c}):null);return useDidUpdate(()=>{void 0!==H&&!M&&G(j(H))},[H]),factory$1(Fragment,{children:[factory$1(Input$5.Wrapper,{...o,__staticSelector:"DateInput",children:factory$1(Popover,{opened:M,trapFocus:!1,position:"bottom-start",disabled:x,withRoles:!1,unstyled:_,...u,children:[factory$1(Popover.Target,{children:factory$1(Input$5,{"data-dates-input":!0,"data-read-only":x||void 0,autoComplete:"off",ref:t,value:Y,onChange:e=>{const t=e.currentTarget.value;if(G(t),D(!0),""===t.trim()&&l)Q(null);else{const e=R(t);isDateValid({date:e,minDate:A,maxDate:m})&&(Q(e),W(e))}},onBlur:e=>{null==v||v(e),D(!1),g&&G(j(H))},onFocus:e=>{null==y||y(e),D(!0)},onClick:e=>{null==b||b(e),D(!0)},readOnly:x,rightSection:K,...r,...F,__staticSelector:"DateInput"})}),factory$1(Popover.Dropdown,{onMouseDown:e=>e.preventDefault(),"data-dates-dropdown":!0,children:factory$1(Calendar,{__staticSelector:"DateInput",__timezoneApplied:!0,...N,classNames:S,styles:E,unstyled:_,__preventFocus:!0,minDate:A,maxDate:m,locale:p,getDayProps:e=>({...null==d?void 0:d(e),selected:J$2(H).isSame(e,"day"),onClick:()=>{const t=B?assignTime(H,e):e,n=l&&U&&J$2(H).isSame(e,"day")?null:t;Q(n),!z&&G(j(n)),D(!1)}}),size:r.size,date:V,onDateChange:W})})]})}),factory$1(HiddenDatesInput,{name:w,form:C,value:H,type:"default"})]})});DateInput.classes={...Input$5.classes,...Calendar.classes},DateInput.displayName="@mantine/dates/DateInput";
|
|
1539
|
+
"./src/plugin/hyperlinks.js");var t=function e(t,n){var r=new e.Worker(n);return t?r.from(t).save():r};t.Worker=e.default,i.default=t}(),i=i.default}()},html2pdf$1.exports=factory2(require$$0$2,requireHtml2canvas());var html2pdfExports=html2pdf$1.exports;const html2pdf=getDefaultExportFromCjs$1(html2pdfExports),getError=()=>new Error("Node APIs are not available in browser context."),throwForSync=()=>{throw getError()},fs={access:(e,t)=>t(getError()),accessSync:throwForSync,readFile:(e,t,n)=>n(getError()),readFileSync:throwForSync},os={};var helpers$2={},shared={},hasRequiredShared,micromarkHelpers,hasRequiredMicromarkHelpers,hasRequiredHelpers;function requireShared(){return hasRequiredShared||(hasRequiredShared=1,shared.flatTokensSymbol=Symbol("flat-tokens"),shared.htmlFlowSymbol=Symbol("html-flow"),shared.newLineRe=/\r\n?|\n/g,shared.nextLinesRe=/[\r\n][\s\S]*$/),shared}function requireMicromarkHelpers(){if(hasRequiredMicromarkHelpers)return micromarkHelpers;hasRequiredMicromarkHelpers=1;const{flatTokensSymbol:e,htmlFlowSymbol:t}=requireShared();function n(e){return Boolean(e[t])}function r(e,t,n){const r=[],o=[{array:e,index:0}];for(;o.length>0;){const e=o[o.length-1],{array:i,index:a}=e;if(a<i.length){const a=i[e.index++];t(a)&&r.push(a);const{children:s}=a;if(s.length>0){const e=n?n(a):s;o.push({array:e,index:0})}}else o.pop()}return r}function o(t,o,i){const a=e=>o.includes(e.type)&&(i||!n(e)),s=t[e];return s?s.filter(a):r(t,a)}function i(e,t){let n=Array.isArray(e)?e:[e];for(const r of t){const e=e=>Array.isArray(r)?r.includes(e.type):r===e.type;n=n.flatMap(t=>t.children.filter(e))}return n}const a=/^#tab\//;return micromarkHelpers={addRangeToSet:function(e,t,n){for(let r=t;r<=n;r++)e.add(r)},filterByPredicate:r,filterByTypes:o,getBlockQuotePrefixText:function(e,t,n=1){return o(e,["blockQuotePrefix","linePrefix"]).filter(e=>e.startLine===t).map(e=>e.text).join("").trimEnd().concat("\n").repeat(n)},getDescendantsByType:i,getHeadingLevel:function(e){let t=1;const n=e.children.find(e=>["atxHeadingSequence","setextHeadingLine"].includes(e.type)),{text:r}=n;return"#"===r[0]?t=Math.min(r.length,6):"-"===r[0]&&(t=2),t},getHeadingStyle:function(e){return"setextHeading"===e.type?"setext":1===e.children.filter(e=>"atxHeadingSequence"===e.type).length?"atx":"atx_closed"},getHeadingText:function(e){return i(e,[["atxHeadingText","setextHeadingText"]]).flatMap(e=>e.children.filter(e=>"htmlText"!==e.type)).map(e=>e.text).join("").replace(/[\r\n]+/g," ")||""},getHtmlTagInfo:function(e){const t=/^<([^!>][^/\s>]*)/;if("htmlText"===e.type){const n=t.exec(e.text);if(n){const e=n[1],t=e.startsWith("/");return{close:t,name:t?e.slice(1):e}}}return null},getParentOfType:function(e,t){let n=e;for(;(n=n.parent)&&!t.includes(n.type););return n},inHtmlFlow:n,isDocfxTab:function(e){if("atxHeading"===(null==e?void 0:e.type)){const t=i(e,["atxHeadingText"]);if(1===t.length&&1===t[0].children.length&&"link"===t[0].children[0].type){const e=o(t[0].children[0].children,["resourceDestinationString"]);return 1===e.length&&a.test(e[0].text)}}return!1},isHtmlFlowComment:function(e){const{text:t,type:n}=e;if("htmlFlow"===n&&t.startsWith("\x3c!--")&&t.endsWith("--\x3e")){const e=t.slice(4,-3);return!e.startsWith(">")&&!e.startsWith("->")&&!e.endsWith("-")}return!1},nonContentTokens:new Set(["blockQuoteMarker","blockQuotePrefix","blockQuotePrefixWhitespace","lineEnding","lineEndingBlank","linePrefix","listItemIndent","undefinedReference","undefinedReferenceCollapsed","undefinedReferenceFull","undefinedReferenceShortcut"])},micromarkHelpers}function requireHelpers(){if(hasRequiredHelpers)return helpers$2;hasRequiredHelpers=1;const e=requireMicromarkHelpers(),{newLineRe:t,nextLinesRe:n}=requireShared();helpers$2.newLineRe=t,helpers$2.nextLinesRe=n,helpers$2.frontMatterRe=/((^---[^\S\r\n\u2028\u2029]*$[\s\S]+?^---\s*)|(^\+\+\+[^\S\r\n\u2028\u2029]*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{[^\S\r\n\u2028\u2029]*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m;helpers$2.inlineCommentStartRe=/(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi,helpers$2.endOfLineHtmlEntityRe=/&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/,helpers$2.endOfLineGemojiCodeRe=/:(?:[abmovx]|[-+]1|100|1234|(?:1st|2nd|3rd)_place_medal|8ball|clock\d{1,4}|e-mail|non-potable_water|o2|t-rex|u5272|u5408|u55b6|u6307|u6708|u6709|u6e80|u7121|u7533|u7981|u7a7a|[a-z]{2,15}2?|[a-z]{1,14}(?:_[a-z\d]{1,16})+):$/;const r=".,;:!?。,;:!?";function o(e){return!!e&&Object.getPrototypeOf(e)===URL.prototype}helpers$2.allPunctuation=r,helpers$2.allPunctuationNoQuestion=r.replace(/[??]/gu,""),helpers$2.isNumber=function(e){return"number"==typeof e},helpers$2.isString=function(e){return"string"==typeof e},helpers$2.isEmptyString=function(e){return 0===e.length},helpers$2.isObject=function(e){return!!e&&"object"==typeof e&&!Array.isArray(e)},helpers$2.isUrl=o,helpers$2.cloneIfArray=function(e){return Array.isArray(e)?[...e]:e},helpers$2.cloneIfUrl=function(e){return o(e)?new URL(e):e},helpers$2.getHtmlAttributeRe=function(e){return new RegExp(`\\s${e}\\s*=\\s*['"]?([^'"\\s>]*)`,"iu")},helpers$2.isBlankLine=function(e){const t="--\x3e";return!e||!e.trim()||!(e=>{for(;;){const n=e.indexOf("\x3c!--"),r=e.indexOf(t);if(-1!==r&&(-1===n||r<n))e=e.slice(r+3);else if(-1!==n&&-1!==r)e=e.slice(0,n)+e.slice(r+3);else{if(-1===n||-1!==r)return e;e=e.slice(0,n)}}})(e).replace(/>/g,"").trim()};const i="\x3c!--",a=/^ *\|/,s=/[^\r\n]/g,l=/[^ \r\n]/g,c=/ +[\r\n]/g,u=e=>e.replace(s,".");function d(e,t,n){return e.length<=30||(e=t&&n?e.slice(0,15)+"..."+e.slice(-15):n?"..."+e.slice(-30):e.slice(0,30)+"..."),e}function p(e,t,n,r,o,i){e({lineNumber:t,detail:n,context:r,range:o,fixInfo:i})}helpers$2.clearHtmlCommentText=function(e){let t=0;for(;-1!==(t=e.indexOf(i,t));){const n=e.indexOf("--\x3e",t+2);if(-1===n)break;if(n>t+4){const r=e.slice(t+4,n),o=e.lastIndexOf("\n",t)+1,i=e.slice(o,t),s=0===i.trim().length,d=a.test(i)&&r.includes("\n");if(s||!(d||r.startsWith(">")||r.startsWith("->")||r.endsWith("-")||r.includes("--"))){const o=r.replace(l,".").replace(c,u);e=e.slice(0,t+4)+o+e.slice(n)}}t=n+3}return e},helpers$2.escapeForRegExp=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},helpers$2.ellipsify=d,helpers$2.addError=p,helpers$2.addErrorDetailIf=function(e,t,n,r,o,i,a,s){n!==r&&p(e,t,"Expected: "+n+"; Actual: "+r+(o?"; "+o:""),i,a,s)},helpers$2.addErrorContext=function(e,n,r,o,i,a,s){p(e,n,void 0,r=d(r.replace(t,"\n"),o,i),a,s)};const h=(e,t,n,r)=>e<n||e===n&&t<=r;return helpers$2.hasOverlap=function(e,t){const n=h(e.startLine,e.startColumn,t.startLine,t.startColumn),r=n?e:t,o=n?t:e;return h(o.startLine,o.startColumn,r.endLine,r.endColumn)},helpers$2.frontMatterHasTitle=function(e,t){const n=void 0!==t&&!t,r=new RegExp(String(t||'^\\s*"?title"?\\s*[:=]'),"i");return!n&&e.some(e=>r.test(e))},helpers$2.getReferenceLinkImageData=function(t){var n;const r=e=>e.toLowerCase().trim().replace(/\s+/g," "),o=e=>null==e?void 0:e.children.filter(e=>"blockQuotePrefix"!==e.type).map(e=>e.text).join(""),i=new Map,a=new Map,s=(e,t,n)=>{const o=[e.startLine-1,e.startColumn-1,e.text.length],s=r(t),l=n?a:i,c=l.get(s)||[];c.push(o),l.set(s,c)},l=new Map,c=[],u=[],d=e.filterByTypes(t,["definition","gfmFootnoteDefinition","definitionLabelString","gfmFootnoteDefinitionLabelString","gfmFootnoteCall","image","link","undefinedReferenceCollapsed","undefinedReferenceFull","undefinedReferenceShortcut"]);for(const p of d){let t="";switch(p.type){case"definition":case"gfmFootnoteDefinition":for(let e=p.startLine;e<=p.endLine;e++)c.push(e-1);break;case"gfmFootnoteDefinitionLabelString":t="^";case"definitionLabelString":{const o=r(`${t}${p.text}`);if(l.has(o))u.push([o,p.startLine-1]);else{const t=e.getParentOfType(p,["definition"]),r=t&&(null==(n=e.getDescendantsByType(t,["definitionDestination","definitionDestinationRaw","definitionDestinationString"])[0])?void 0:n.text);l.set(o,[p.startLine-1,r])}}break;case"gfmFootnoteCall":case"image":case"link":{let t=1===p.children.length;const n=2===p.children.length&&!p.children.some(e=>"resource"===e.type),[r]=e.getDescendantsByType(p,["label","labelText"]),[i]=e.getDescendantsByType(p,["reference","referenceString"]);let a=o(r);if(!t&&!n){const[e,n]=p.children.filter(e=>["gfmFootnoteCallMarker","gfmFootnoteCallString"].includes(e.type));e&&n&&(a=`${e.text}${n.text}`,t=!0)}(t||n)&&s(p,o(i)||a,t)}break;case"undefinedReferenceCollapsed":case"undefinedReferenceFull":case"undefinedReferenceShortcut":{const t=e.getDescendantsByType(p,["undefinedReference"])[0].children.map(e=>e.text).join("");s(p,t,"undefinedReferenceShortcut"===p.type)}}}return{references:i,shortcuts:a,definitions:l,duplicateDefinitions:u,definitionLineIndices:c}},helpers$2.getPreferredLineEnding=function(e,n){let r=0,o=0,i=0;const a=e.match(t)||[];for(const t of a)switch(t){case"\r":r++;break;case"\n":o++;break;case"\r\n":i++}let s=null;return s=r||o||i?o>=i&&o>=r?"\n":i>=r?"\r\n":"\r":n&&n.EOL||"\n",s},helpers$2.expandTildePath=function(e,t){const n=t&&t.homedir&&t.homedir();return n?e.replace(/^~($|\/|\\)/,`${n}$1`):e},helpers$2}var helpersExports=requireHelpers(),micromarkHelpersExports=requireMicromarkHelpers();const map$1=new Map;let params;function initialize(e){map$1.clear(),params=e}function micromarkTokens(){return(null==params?void 0:params.parsers.micromark.tokens)||[]}function getCached(e,t){if(map$1.has(e))return map$1.get(e);const n=t();return map$1.set(e,n),n}function filterByTypesCached(e,t){return getCached(JSON.stringify(arguments),()=>micromarkHelpersExports.filterByTypes(micromarkTokens(),e,t))}function getReferenceLinkImageData(){return getCached(getReferenceLinkImageData.name,()=>helpersExports.getReferenceLinkImageData(micromarkTokens()))}const homepage="https://github.com/DavidAnson/markdownlint",version="0.38.0";var markdownit,hasRequiredMarkdownit;function requireMarkdownit(){if(hasRequiredMarkdownit)return markdownit;hasRequiredMarkdownit=1;const{newLineRe:e}=requireHelpers();function t(t,n){const r=/`+/g;let o=null;const i=[];for(;null!==(o=r.exec(t));)i.push([o[0].length,o.index]);const a=[];for(;null!==(o=e.exec(t));)a.push(o.index);let s=0,l=0,c=0;for(let e=0;e<i.length-1;e++){const[r,o]=i[e];if(0===o||"\\"!==t[o-1])for(let u=e+1;u<i.length;u++){const[d,p]=i[u];if(r===d){for(;c<a.length;c++){const e=a[c];if(o<e)break;s++,l=e+1}const i=o-l+r;n(t.slice(o+r,p),s,i,r),e=u;break}}}}function n(e){if(e.attrs){for(const t of e.attrs)Object.freeze(t);Object.freeze(e.attrs)}if(e.children){for(const t of e.children)n(t);Object.freeze(e.children)}e.map&&Object.freeze(e.map),Object.freeze(e)}return markdownit={forEachInlineCodeSpan:t,getMarkdownItTokens:function(r,o,i){const a=r.parse(o,{});return function(r,o){let i=null;const a=r;for(const s of a){if("tr_open"===s.type?i=s.map:"tr_close"===s.type&&(i=null),!s.map&&i&&(s.map=[...i]),s.map)for(s.line=o[s.map[0]],s.lineNumber=s.map[0]+1;s.map[1]&&!(o[s.map[1]-1]||"").trim();)s.map[1]--;if(s.children){const n=[];s.children.some(e=>"code_inline"===e.type)&&t(s.content,t=>{n.push(t.split(e).length-1)});let r=s.lineNumber;for(const e of s.children)e.lineNumber=r,e.line=o[r-1],"softbreak"===e.type||"hardbreak"===e.type?r++:"code_inline"===e.type&&(r+=n.shift())}n(s)}Object.freeze(r)}(a,i),a}}}function requireMarkdownItCjs(){return requireMarkdownit()}var deferRequire={requireMarkdownItCjs:requireMarkdownItCjs};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}"undefined"==typeof __non_webpack_require__||__non_webpack_require__;const md001={names:["MD001","heading-increment"],description:"Heading levels should only increment by one level at a time",tags:["headings"],parser:"micromark",function:function(e,t){let n=Number.MAX_SAFE_INTEGER;for(const r of filterByTypesCached(["atxHeading","setextHeading"])){const e=micromarkHelpersExports.getHeadingLevel(r);e>n&&helpersExports.addErrorDetailIf(t,r.startLine,`h${n+1}`,`h${e}`),n=e}}},md003={names:["MD003","heading-style"],description:"Heading style",tags:["headings"],parser:"micromark",function:function(e,t){let n=String(e.config.style||"consistent");for(const r of filterByTypesCached(["atxHeading","setextHeading"])){const e=micromarkHelpersExports.getHeadingStyle(r);if("consistent"===n&&(n=e),e!==n){const o=micromarkHelpersExports.getHeadingLevel(r)<=2;if(!("setext_with_atx"===n&&(o&&"setext"===e||!o&&"atx"===e))&&!("setext_with_atx_closed"===n&&(o&&"setext"===e||!o&&"atx_closed"===e))){let i=n;"setext_with_atx"===n?i=o?"setext":"atx":"setext_with_atx_closed"===n&&(i=o?"setext":"atx_closed"),helpersExports.addErrorDetailIf(t,r.startLine,i,e)}}}}},markerToStyle={"-":"dash","+":"plus","*":"asterisk"},styleToMarker={dash:"-",plus:"+",asterisk:"*"},differentItemStyle={dash:"plus",plus:"asterisk",asterisk:"dash"},validStyles=new Set(["asterisk","consistent","dash","plus","sublist"]),md004={names:["MD004","ul-style"],description:"Unordered list style",tags:["bullet","ul"],parser:"micromark",function:function(e,t){const n=String(e.config.style||"consistent");let r=validStyles.has(n)?n:"dash";const o=[];for(const i of filterByTypesCached(["listUnordered"])){let e=0;if("sublist"===n){let t=i;for(;t=micromarkHelpersExports.getParentOfType(t,["listOrdered","listUnordered"]);)e++}const a=micromarkHelpersExports.getDescendantsByType(i,["listItemPrefix","listItemMarker"]);for(const i of a){const a=markerToStyle[i.text];"sublist"===n?(o[e]||(o[e]=a===o[e-1]?differentItemStyle[a]:a),r=o[e]):"consistent"===r&&(r=a);const s=i.startColumn,l=i.endColumn-i.startColumn;helpersExports.addErrorDetailIf(t,i.startLine,r,a,void 0,void 0,[s,l],{editColumn:s,deleteCount:l,insertText:styleToMarker[r]})}}}},md005={names:["MD005","list-indent"],description:"Inconsistent indentation for list items at the same level",tags:["bullet","ul","indentation"],parser:"micromark",function:function(e,t){for(const n of filterByTypesCached(["listOrdered","listUnordered"])){const e=n.startColumn-1;let r=0,o=!1;const i=n.children.filter(e=>"listItemPrefix"===e.type);for(const a of i){const i=a.startLine,s=a.startColumn-1,l=[1,a.endColumn-1];if("listUnordered"===n.type)helpersExports.addErrorDetailIf(t,i,e,s,void 0,void 0,l);else{const n=a.text.trim().length,c=a.startColumn+n-1;if(r=r||c,e!==s||o)if(r===c)o=!0;else{const a=o?`Expected: (${r}); Actual: (${c})`:`Expected: ${e}; Actual: ${s}`,u=o?r-n:e,d=o?c-n:s;helpersExports.addError(t,i,a,void 0,l,{editColumn:Math.min(d,u)+1,deleteCount:Math.max(d-u,0),insertText:"".padEnd(Math.max(u-d,0))})}}}}}},unorderedListTypes=["blockQuotePrefix","listItemPrefix","listUnordered"],unorderedParentTypes=["blockQuote","listOrdered","listUnordered"],md007={names:["MD007","ul-indent"],description:"Unordered list indentation",tags:["bullet","ul","indentation"],parser:"micromark",function:function(e,t){const n=Number(e.config.indent||2),r=!!e.config.start_indented,o=Number(e.config.start_indent||n),i=new Map;let a=null;const s=filterByTypesCached(unorderedListTypes);for(const l of s){const{endColumn:e,parent:s,startColumn:c,startLine:u,type:d}=l;if("blockQuotePrefix"===d)a=l;else if("listUnordered"===d){let e=0,t=l;for(;t=micromarkHelpersExports.getParentOfType(t,unorderedParentTypes);){if("listUnordered"!==t.type){"listOrdered"===t.type&&(e=-1);break}e++}e>=0&&i.set(l,e)}else{const l=i.get(s);if(void 0!==l){const i=(r?o:0)+l*n,s=c-1-((null==a?void 0:a.endLine)===u?a.endColumn-1:0),d=[1,e-1],p={editColumn:c-s,deleteCount:Math.max(s-i,0),insertText:"".padEnd(Math.max(i-s,0))};helpersExports.addErrorDetailIf(t,u,i,s,void 0,void 0,d,p)}}}}},md009={names:["MD009","no-trailing-spaces"],description:"Trailing spaces",tags:["whitespace"],parser:"micromark",function:function(e,t){let n=e.config.br_spaces;n=Number(void 0===n?2:n);const r=!!e.config.list_item_empty_lines,o=!!e.config.strict,i=new Set;for(const u of filterByTypesCached(["codeFenced"]))micromarkHelpersExports.addRangeToSet(i,u.startLine+1,u.endLine-1);for(const u of filterByTypesCached(["codeIndented"]))micromarkHelpersExports.addRangeToSet(i,u.startLine,u.endLine);const a=new Set;if(r)for(const u of filterByTypesCached(["listOrdered","listUnordered"])){micromarkHelpersExports.addRangeToSet(a,u.startLine,u.endLine);let e=!0;for(let t=u.children.length-1;t>=0;t--){const n=u.children[t];switch(n.type){case"content":e=!1;break;case"listItemIndent":e&&a.delete(n.startLine);break;case"listItemPrefix":e=!0}}}const s=new Set,l=new Set;if(o){for(const e of filterByTypesCached(["paragraph"]))micromarkHelpersExports.addRangeToSet(s,e.startLine,e.endLine-1);for(const e of filterByTypesCached(["codeText"]))micromarkHelpersExports.addRangeToSet(l,e.startLine,e.endLine-1)}const c=n<2?0:n;for(let u=0;u<e.lines.length;u++){const n=e.lines[u],r=u+1,d=n.length-n.trimEnd().length;if(d&&!i.has(r)&&!a.has(r)&&(c!==d||o&&(!s.has(r)||l.has(r)))){const e=n.length-d+1;helpersExports.addError(t,r,"Expected: "+(0===c?"":"0 or ")+c+"; Actual: "+d,void 0,[e,d],{editColumn:e,deleteCount:d})}}}},tabRe=/\t+/g,md010={names:["MD010","no-hard-tabs"],description:"Hard tabs",tags:["whitespace","hard_tab"],parser:"micromark",function:function(e,t){const n=e.config.code_blocks,r=void 0===n||!!n,o=new Set((e.config.ignore_code_languages||[]).map(e=>e.toLowerCase())),i=e.config.spaces_per_tab,a=void 0===i?1:Math.max(0,Number(i)),s=[];r?o.size>0&&s.push("codeFenced"):s.push("codeFenced","codeIndented","codeText");const l=filterByTypesCached(s).filter(e=>{if("codeFenced"===e.type&&o.size>0){return micromarkHelpersExports.getDescendantsByType(e,["codeFencedFence","codeFencedFenceInfo"]).every(e=>o.has(e.text.toLowerCase()))}return!0}).map(e=>{const{type:t,startLine:n,startColumn:r,endLine:o,endColumn:i}=e,a="codeFenced"===t;return{startLine:n+(a?1:0),startColumn:a?0:r,endLine:o-(a?1:0),endColumn:a?Number.MAX_SAFE_INTEGER:i}});for(let c=0;c<e.lines.length;c++){const n=e.lines[c];let r=null;for(;null!==(r=tabRe.exec(n));){const e=c+1,n=r.index+1,o=r[0].length,i={startLine:e,startColumn:n,endLine:e,endColumn:n+o-1};l.some(e=>helpersExports.hasOverlap(e,i))||helpersExports.addError(t,e,"Column: "+n,void 0,[n,o],{editColumn:n,deleteCount:o,insertText:"".padEnd(o*a)})}}}},reversedLinkRe=/(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)\](?!\()/g,md011={names:["MD011","no-reversed-links"],description:"Reversed link syntax",tags:["links"],parser:"micromark",function:function(e,t){const n=new Set;for(const o of filterByTypesCached(["codeFenced","codeIndented"]))micromarkHelpersExports.addRangeToSet(n,o.startLine,o.endLine);const r=filterByTypesCached(["codeText"]);for(const[o,i]of e.lines.entries()){const e=o+1;if(!n.has(e)){let n=null;for(;null!==(n=reversedLinkRe.exec(i));){const[o,i,a,s]=n;if(!a.endsWith("\\")&&!s.endsWith("\\")){const l=n.index+i.length+1,c=n[0].length-i.length,u={startLine:e,startColumn:l,endLine:e,endColumn:l+c-1};r.some(e=>helpersExports.hasOverlap(e,u))||helpersExports.addError(t,e,o.slice(i.length),void 0,[l,c],{editColumn:l,deleteCount:c,insertText:`[${a}](${s})`})}}}}}},md012={names:["MD012","no-multiple-blanks"],description:"Multiple consecutive blank lines",tags:["whitespace","blank_lines"],parser:"micromark",function:function(e,t){const n=Number(e.config.maximum||1),{lines:r}=e,o=new Set;for(const a of filterByTypesCached(["codeFenced","codeIndented"]))micromarkHelpersExports.addRangeToSet(o,a.startLine,a.endLine);let i=0;for(const[a,s]of r.entries()){i=o.has(a+1)||s.trim().length>0?0:i+1,n<i&&helpersExports.addErrorDetailIf(t,a+1,n,i,void 0,void 0,void 0,{deleteCount:-1})}}},longLineRePrefix="^.{",longLineRePostfixRelaxed="}.*\\s.*$",longLineRePostfixStrict="}.+$",sternModeRe=/^(?:[#>\s]*\s)?\S*$/,md013={names:["MD013","line-length"],description:"Line length",tags:["line_length"],parser:"micromark",function:function(e,t){const n=Number(e.config.line_length||80),r=Number(e.config.heading_line_length||n),o=Number(e.config.code_block_line_length||n),i=!!e.config.strict,a=!!e.config.stern,s=i||a?longLineRePostfixStrict:longLineRePostfixRelaxed,l=new RegExp(longLineRePrefix+n+s),c=new RegExp(longLineRePrefix+r+s),u=new RegExp(longLineRePrefix+o+s),d=e.config.code_blocks,p=void 0===d||!!d,h=e.config.tables,f=void 0===h||!!h,A=e.config.headings,m=void 0===A||!!A,g=new Set;for(const $ of filterByTypesCached(["atxHeading","setextHeading"]))micromarkHelpersExports.addRangeToSet(g,$.startLine,$.endLine);const y=new Set;for(const $ of filterByTypesCached(["codeFenced","codeIndented"]))micromarkHelpersExports.addRangeToSet(y,$.startLine,$.endLine);const v=new Set;for(const $ of filterByTypesCached(["table"]))micromarkHelpersExports.addRangeToSet(v,$.startLine,$.endLine);const b=new Set;for(const $ of filterByTypesCached(["autolink","image","link","literalAutolink"]))micromarkHelpersExports.addRangeToSet(b,$.startLine,$.endLine);const x=new Set;for(const $ of filterByTypesCached(["paragraph"]))for(const e of micromarkHelpersExports.getDescendantsByType($,["data"]))micromarkHelpersExports.addRangeToSet(x,e.startLine,e.endLine);const w=new Set;for(const $ of b)x.has($)||w.add($);const C=new Set(getReferenceLinkImageData().definitionLineIndices);for(let $=0;$<e.lines.length;$++){const s=e.lines[$],d=$+1,h=g.has(d),A=y.has(d),b=v.has(d),x=A?o:h?r:n,_=A?u:h?c:l;!p&&A||!f&&b||!m&&h||C.has($)||!i&&(a&&sternModeRe.test(s)||w.has(d))||!_.test(s)||helpersExports.addErrorDetailIf(t,d,x,s.length,void 0,void 0,[x+1,s.length-x])}}},dollarCommandRe=/^(\s*)(\$\s+)/,md014={names:["MD014","commands-show-output"],description:"Dollar signs used before commands without showing output",tags:["code"],parser:"micromark",function:function(e,t){for(const n of filterByTypesCached(["codeFenced","codeIndented"])){const e=n.children.filter(e=>"codeFlowValue"===e.type),r=e.map(e=>({result:e.text.match(dollarCommandRe),startColumn:e.startColumn,startLine:e.startLine,text:e.text})).filter(e=>e.result);if(r.length===e.length)for(const n of r){const e=n.startColumn+n.result[1].length,r=n.result[2].length;helpersExports.addErrorContext(t,n.startLine,n.text,void 0,void 0,[e,r],{editColumn:e,deleteCount:r})}}}},md018={names:["MD018","no-missing-space-atx"],description:"No space after hash on atx style heading",tags:["headings","atx","spaces"],parser:"micromark",function:function(e,t){const{lines:n}=e,r=new Set;for(const o of filterByTypesCached(["codeFenced","codeIndented","htmlFlow"]))micromarkHelpersExports.addRangeToSet(r,o.startLine,o.endLine);for(const[o,i]of n.entries())if(!r.has(o+1)&&/^#+[^# \t]/.test(i)&&!/#\s*$/.test(i)&&!i.startsWith("#️⃣")){const e=/^#+/.exec(i)[0].length;helpersExports.addErrorContext(t,o+1,i.trim(),void 0,void 0,[1,e+1],{editColumn:e+1,insertText:" "})}}};function validateHeadingSpaces(e,t,n){const{children:r,startLine:o,text:i}=t;let a=n>0?0:r.length-1;for(;r[a]&&"atxHeadingSequence"!==r[a].type;)a+=n;const s=r[a],l=r[a+n];if("atxHeadingSequence"===(null==s?void 0:s.type)&&"whitespace"===(null==l?void 0:l.type)&&l.text.length>1){const t=l.startColumn+1,r=l.endColumn-t;helpersExports.addErrorContext(e,o,i.trim(),n>0,n<0,[t,r],{editColumn:t,deleteCount:r})}}const md019md021=[{names:["MD019","no-multiple-space-atx"],description:"Multiple spaces after hash on atx style heading",tags:["headings","atx","spaces"],parser:"micromark",function:function(e,t){const n=filterByTypesCached(["atxHeading"]).filter(e=>"atx"===micromarkHelpersExports.getHeadingStyle(e));for(const r of n)validateHeadingSpaces(t,r,1)}},{names:["MD021","no-multiple-space-closed-atx"],description:"Multiple spaces inside hashes on closed atx style heading",tags:["headings","atx_closed","spaces"],parser:"micromark",function:function(e,t){const n=filterByTypesCached(["atxHeading"]).filter(e=>"atx_closed"===micromarkHelpersExports.getHeadingStyle(e));for(const r of n)validateHeadingSpaces(t,r,1),validateHeadingSpaces(t,r,-1)}}],md020={names:["MD020","no-missing-space-closed-atx"],description:"No space inside hashes on closed atx style heading",tags:["headings","atx_closed","spaces"],parser:"micromark",function:function(e,t){const{lines:n}=e,r=new Set;for(const o of filterByTypesCached(["codeFenced","codeIndented","htmlFlow"]))micromarkHelpersExports.addRangeToSet(r,o.startLine,o.endLine);for(const[o,i]of n.entries())if(!r.has(o+1)){const e=/^(#+)([ \t]*)([^# \t\\]|[^# \t][^#]*?[^# \t\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(i);if(e){const[,n,{length:r},a,{length:s},l,c,{length:u}]=e,d=n.length,p=c.length,h=!r,f=!s||!!l,A=l?`${l} `:"";if(h||f){const e=h?[1,d+1]:[i.length-u-p,p+1];helpersExports.addErrorContext(t,o+1,i.trim(),h,f,e,{editColumn:1,deleteCount:i.length,insertText:`${n} ${a} ${A}${c}`})}}}}},defaultLines=1,getLinesFunction=e=>{if(Array.isArray(e)){const t=new Array(6).fill(defaultLines);for(const[n,r]of[...e.entries()].slice(0,6))t[n]=r;return e=>t[micromarkHelpersExports.getHeadingLevel(e)-1]}const t=void 0===e?defaultLines:Number(e);return()=>t},md022={names:["MD022","blanks-around-headings"],description:"Headings should be surrounded by blank lines",tags:["headings","blank_lines"],parser:"micromark",function:function(e,t){const n=getLinesFunction(e.config.lines_above),r=getLinesFunction(e.config.lines_below),{lines:o}=e,i=filterByTypesCached(["blockQuotePrefix","linePrefix"]);for(const a of filterByTypesCached(["atxHeading","setextHeading"])){const{startLine:e,endLine:s}=a,l=o[e-1].trim(),c=n(a);if(c>=0){let n=0;for(let t=0;t<c&&helpersExports.isBlankLine(o[e-2-t]);t++)n++;helpersExports.addErrorDetailIf(t,e,c,n,"Above",l,void 0,{insertText:micromarkHelpersExports.getBlockQuotePrefixText(i,e-1,c-n)})}const u=r(a);if(u>=0){let n=0;for(let e=0;e<u&&helpersExports.isBlankLine(o[s+e]);e++)n++;helpersExports.addErrorDetailIf(t,e,u,n,"Below",l,void 0,{lineNumber:s+1,insertText:micromarkHelpersExports.getBlockQuotePrefixText(i,s+1,u-n)})}}}},md023={names:["MD023","heading-start-left"],description:"Headings must start at the beginning of the line",tags:["headings","spaces"],parser:"micromark",function:function(e,t){const n=filterByTypesCached(["atxHeading","linePrefix","setextHeading"]);for(let r=0;r<n.length-1;r++)if("linePrefix"===n[r].type&&"linePrefix"!==n[r+1].type&&n[r].startLine===n[r+1].startLine){const{endColumn:o,startColumn:i,startLine:a}=n[r],s=o-i;helpersExports.addErrorContext(t,a,e.lines[a-1],!0,!1,[i,s],{editColumn:i,deleteCount:s})}}},md024={names:["MD024","no-duplicate-heading"],description:"Multiple headings with the same content",tags:["headings"],parser:"micromark",function:function(e,t){const n=!!e.config.siblings_only||!1,r=[null,[]];let o=1,i=r[o];for(const a of filterByTypesCached(["atxHeading","setextHeading"])){const e=micromarkHelpersExports.getHeadingText(a);if(n){const e=micromarkHelpersExports.getHeadingLevel(a);for(;o<e;)o++,r[o]=[];for(;o>e;)r[o]=[],o--;i=r[e]}i.includes(e)?helpersExports.addErrorContext(t,a.startLine,e.trim()):i.push(e)}}},md025={names:["MD025","single-title","single-h1"],description:"Multiple top-level headings in the same document",tags:["headings"],parser:"micromark",function:function(e,t){const n=Number(e.config.level||1),{tokens:r}=e.parsers.micromark,o=filterByTypesCached(["atxHeading","setextHeading"]).filter(e=>n===micromarkHelpersExports.getHeadingLevel(e)&&!micromarkHelpersExports.isDocfxTab(e));if(o.length>0){const n=helpersExports.frontMatterHasTitle(e.frontMatterLines,e.config.front_matter_title);let i=n;if(!i){i=r.slice(0,r.indexOf(o[0])).every(e=>micromarkHelpersExports.nonContentTokens.has(e.type)||micromarkHelpersExports.isHtmlFlowComment(e))}if(i)for(const e of o.slice(n?0:1))helpersExports.addErrorContext(t,e.startLine,micromarkHelpersExports.getHeadingText(e))}}},md026={names:["MD026","no-trailing-punctuation"],description:"Trailing punctuation in heading",tags:["headings"],parser:"micromark",function:function(e,t){let n=e.config.punctuation;n=String(void 0===n?helpersExports.allPunctuationNoQuestion:n);const r=new RegExp("\\s*["+helpersExports.escapeForRegExp(n)+"]+$"),o=filterByTypesCached(["atxHeadingText","setextHeadingText"]);for(const i of o){const{endColumn:e,endLine:n,text:o}=i,a=r.exec(o);if(a&&!helpersExports.endOfLineHtmlEntityRe.test(o)&&!helpersExports.endOfLineGemojiCodeRe.test(o)){const r=a[0],o=r.length,i=e-o;helpersExports.addError(t,n,`Punctuation: '${r}'`,void 0,[i,o],{editColumn:i,deleteCount:o})}}}},listTypes=["listOrdered","listUnordered"],md027={names:["MD027","no-multiple-space-blockquote"],description:"Multiple spaces after blockquote symbol",tags:["blockquote","whitespace","indentation"],parser:"micromark",function:function(e,t){var n,r;const o=e.config.list_items,i=void 0===o||!!o,{tokens:a}=e.parsers.micromark;for(const s of filterByTypesCached(["linePrefix"])){const o=s.parent,l="codeIndented"===(null==o?void 0:o.type),c=(null==o?void 0:o.children)||a;if(!l&&"blockQuotePrefix"===(null==(n=c[c.indexOf(s)-1])?void 0:n.type)&&(i||!listTypes.includes(null==(r=c[c.indexOf(s)+1])?void 0:r.type)&&!micromarkHelpersExports.getParentOfType(s,listTypes))){const{startColumn:n,startLine:r,text:o}=s,{length:i}=o,a=e.lines[r-1];helpersExports.addErrorContext(t,r,a,void 0,void 0,[n,i],{editColumn:n,deleteCount:i})}}}},ignoreTypes=new Set(["lineEnding","listItemIndent","linePrefix"]),md028={names:["MD028","no-blanks-blockquote"],description:"Blank line inside blockquote",tags:["blockquote","whitespace"],parser:"micromark",function:function(e,t){var n;for(const r of filterByTypesCached(["blockQuote"])){const o=[],i=(null==(n=r.parent)?void 0:n.children)||e.parsers.micromark.tokens;for(let e=i.indexOf(r)+1;e<i.length;e++){const n=i[e],{startLine:r,type:a}=n;if("lineEndingBlank"===a)o.push(r);else if(!ignoreTypes.has(a)){if("blockQuote"===a){for(const e of o)helpersExports.addError(t,e);break}break}}}}},listStyleExamples={one:"1/1/1",ordered:"1/2/3",zero:"0/0/0"};function getOrderedListItemValue(e){return Number(micromarkHelpersExports.getDescendantsByType(e,["listItemValue"])[0].text)}const md029={names:["MD029","ol-prefix"],description:"Ordered list item prefix",tags:["ol"],parser:"micromark",function:function(e,t){const n=String(e.config.style||"one_or_ordered");for(const r of filterByTypesCached(["listOrdered"])){const e=micromarkHelpersExports.getDescendantsByType(r,["listItemPrefix"]);let o=1,i=!1;if(e.length>=2){const t=getOrderedListItemValue(e[0]);1===getOrderedListItemValue(e[1])&&0!==t||(i=!0,0===t&&(o=0))}let a=n;"one_or_ordered"===a?a=i?"ordered":"one":"zero"===a?o=0:"one"===a&&(o=1);for(const n of e){const e=getOrderedListItemValue(n);helpersExports.addErrorDetailIf(t,n.startLine,o,e,"Style: "+listStyleExamples[a],void 0,[n.startColumn,n.endColumn-n.startColumn]),"ordered"===a&&o++}}}},md030={names:["MD030","list-marker-space"],description:"Spaces after list markers",tags:["ol","ul","whitespace"],parser:"micromark",function:function(e,t){const n=Number(e.config.ul_single||1),r=Number(e.config.ol_single||1),o=Number(e.config.ul_multi||1),i=Number(e.config.ol_multi||1);for(const a of filterByTypesCached(["listOrdered","listUnordered"])){const e="listOrdered"===a.type,s=a.children.filter(e=>"listItemPrefix"===e.type),l=a.endLine-a.startLine+1===s.length,c=e?l?r:i:l?n:o;for(const n of s){const e=[n.startColumn,n.endColumn-n.startColumn],r=n.children.filter(e=>"listItemPrefixWhitespace"===e.type);for(const n of r){const{endColumn:r,startColumn:o,startLine:i}=n,a=r-o,s={editColumn:o,deleteCount:a,insertText:"".padEnd(c)};helpersExports.addErrorDetailIf(t,i,c,a,void 0,void 0,e,s)}}}}},codeFencePrefixRe=/^(.*?)[`~]/;function addError(e,t,n,r){const o=t[n-1],[,i]=o.match(codeFencePrefixRe)||[],a=void 0===i?void 0:{lineNumber:n+(r?0:1),insertText:`${i.replace(/[^>]/g," ").trim()}\n`};helpersExports.addErrorContext(e,n,o.trim(),void 0,void 0,void 0,a)}const md031={names:["MD031","blanks-around-fences"],description:"Fenced code blocks should be surrounded by blank lines",tags:["code","blank_lines"],parser:"micromark",function:function(e,t){const n=e.config.list_items,r=void 0===n||!!n,{lines:o}=e;for(const i of filterByTypesCached(["codeFenced"]))!r&µmarkHelpersExports.getParentOfType(i,["listOrdered","listUnordered"])||(helpersExports.isBlankLine(o[i.startLine-2])||addError(t,o,i.startLine,!0),helpersExports.isBlankLine(o[i.endLine])||helpersExports.isBlankLine(o[i.endLine-1])||addError(t,o,i.endLine,!1))}},isList=e=>"listOrdered"===e.type||"listUnordered"===e.type,md032={names:["MD032","blanks-around-lists"],description:"Lists should be surrounded by blank lines",tags:["bullet","ul","ol","blank_lines"],parser:"micromark",function:function(e,t){const{lines:n,parsers:r}=e,o=filterByTypesCached(["blockQuotePrefix","linePrefix"]),i=micromarkHelpersExports.filterByPredicate(r.micromark.tokens,isList,e=>isList(e)||"htmlFlow"===e.type?[]:e.children);for(const a of i){const e=a.startLine;helpersExports.isBlankLine(n[e-2])||helpersExports.addErrorContext(t,e,n[e-1].trim(),void 0,void 0,void 0,{insertText:micromarkHelpersExports.getBlockQuotePrefixText(o,e)});const r=micromarkHelpersExports.filterByPredicate(a.children,e=>!micromarkHelpersExports.nonContentTokens.has(e.type),e=>micromarkHelpersExports.nonContentTokens.has(e.type)?[]:e.children);let i=a.endLine;r.length>0&&(i=r[r.length-1].endLine);const s=i;helpersExports.isBlankLine(n[s])||helpersExports.addErrorContext(t,s,n[s-1].trim(),void 0,void 0,void 0,{lineNumber:s+1,insertText:micromarkHelpersExports.getBlockQuotePrefixText(o,s)})}}},md033={names:["MD033","no-inline-html"],description:"Inline HTML",tags:["html"],parser:"micromark",function:function(e,t){let n=e.config.allowed_elements;n=Array.isArray(n)?n:[],n=n.map(e=>e.toLowerCase());for(const r of filterByTypesCached(["htmlText"],!0)){const e=micromarkHelpersExports.getHtmlTagInfo(r);if(e&&!e.close&&!n.includes(e.name.toLowerCase())){const n=[r.startColumn,r.text.replace(helpersExports.nextLinesRe,"").length];helpersExports.addError(t,r.startLine,"Element: "+e.name,void 0,n)}}}},md034={names:["MD034","no-bare-urls"],description:"Bare URL used",tags:["links","url"],parser:"micromark",function:function(e,t){for(const r of(n=e.parsers.micromark.tokens,micromarkHelpersExports.filterByPredicate(n,e=>{var t;if("literalAutolink"===e.type&&!micromarkHelpersExports.inHtmlFlow(e)){const n=null==(t=e.parent)?void 0:t.children,r=null==n?void 0:n.indexOf(e),o=null==n?void 0:n.at(r-1),i=null==n?void 0:n.at(r+1);return!(o&&i&&"data"===o.type&&"data"===i.type&&o.text.endsWith("<")&&i.text.startsWith(">"))}return!1},e=>{const{children:t}=e,n=[];for(let r=0;r<t.length;r++){const e=t[r],o=micromarkHelpersExports.getHtmlTagInfo(e);if(o&&!o.close){let e=1;for(let n=r+1;n<t.length;n++){const i=t[n],a=micromarkHelpersExports.getHtmlTagInfo(i);if(a&&o.name===a.name)if(a.close){if(e--,0===e){r=n;break}}else e++}}else n.push(e)}return n}))){const e=[r.startColumn,r.endColumn-r.startColumn],n={editColumn:e[0],deleteCount:e[1],insertText:`<${r.text}>`};helpersExports.addErrorContext(t,r.startLine,r.text,void 0,void 0,e,n)}var n}},md035={names:["MD035","hr-style"],description:"Horizontal rule style",tags:["hr"],parser:"micromark",function:function(e,t){let n=String(e.config.style||"consistent").trim();const r=filterByTypesCached(["thematicBreak"]);for(const o of r){const{startLine:e,text:r}=o;"consistent"===n&&(n=r),helpersExports.addErrorDetailIf(t,e,n,r)}}},emphasisTypes=[["emphasis","emphasisText"],["strong","strongText"]],isParagraphChildMeaningful=e=>!("htmlText"===e.type||"data"===e.type&&0===e.text.trim().length),md036={names:["MD036","no-emphasis-as-heading"],description:"Emphasis used instead of a heading",tags:["headings","emphasis"],parser:"micromark",function:function(e,t){let n=e.config.punctuation;n=String(void 0===n?helpersExports.allPunctuation:n);const r=new RegExp("["+n+"]$"),o=filterByTypesCached(["paragraph"],!0).filter(e=>{var t,n,r,o,i,a;return"content"===(null==(t=e.parent)?void 0:t.type)&&(!(null==(n=e.parent)?void 0:n.parent)||"htmlFlow"===(null==(o=null==(r=e.parent)?void 0:r.parent)?void 0:o.type)&&!(null==(a=null==(i=e.parent)?void 0:i.parent)?void 0:a.parent))&&1===e.children.filter(isParagraphChildMeaningful).length});for(const i of emphasisTypes){const e=micromarkHelpersExports.getDescendantsByType(o,i);for(const n of e)1!==n.children.length||"data"!==n.children[0].type||r.test(n.text)||helpersExports.addErrorContext(t,n.startLine,n.text)}}},md037={names:["MD037","no-space-in-emphasis"],description:"Spaces inside emphasis markers",tags:["whitespace","emphasis"],parser:"micromark",function:function(e,t){const{lines:n,parsers:r}=e,o=new Map;for(const a of["_","__","___","*","**","***"])o.set(a,[]);const i=micromarkHelpersExports.filterByPredicate(r.micromark.tokens,e=>e.children.some(e=>"data"===e.type));for(const a of i){for(const e of o.values())e.length=0;for(const e of a.children){const{text:t,type:n}=e;if("data"===n&&t.length<=3){const n=o.get(t);n&&!micromarkHelpersExports.inHtmlFlow(e)&&n.push(e)}}for(const e of o.entries()){const[r,o]=e;for(let e=0;e+1<o.length;e+=2){const i=o[e],a=n[i.startLine-1].slice(i.endColumn-1).match(/^\s+\S/);if(a){const[e]=a,n=`${r}${e}`;helpersExports.addError(t,i.startLine,void 0,n,[i.startColumn,n.length],{editColumn:i.endColumn,deleteCount:e.length-1})}const s=o[e+1],l=n[s.startLine-1].slice(0,s.startColumn-1).match(/\S\s+$/);if(l){const[e]=l,n=`${e}${r}`;helpersExports.addError(t,s.startLine,void 0,n,[s.endColumn-n.length,n.length],{editColumn:s.startColumn-(e.length-1),deleteCount:e.length-1})}}}}}},md038={names:["MD038","no-space-in-code"],description:"Spaces inside code span elements",tags:["whitespace","code"],parser:"micromark",function:function(e,t){const n=filterByTypesCached(["codeText"]);for(const r of n){const e=micromarkHelpersExports.getDescendantsByType(r,["codeTextData"]);if(e.length>0){const n=micromarkHelpersExports.getDescendantsByType(r,["codeTextPadding"]),o=n[0],i=e[0],a=/^(\s+)(\S)/.exec(i.text)||[null,"",""],s="`"===a[2],l=a[1].length-(s&&!o?1:0),c=l>0,u=n[n.length-1],d=e[e.length-1],p=/(\S)(\s+)$/.exec(d.text)||[null,"",""],h="`"===p[1],f=p[2].length-(h&&!u?1:0),A=f>0,m=c&&A&&o&&u&&!s&&!h,g=r.text;if(c){const e=(m?o:i).startColumn,n=l+(m?o.text.length:0);helpersExports.addErrorContext(t,i.startLine,g,!0,!1,[e,n],{editColumn:e,deleteCount:n})}if(A){const e=(m?u:d).endColumn,n=f+(m?u.text.length:0);helpersExports.addErrorContext(t,d.endLine,g,!1,!0,[e-n,n],{editColumn:e-n,deleteCount:n})}}}}};function addLabelSpaceError(e,t,n,r){const o=n.text.match(r?/^[^\S\r\n]+/:/[^\S\r\n]+$/),i=o?[r?n.startColumn:n.endColumn-o[0].length,o[0].length]:void 0;helpersExports.addErrorContext(e,r?n.startLine+(o?0:1):n.endLine-(o?0:1),t.text.replace(/\s+/g," "),r,!r,i,i?{editColumn:i[0],deleteCount:i[1]}:void 0)}const md039={names:["MD039","no-space-in-links"],description:"Spaces inside link text",tags:["whitespace","links"],parser:"micromark",function:function(e,t){const n=filterByTypesCached(["label"]).filter(e=>{var t;return"link"===(null==(t=e.parent)?void 0:t.type)});for(const r of n){const e=r.children.filter(e=>"labelText"===e.type);for(const n of e)n.text.trimStart().length!==n.text.length&&addLabelSpaceError(t,r,n,!0),n.text.trimEnd().length!==n.text.length&&addLabelSpaceError(t,r,n,!1)}}},md040={names:["MD040","fenced-code-language"],description:"Fenced code blocks should have a language specified",tags:["code","language"],parser:"micromark",function:function(e,t){var n;let r=e.config.allowed_languages;r=Array.isArray(r)?r:[];const o=!!e.config.language_only,i=filterByTypesCached(["codeFenced"]);for(const a of i){const e=micromarkHelpersExports.getDescendantsByType(a,["codeFencedFence"])[0],{startLine:i,text:s}=e,l=null==(n=micromarkHelpersExports.getDescendantsByType(e,["codeFencedFenceInfo"])[0])?void 0:n.text;l?r.length>0&&!r.includes(l)&&helpersExports.addError(t,i,`"${l}" is not allowed`):helpersExports.addErrorContext(t,i,s),o&µmarkHelpersExports.getDescendantsByType(e,["codeFencedFenceMeta"]).length>0&&helpersExports.addError(t,i,`Info string contains more than language: "${s}"`)}}},headingTagNameRe=/^h[1-6]$/;function getHtmlFlowTagName(e){const{children:t,type:n}=e;if("htmlFlow"===n){const e=micromarkHelpersExports.filterByTypes(t,["htmlText"],!0),n=e.length>0&µmarkHelpersExports.getHtmlTagInfo(e[0]);if(n)return n.name.toLowerCase()}return null}const md041={names:["MD041","first-line-heading","first-line-h1"],description:"First line in a file should be a top-level heading",tags:["headings"],parser:"micromark",function:function(e,t){const n=!!e.config.allow_preamble,r=Number(e.config.level||1),{tokens:o}=e.parsers.micromark;if(!helpersExports.frontMatterHasTitle(e.frontMatterLines,e.config.front_matter_title)){let i=0;for(const e of o){const{startLine:t,type:o}=e;if(!micromarkHelpersExports.nonContentTokens.has(o)&&!micromarkHelpersExports.isHtmlFlowComment(e)){let a=null;if("atxHeading"===o||"setextHeading"===o){micromarkHelpersExports.getHeadingLevel(e)!==r&&(i=t);break}if((a=getHtmlFlowTagName(e))&&headingTagNameRe.test(a)){a!==`h${r}`&&(i=t);break}if(!n){i=t;break}}}i>0&&helpersExports.addErrorContext(t,i,e.lines[i-1])}}},md042={names:["MD042","no-empty-links"],description:"No empty links",tags:["links"],parser:"micromark",function:function(e,t){const{definitions:n}=getReferenceLinkImageData(),r=e=>{const t=n.get(e.text.trim());return t&&"#"===t[1]},o=filterByTypesCached(["link"]);for(const i of o){const e=micromarkHelpersExports.getDescendantsByType(i,["label","labelText"]),n=micromarkHelpersExports.getDescendantsByType(i,["reference"]),o=micromarkHelpersExports.getDescendantsByType(i,["resource"]),a=micromarkHelpersExports.getDescendantsByType(n,["referenceString"]),s=micromarkHelpersExports.getDescendantsByType(o,["resourceDestination",["resourceDestinationLiteral","resourceDestinationRaw"],"resourceDestinationString"]),l=e.length>0,c=n.length>0,u=o.length>0,d=a.length>0,p=s.length>0;let h=!1;l&&(!c&&!u||c&&!d)?h=r(e[0]):d&&!p?h=r(a[0]):!d&&p?h="#"===s[0].text.trim():d||p||(h=!0),h&&helpersExports.addErrorContext(t,i.startLine,i.text,void 0,void 0,[i.startColumn,i.endColumn-i.startColumn])}}},md043={names:["MD043","required-headings"],description:"Required heading structure",tags:["headings"],parser:"micromark",function:function(e,t){const n=e.config.headings;if(!Array.isArray(n))return;const r=e.config.match_case||!1;let o=0,i=!1,a=!1,s=!1;const l=()=>n[o++]||"[None]",c=e=>r?e:e.toLowerCase();for(const d of filterByTypesCached(["atxHeading","setextHeading"]))if(!a){const e=micromarkHelpersExports.getHeadingText(d),n=micromarkHelpersExports.getHeadingLevel(d);s=!0;const r=`${"".padEnd(n,"#")} ${e}`,u=l();if("*"===u){c(l())!==c(r)&&(i=!0,o--)}else"+"===u?i=!0:"?"===u||(c(u)===c(r)?i=!1:i?o--:(helpersExports.addErrorDetailIf(t,d.startLine,u,r),a=!0))}const u=n.length-o;a||!(u>1||1===u&&"*"!==n[o])||!s&&n.every(e=>"*"===e)||helpersExports.addErrorContext(t,e.lines.length,n[o])}},asciiAlpha=regexCheck(/[A-Za-z]/),asciiAlphanumeric=regexCheck(/[\dA-Za-z]/),asciiAtext=regexCheck(/[#-'*+\--9=?A-Z^-~]/);function asciiControl(e){return null!==e&&(e<32||127===e)}const asciiDigit=regexCheck(/\d/),asciiHexDigit=regexCheck(/[\dA-Fa-f]/),asciiPunctuation=regexCheck(/[!-/:-@[-`{-~]/);function markdownLineEnding(e){return null!==e&&e<-2}function markdownLineEndingOrSpace(e){return null!==e&&(e<0||32===e)}function markdownSpace(e){return-2===e||-1===e||32===e}const unicodePunctuation=regexCheck(new RegExp("\\p{P}|\\p{S}","u")),unicodeWhitespace=regexCheck(/\s/);function regexCheck(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function factorySpace(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){if(markdownSpace(r))return e.enter(n),a(r);return t(r)};function a(r){return markdownSpace(r)&&i++<o?(e.consume(r),a):(e.exit(n),t(r))}}function factoryWhitespace(e,t){let n;return function r(o){if(markdownLineEnding(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(markdownSpace(o))return factorySpace(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}}function factoryAttributes(e,t,n,r,o,i,a,s,l,c,u,d,p,h,f){let A,m;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),g};function g(t){return 35===t?(A=a,y(t)):46===t?(A=s,y(t)):f&&markdownSpace(t)?factorySpace(e,g,"whitespace")(t):!f&&markdownLineEndingOrSpace(t)?factoryWhitespace(e,g)(t):null===t||markdownLineEnding(t)||unicodeWhitespace(t)||unicodePunctuation(t)&&45!==t&&95!==t?B(t):(e.enter(i),e.enter(l),e.consume(t),x)}function y(t){const n=A+"Marker";return e.enter(i),e.enter(A),e.enter(n),e.consume(t),e.exit(n),v}function v(t){if(null===t||34===t||35===t||39===t||46===t||60===t||61===t||62===t||96===t||125===t||markdownLineEndingOrSpace(t))return n(t);const r=A+"Value";return e.enter(r),e.consume(t),b}function b(t){if(null===t||34===t||39===t||60===t||61===t||62===t||96===t)return n(t);if(35===t||46===t||125===t||markdownLineEndingOrSpace(t)){const n=A+"Value";return e.exit(n),e.exit(A),e.exit(i),g(t)}return e.consume(t),b}function x(t){return null===t||markdownLineEnding(t)||unicodeWhitespace(t)||unicodePunctuation(t)&&45!==t&&46!==t&&58!==t&&95!==t?(e.exit(l),f&&markdownSpace(t)?factorySpace(e,w,"whitespace")(t):!f&&markdownLineEndingOrSpace(t)?factoryWhitespace(e,w)(t):w(t)):(e.consume(t),x)}function w(t){return 61===t?(e.enter(c),e.consume(t),e.exit(c),C):(e.exit(i),g(t))}function C(t){return null===t||60===t||61===t||62===t||96===t||125===t||f&&markdownLineEnding(t)?n(t):34===t||39===t?(e.enter(u),e.enter(p),e.consume(t),e.exit(p),m=t,_):f&&markdownSpace(t)?factorySpace(e,C,"whitespace")(t):!f&&markdownLineEndingOrSpace(t)?factoryWhitespace(e,C)(t):(e.enter(d),e.enter(h),e.consume(t),m=void 0,$)}function $(t){return null===t||34===t||39===t||60===t||61===t||62===t||96===t?n(t):125===t||markdownLineEndingOrSpace(t)?(e.exit(h),e.exit(d),e.exit(i),g(t)):(e.consume(t),$)}function _(t){return t===m?(e.enter(p),e.consume(t),e.exit(p),e.exit(u),e.exit(i),k):(e.enter(d),S(t))}function S(t){return t===m?(e.exit(d),_(t)):null===t?n(t):markdownLineEnding(t)?f?n(t):factoryWhitespace(e,S)(t):(e.enter(h),e.consume(t),E)}function E(t){return t===m||null===t||markdownLineEnding(t)?(e.exit(h),S(t)):(e.consume(t),E)}function k(e){return 125===e||markdownLineEndingOrSpace(e)?g(e):B(e)}function B(i){return 125===i?(e.enter(o),e.consume(i),e.exit(o),e.exit(r),t):n(i)}}function factoryLabel$1(e,t,n,r,o,i,a){let s,l=0,c=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),u};function u(n){return 93===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),d(n))}function d(t){if(93===t&&!c)return f(t);const n=e.enter("chunkText",{_contentTypeTextTrailing:!0,contentType:"text",previous:s});return s&&(s.next=n),s=n,p(t)}function p(t){return null===t||l>999||91===t&&++c>32?n(t):93!==t||c--?markdownLineEnding(t)?a?n(t):(e.consume(t),e.exit("chunkText"),d):(e.consume(t),92===t?h:p):(e.exit("chunkText"),f(t))}function h(t){return 91===t||92===t||93===t?(e.consume(t),l++,p):p(t)}function f(n){return e.exit(i),e.enter(o),e.consume(n),e.exit(o),e.exit(r),t}}function factoryName(e,t,n,r){const o=this;return function(t){if(null===t||markdownLineEnding(t)||unicodePunctuation(t)||unicodeWhitespace(t))return n(t);return e.enter(r),e.consume(t),i};function i(a){return null===a||markdownLineEnding(a)||unicodeWhitespace(a)||unicodePunctuation(a)&&45!==a&&95!==a?(e.exit(r),45===o.previous||95===o.previous?n(a):t(a)):(e.consume(a),i)}}const directiveContainer={tokenize:tokenizeDirectiveContainer,concrete:!0},label$2={tokenize:tokenizeLabel$2,partial:!0},attributes$2={tokenize:tokenizeAttributes$2,partial:!0},nonLazyLine={tokenize:tokenizeNonLazyLine,partial:!0};function tokenizeDirectiveContainer(e,t,n){const r=this,o=r.events[r.events.length-1],i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0;let a,s=0;return function(t){return e.enter("directiveContainer"),e.enter("directiveContainerFence"),e.enter("directiveContainerSequence"),l(t)};function l(t){return 58===t?(e.consume(t),s++,l):s<3?n(t):(e.exit("directiveContainerSequence"),factoryName.call(r,e,c,n,"directiveContainerName")(t))}function c(t){return 91===t?e.attempt(label$2,u,u)(t):u(t)}function u(t){return 123===t?e.attempt(attributes$2,d,d)(t):d(t)}function d(t){return factorySpace(e,p,"whitespace")(t)}function p(o){return e.exit("directiveContainerFence"),null===o?w(o):markdownLineEnding(o)?r.interrupt?t(o):e.attempt(nonLazyLine,h,w)(o):n(o)}function h(t){return null===t?w(t):markdownLineEnding(t)?e.check(nonLazyLine,y,w)(t):(e.enter("directiveContainerContent"),f(t))}function f(t){return e.attempt({tokenize:C,partial:!0},x,i?factorySpace(e,A,"linePrefix",i+1):A)(t)}function A(t){return null===t?x(t):markdownLineEnding(t)?e.check(nonLazyLine,g,x)(t):g(t)}function m(t){if(null===t){const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,x(t)}return markdownLineEnding(t)?e.check(nonLazyLine,v,b)(t):(e.consume(t),m)}function g(t){const n=e.enter("chunkDocument",{contentType:"document",previous:a});return a&&(a.next=n),a=n,m(t)}function y(t){return e.enter("directiveContainerContent"),f(t)}function v(t){e.consume(t);const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,f}function b(t){const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,x(t)}function x(t){return e.exit("directiveContainerContent"),w(t)}function w(n){return e.exit("directiveContainer"),t(n)}function C(e,t,n){let o=0;return factorySpace(e,function(t){return e.enter("directiveContainerFence"),e.enter("directiveContainerSequence"),i(t)},"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function i(t){return 58===t?(e.consume(t),o++,i):o<s?n(t):(e.exit("directiveContainerSequence"),factorySpace(e,a,"whitespace")(t))}function a(r){return null===r||markdownLineEnding(r)?(e.exit("directiveContainerFence"),t(r)):n(r)}}}function tokenizeLabel$2(e,t,n){return factoryLabel$1(e,t,n,"directiveContainerLabel","directiveContainerLabelMarker","directiveContainerLabelString",!0)}function tokenizeAttributes$2(e,t,n){return factoryAttributes(e,t,n,"directiveContainerAttributes","directiveContainerAttributesMarker","directiveContainerAttribute","directiveContainerAttributeId","directiveContainerAttributeClass","directiveContainerAttributeName","directiveContainerAttributeInitializerMarker","directiveContainerAttributeValueLiteral","directiveContainerAttributeValue","directiveContainerAttributeValueMarker","directiveContainerAttributeValueData",!0)}function tokenizeNonLazyLine(e,t,n){const r=this;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const directiveLeaf={tokenize:tokenizeDirectiveLeaf},label$1={tokenize:tokenizeLabel$1,partial:!0},attributes$1={tokenize:tokenizeAttributes$1,partial:!0};function tokenizeDirectiveLeaf(e,t,n){const r=this;return function(t){return e.enter("directiveLeaf"),e.enter("directiveLeafSequence"),e.consume(t),o};function o(t){return 58===t?(e.consume(t),e.exit("directiveLeafSequence"),factoryName.call(r,e,i,n,"directiveLeafName")):n(t)}function i(t){return 91===t?e.attempt(label$1,a,a)(t):a(t)}function a(t){return 123===t?e.attempt(attributes$1,s,s)(t):s(t)}function s(t){return factorySpace(e,l,"whitespace")(t)}function l(r){return null===r||markdownLineEnding(r)?(e.exit("directiveLeaf"),t(r)):n(r)}}function tokenizeLabel$1(e,t,n){return factoryLabel$1(e,t,n,"directiveLeafLabel","directiveLeafLabelMarker","directiveLeafLabelString",!0)}function tokenizeAttributes$1(e,t,n){return factoryAttributes(e,t,n,"directiveLeafAttributes","directiveLeafAttributesMarker","directiveLeafAttribute","directiveLeafAttributeId","directiveLeafAttributeClass","directiveLeafAttributeName","directiveLeafAttributeInitializerMarker","directiveLeafAttributeValueLiteral","directiveLeafAttributeValue","directiveLeafAttributeValueMarker","directiveLeafAttributeValueData",!0)}const directiveText={tokenize:tokenizeDirectiveText,previous:previous$2},label={tokenize:tokenizeLabel,partial:!0},attributes={tokenize:tokenizeAttributes,partial:!0};function previous$2(e){return 58!==e||"characterEscape"===this.events[this.events.length-1][1].type}function tokenizeDirectiveText(e,t,n){const r=this;return function(t){return e.enter("directiveText"),e.enter("directiveTextMarker"),e.consume(t),e.exit("directiveTextMarker"),factoryName.call(r,e,o,n,"directiveTextName")};function o(t){return 58===t?n(t):91===t?e.attempt(label,i,i)(t):i(t)}function i(t){return 123===t?e.attempt(attributes,a,a)(t):a(t)}function a(n){return e.exit("directiveText"),t(n)}}function tokenizeLabel(e,t,n){return factoryLabel$1(e,t,n,"directiveTextLabel","directiveTextLabelMarker","directiveTextLabelString")}function tokenizeAttributes(e,t,n){return factoryAttributes(e,t,n,"directiveTextAttributes","directiveTextAttributesMarker","directiveTextAttribute","directiveTextAttributeId","directiveTextAttributeClass","directiveTextAttributeName","directiveTextAttributeInitializerMarker","directiveTextAttributeValueLiteral","directiveTextAttributeValue","directiveTextAttributeValueMarker","directiveTextAttributeValueData")}function directive(){return{text:{58:directiveText},flow:{58:[directiveContainer,directiveLeaf]}}}const element=document.createElement("i");function decodeNamedCharacterReference(e){const t="&"+e+";";element.innerHTML=t;const n=element.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}const wwwPrefix={tokenize:tokenizeWwwPrefix,partial:!0},domain={tokenize:tokenizeDomain,partial:!0},path={tokenize:tokenizePath,partial:!0},trail={tokenize:tokenizeTrail,partial:!0},emailDomainDotTrail={tokenize:tokenizeEmailDomainDotTrail,partial:!0},wwwAutolink={name:"wwwAutolink",tokenize:tokenizeWwwAutolink,previous:previousWww},protocolAutolink={name:"protocolAutolink",tokenize:tokenizeProtocolAutolink,previous:previousProtocol},emailAutolink={name:"emailAutolink",tokenize:tokenizeEmailAutolink,previous:previousEmail},text$3={};function gfmAutolinkLiteral(){return{text:text$3}}let code$2=48;for(;code$2<123;)text$3[code$2]=emailAutolink,code$2++,58===code$2?code$2=65:91===code$2&&(code$2=97);function tokenizeEmailAutolink(e,t,n){const r=this;let o,i;return function(t){if(!gfmAtext(t)||!previousEmail.call(r,r.previous)||previousUnbalanced(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(t)};function a(t){return gfmAtext(t)?(e.consume(t),a):64===t?(e.consume(t),s):n(t)}function s(t){return 46===t?e.check(emailDomainDotTrail,c,l)(t):45===t||95===t||asciiAlphanumeric(t)?(i=!0,e.consume(t),s):c(t)}function l(t){return e.consume(t),o=!0,s}function c(a){return i&&o&&asciiAlpha(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(a)):n(a)}}function tokenizeWwwAutolink(e,t,n){const r=this;return function(t){if(87!==t&&119!==t||!previousWww.call(r,r.previous)||previousUnbalanced(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(wwwPrefix,e.attempt(domain,e.attempt(path,o),n),n)(t)};function o(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}}function tokenizeProtocolAutolink(e,t,n){const r=this;let o="",i=!1;return function(t){if((72===t||104===t)&&previousProtocol.call(r,r.previous)&&!previousUnbalanced(r.events))return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(t),e.consume(t),a;return n(t)};function a(t){if(asciiAlpha(t)&&o.length<5)return o+=String.fromCodePoint(t),e.consume(t),a;if(58===t){const n=o.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),i?l:(i=!0,s)):n(t)}function l(t){return null===t||asciiControl(t)||markdownLineEndingOrSpace(t)||unicodeWhitespace(t)||unicodePunctuation(t)?n(t):e.attempt(domain,e.attempt(path,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}}function tokenizeWwwPrefix(e,t,n){let r=0;return function t(i){if((87===i||119===i)&&r<3)return r++,e.consume(i),t;if(46===i&&3===r)return e.consume(i),o;return n(i)};function o(e){return null===e?n(e):t(e)}}function tokenizeDomain(e,t,n){let r,o,i;return a;function a(t){return 46===t||95===t?e.check(trail,l,s)(t):null===t||markdownLineEndingOrSpace(t)||unicodeWhitespace(t)||45!==t&&unicodePunctuation(t)?l(t):(i=!0,e.consume(t),a)}function s(t){return 95===t?r=!0:(o=r,r=void 0),e.consume(t),a}function l(e){return o||r||!i?n(e):t(e)}}function tokenizePath(e,t){let n=0,r=0;return o;function o(a){return 40===a?(n++,e.consume(a),o):41===a&&r<n?i(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(trail,t,i)(a):null===a||markdownLineEndingOrSpace(a)||unicodeWhitespace(a)?t(a):(e.consume(a),o)}function i(t){return 41===t&&r++,e.consume(t),o}}function tokenizeTrail(e,t,n){return r;function r(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),r):38===a?(e.consume(a),i):93===a?(e.consume(a),o):60===a||null===a||markdownLineEndingOrSpace(a)||unicodeWhitespace(a)?t(a):n(a)}function o(e){return null===e||40===e||91===e||markdownLineEndingOrSpace(e)||unicodeWhitespace(e)?t(e):r(e)}function i(e){return asciiAlpha(e)?a(e):n(e)}function a(t){return 59===t?(e.consume(t),r):asciiAlpha(t)?(e.consume(t),a):n(t)}}function tokenizeEmailDomainDotTrail(e,t,n){return function(t){return e.consume(t),r};function r(e){return asciiAlphanumeric(e)?n(e):t(e)}}function previousWww(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||markdownLineEndingOrSpace(e)}function previousProtocol(e){return!asciiAlpha(e)}function previousEmail(e){return!(47===e||gfmAtext(e))}function gfmAtext(e){return 43===e||45===e||46===e||95===e||asciiAlphanumeric(e)}function previousUnbalanced(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function splice(e,t,n,r){const o=e.length;let i,a=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<r.length;)i=r.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function push$1(e,t){return e.length>0?(splice(e,e.length,0,t),e):t}function classifyCharacter(e){return null===e||markdownLineEndingOrSpace(e)||unicodeWhitespace(e)?1:unicodePunctuation(e)?2:void 0}function resolveAll(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}text$3[43]=emailAutolink,text$3[45]=emailAutolink,text$3[46]=emailAutolink,text$3[95]=emailAutolink,text$3[72]=[emailAutolink,protocolAutolink],text$3[104]=[emailAutolink,protocolAutolink],text$3[87]=[emailAutolink,wwwAutolink],text$3[119]=[emailAutolink,wwwAutolink];const attention={name:"attention",resolveAll:resolveAllAttention,tokenize:tokenizeAttention};function resolveAllAttention(e,t){let n,r,o,i,a,s,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d={...e[n][1].end},p={...e[u][1].start};movePoint(d,-s),movePoint(p,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[u][1].start={...a.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=push$1(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=push$1(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=push$1(l,resolveAll(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=push$1(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=push$1(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,splice(e,n-1,u-n+3,l),u=n+l.length-c-2;break}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e}function tokenizeAttention(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=classifyCharacter(r);let i;return function(t){return i=t,e.enter("attentionSequence"),a(t)};function a(s){if(s===i)return e.consume(s),a;const l=e.exit("attentionSequence"),c=classifyCharacter(s),u=!c||2===c&&o||n.includes(s),d=!o||2===o&&c||n.includes(r);return l._open=Boolean(42===i?u:u&&(o||!d)),l._close=Boolean(42===i?d:d&&(c||!u)),t(s)}}function movePoint(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const autolink$2={name:"autolink",tokenize:tokenizeAutolink};function tokenizeAutolink(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return asciiAlpha(t)?(e.consume(t),i):64===t?n(t):l(t)}function i(e){return 43===e||45===e||46===e||asciiAlphanumeric(e)?(r=1,a(e)):l(e)}function a(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||asciiAlphanumeric(t))&&r++<32?(e.consume(t),a):(r=0,l(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||asciiControl(r)?n(r):(e.consume(r),s)}function l(t){return 64===t?(e.consume(t),c):asciiAtext(t)?(e.consume(t),l):n(t)}function c(e){return asciiAlphanumeric(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||asciiAlphanumeric(t))&&r++<63){const n=45===t?d:u;return e.consume(t),n}return n(t)}}const blankLine={partial:!0,tokenize:tokenizeBlankLine};function tokenizeBlankLine(e,t,n){return function(t){return markdownSpace(t)?factorySpace(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||markdownLineEnding(e)?t(e):n(e)}}const blockQuote={continuation:{tokenize:tokenizeBlockQuoteContinuation},exit:exit,name:"blockQuote",tokenize:tokenizeBlockQuoteStart};function tokenizeBlockQuoteStart(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return markdownSpace(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}function tokenizeBlockQuoteContinuation(e,t,n){const r=this;return function(t){if(markdownSpace(t))return factorySpace(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return o(t)};function o(r){return e.attempt(blockQuote,t,n)(r)}}function exit(e){e.exit("blockQuote")}const characterEscape={name:"characterEscape",tokenize:tokenizeCharacterEscape};function tokenizeCharacterEscape(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return asciiPunctuation(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}const characterReference={name:"characterReference",tokenize:tokenizeCharacterReference};function tokenizeCharacterReference(e,t,n){const r=this;let o,i,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,i=asciiAlphanumeric,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=asciiHexDigit,c):(e.enter("characterReferenceValue"),o=7,i=asciiDigit,c(t))}function c(s){if(59===s&&a){const o=e.exit("characterReferenceValue");return i!==asciiAlphanumeric||decodeNamedCharacterReference(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&a++<o?(e.consume(s),c):n(s)}}const nonLazyContinuation$1={partial:!0,tokenize:tokenizeNonLazyContinuation$1},codeFenced={concrete:!0,name:"codeFenced",tokenize:tokenizeCodeFenced};function tokenizeCodeFenced(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a};function a(t){return e.enter("codeFencedFence"),markdownSpace(t)?factorySpace(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===i?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===i?(o++,e.consume(t),c):o>=s?(e.exit("codeFencedFenceSequence"),markdownSpace(t)?factorySpace(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||markdownLineEnding(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,a=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===i?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),markdownSpace(t)?factorySpace(e,c,"whitespace")(t):c(t))}function c(n){return null===n||markdownLineEnding(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(nonLazyContinuation$1,h,y)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||markdownLineEnding(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):markdownSpace(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),factorySpace(e,d,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),u)}function d(t){return null===t||markdownLineEnding(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(t))}function p(t){return null===t||markdownLineEnding(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===i?n(t):(e.consume(t),p)}function h(t){return e.attempt(o,y,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),A}function A(t){return a>0&&markdownSpace(t)?factorySpace(e,m,"linePrefix",a+1)(t):m(t)}function m(t){return null===t||markdownLineEnding(t)?e.check(nonLazyContinuation$1,h,y)(t):(e.enter("codeFlowValue"),g(t))}function g(t){return null===t||markdownLineEnding(t)?(e.exit("codeFlowValue"),m(t)):(e.consume(t),g)}function y(n){return e.exit("codeFenced"),t(n)}}function tokenizeNonLazyContinuation$1(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const codeIndented={name:"codeIndented",tokenize:tokenizeCodeIndented},furtherStart={partial:!0,tokenize:tokenizeFurtherStart};function tokenizeCodeIndented(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),factorySpace(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?s(t):markdownLineEnding(t)?e.attempt(furtherStart,i,s)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||markdownLineEnding(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),a)}function s(n){return e.exit("codeIndented"),t(n)}}function tokenizeFurtherStart(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):markdownLineEnding(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):factorySpace(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):markdownLineEnding(e)?o(e):n(e)}}const codeText={name:"codeText",previous:previous$1,resolve:resolveCodeText,tokenize:tokenizeCodeText};function resolveCodeText(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e}function previous$1(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type}function tokenizeCodeText(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),a(t)};function a(t){return 96===t?(e.consume(t),i++,a):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(o=e.enter("codeTextSequence"),r=0,c(t)):markdownLineEnding(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||markdownLineEnding(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}}class SpliceBuffer{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&chunkedPush(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),chunkedPush(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),chunkedPush(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);chunkedPush(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);chunkedPush(this.left,t.reverse())}}}function chunkedPush(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 subtokenize(e){const t={};let n,r,o,i,a,s,l,c=-1;const u=new SpliceBuffer(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(s=n[1]._tokenizer.events,o=0,o<s.length&&"lineEndingBlank"===s[o][1].type&&(o+=2),o<s.length&&"content"===s[o][1].type))for(;++o<s.length&&"content"!==s[o][1].type;)"chunkText"===s[o][1].type&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,subcontent(u,c)),c=t[c],l=!0);else if(n[1]._container){for(o=c,r=void 0;o--;)if(i=u.get(o),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if("linePrefix"!==i[1].type&&"listItemIndent"!==i[1].type)break;r&&(n[1].end={...u.get(r)[1].start},a=u.slice(r,c),a.unshift(n),u.splice(r,c-r+1,a))}}return splice(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!l}function subcontent(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,p=-1,h=n,f=0,A=0;const m=[A];for(;h;){for(;e.get(++o)[1]!==h;);i.push(o),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),d&&a.defineSkip(h.start),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++p<s.length;)"exit"===s[p][0]&&"enter"===s[p-1][0]&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(A=p+1,m.push(A),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(a.events=[],h?(h._tokenizer=void 0,h.previous=void 0):m.pop(),p=m.length;p--;){const t=s.slice(m[p],m[p+1]),n=i.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),p=-1;++p<l.length;)c[f+l[p][0]]=f+l[p][1],f+=l[p][1]-l[p][0]-1;return c}const content$1={resolve:resolveContent,tokenize:tokenizeContent},continuationConstruct={partial:!0,tokenize:tokenizeContinuation};function resolveContent(e){return subtokenize(e),e}function tokenizeContent(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):markdownLineEnding(t)?e.check(continuationConstruct,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function tokenizeContinuation(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),factorySpace(e,o,"linePrefix")};function o(o){if(null===o||markdownLineEnding(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function factoryDestination(e,t,n,r,o,i,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){if(60===t)return e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),d;if(null===t||32===t||41===t||asciiControl(t))return n(t);return e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),f(t)};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||markdownLineEnding(t)?n(t):(e.consume(t),92===t?h:p)}function h(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function f(o){return u||null!==o&&41!==o&&!markdownLineEndingOrSpace(o)?u<c&&40===o?(e.consume(o),u++,f):41===o?(e.consume(o),u--,f):null===o||32===o||40===o||asciiControl(o)?n(o):(e.consume(o),92===o?A:f):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o))}function A(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function factoryLabel(e,t,n,r,o,i){const a=this;let s,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),c};function c(d){return l>999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):markdownLineEnding(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||markdownLineEnding(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!markdownSpace(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function factoryTitle(e,t,n,r,o,i){let a;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(o),e.consume(t),e.exit(o),a=40===t?41:t,s;return n(t)};function s(n){return n===a?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===a?(e.exit(i),s(a)):null===t?n(t):markdownLineEnding(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),factorySpace(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||markdownLineEnding(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function normalizeIdentifier(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const definition={name:"definition",tokenize:tokenizeDefinition},titleBefore={partial:!0,tokenize:tokenizeTitleBefore};function tokenizeDefinition(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return factoryLabel.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=normalizeIdentifier(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return markdownLineEndingOrSpace(t)?factoryWhitespace(e,s)(t):s(t)}function s(t){return factoryDestination(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(titleBefore,c,c)(t)}function c(t){return markdownSpace(t)?factorySpace(e,u,"whitespace")(t):u(t)}function u(i){return null===i||markdownLineEnding(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}function tokenizeTitleBefore(e,t,n){return function(t){return markdownLineEndingOrSpace(t)?factoryWhitespace(e,r)(t):n(t)};function r(t){return factoryTitle(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return markdownSpace(t)?factorySpace(e,i,"whitespace")(t):i(t)}function i(e){return null===e||markdownLineEnding(e)?t(e):n(e)}}const hardBreakEscape={name:"hardBreakEscape",tokenize:tokenizeHardBreakEscape};function tokenizeHardBreakEscape(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return markdownLineEnding(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}const headingAtx={name:"headingAtx",resolve:resolveHeadingAtx,tokenize:tokenizeHeadingAtx};function resolveHeadingAtx(e,t){let n,r,o=e.length-2,i=3;return"whitespace"===e[i][1].type&&(i+=2),o-2>i&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4),o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},splice(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e}function tokenizeHeadingAtx(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||markdownLineEndingOrSpace(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||markdownLineEnding(n)?(e.exit("atxHeading"),t(n)):markdownSpace(n)?factorySpace(e,i,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),i(t))}function s(t){return null===t||35===t||markdownLineEndingOrSpace(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),s)}}const htmlBlockNames=["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"],htmlRawNames=["pre","script","style","textarea"],htmlFlow={concrete:!0,name:"htmlFlow",resolveTo:resolveToHtmlFlow,tokenize:tokenizeHtmlFlow},blankLineBefore={partial:!0,tokenize:tokenizeBlankLineBefore},nonLazyContinuationStart={partial:!0,tokenize:tokenizeNonLazyContinuationStart};function resolveToHtmlFlow(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(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 tokenizeHtmlFlow(e,t,n){const r=this;let o,i,a,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),i=!0,h):63===s?(e.consume(s),o=3,r.interrupt?t:M):asciiAlpha(s)?(e.consume(s),a=String.fromCharCode(s),f):n(s)}function u(i){return 45===i?(e.consume(i),o=2,d):91===i?(e.consume(i),o=5,s=0,p):asciiAlpha(i)?(e.consume(i),o=4,r.interrupt?t:M):n(i)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:M):n(o)}function p(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:S:p):n(o)}function h(t){return asciiAlpha(t)?(e.consume(t),a=String.fromCharCode(t),f):n(t)}function f(s){if(null===s||47===s||62===s||markdownLineEndingOrSpace(s)){const l=47===s,c=a.toLowerCase();return l||i||!htmlRawNames.includes(c)?htmlBlockNames.includes(a.toLowerCase())?(o=6,l?(e.consume(s),A):r.interrupt?t(s):S(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?m(s):g(s)):(o=1,r.interrupt?t(s):S(s))}return 45===s||asciiAlphanumeric(s)?(e.consume(s),a+=String.fromCharCode(s),f):n(s)}function A(o){return 62===o?(e.consume(o),r.interrupt?t:S):n(o)}function m(t){return markdownSpace(t)?(e.consume(t),m):$(t)}function g(t){return 47===t?(e.consume(t),$):58===t||95===t||asciiAlpha(t)?(e.consume(t),y):markdownSpace(t)?(e.consume(t),g):$(t)}function y(t){return 45===t||46===t||58===t||95===t||asciiAlphanumeric(t)?(e.consume(t),y):v(t)}function v(t){return 61===t?(e.consume(t),b):markdownSpace(t)?(e.consume(t),v):g(t)}function b(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,x):markdownSpace(t)?(e.consume(t),b):w(t)}function x(t){return t===l?(e.consume(t),l=null,C):null===t||markdownLineEnding(t)?n(t):(e.consume(t),x)}function w(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||markdownLineEndingOrSpace(t)?v(t):(e.consume(t),w)}function C(e){return 47===e||62===e||markdownSpace(e)?g(e):n(e)}function $(t){return 62===t?(e.consume(t),_):n(t)}function _(t){return null===t||markdownLineEnding(t)?S(t):markdownSpace(t)?(e.consume(t),_):n(t)}function S(t){return 45===t&&2===o?(e.consume(t),P):60===t&&1===o?(e.consume(t),T):62===t&&4===o?(e.consume(t),D):63===t&&3===o?(e.consume(t),M):93===t&&5===o?(e.consume(t),L):!markdownLineEnding(t)||6!==o&&7!==o?null===t||markdownLineEnding(t)?(e.exit("htmlFlowData"),E(t)):(e.consume(t),S):(e.exit("htmlFlowData"),e.check(blankLineBefore,N,E)(t))}function E(t){return e.check(nonLazyContinuationStart,k,N)(t)}function k(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),B}function B(t){return null===t||markdownLineEnding(t)?E(t):(e.enter("htmlFlowData"),S(t))}function P(t){return 45===t?(e.consume(t),M):S(t)}function T(t){return 47===t?(e.consume(t),a="",I):S(t)}function I(t){if(62===t){const n=a.toLowerCase();return htmlRawNames.includes(n)?(e.consume(t),D):S(t)}return asciiAlpha(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),I):S(t)}function L(t){return 93===t?(e.consume(t),M):S(t)}function M(t){return 62===t?(e.consume(t),D):45===t&&2===o?(e.consume(t),M):S(t)}function D(t){return null===t||markdownLineEnding(t)?(e.exit("htmlFlowData"),N(t)):(e.consume(t),D)}function N(n){return e.exit("htmlFlow"),t(n)}}function tokenizeNonLazyContinuationStart(e,t,n){const r=this;return function(t){if(markdownLineEnding(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o;return n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function tokenizeBlankLineBefore(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(blankLine,t,n)}}const htmlText={name:"htmlText",tokenize:tokenizeHtmlText};function tokenizeHtmlText(e,t,n){const r=this;let o,i,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),b):63===t?(e.consume(t),y):asciiAlpha(t)?(e.consume(t),C):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,h):asciiAlpha(t)?(e.consume(t),g):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):markdownLineEnding(t)?(a=u,I(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?T(e):45===e?d(e):u(e)}function h(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?f:h):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),A):markdownLineEnding(t)?(a=f,I(t)):(e.consume(t),f)}function A(t){return 93===t?(e.consume(t),m):f(t)}function m(t){return 62===t?T(t):93===t?(e.consume(t),m):f(t)}function g(t){return null===t||62===t?T(t):markdownLineEnding(t)?(a=g,I(t)):(e.consume(t),g)}function y(t){return null===t?n(t):63===t?(e.consume(t),v):markdownLineEnding(t)?(a=y,I(t)):(e.consume(t),y)}function v(e){return 62===e?T(e):y(e)}function b(t){return asciiAlpha(t)?(e.consume(t),x):n(t)}function x(t){return 45===t||asciiAlphanumeric(t)?(e.consume(t),x):w(t)}function w(t){return markdownLineEnding(t)?(a=w,I(t)):markdownSpace(t)?(e.consume(t),w):T(t)}function C(t){return 45===t||asciiAlphanumeric(t)?(e.consume(t),C):47===t||62===t||markdownLineEndingOrSpace(t)?$(t):n(t)}function $(t){return 47===t?(e.consume(t),T):58===t||95===t||asciiAlpha(t)?(e.consume(t),_):markdownLineEnding(t)?(a=$,I(t)):markdownSpace(t)?(e.consume(t),$):T(t)}function _(t){return 45===t||46===t||58===t||95===t||asciiAlphanumeric(t)?(e.consume(t),_):S(t)}function S(t){return 61===t?(e.consume(t),E):markdownLineEnding(t)?(a=S,I(t)):markdownSpace(t)?(e.consume(t),S):$(t)}function E(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,k):markdownLineEnding(t)?(a=E,I(t)):markdownSpace(t)?(e.consume(t),E):(e.consume(t),B)}function k(t){return t===o?(e.consume(t),o=void 0,P):null===t?n(t):markdownLineEnding(t)?(a=k,I(t)):(e.consume(t),k)}function B(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||markdownLineEndingOrSpace(t)?$(t):(e.consume(t),B)}function P(e){return 47===e||62===e||markdownLineEndingOrSpace(e)?$(e):n(e)}function T(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function I(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),L}function L(t){return markdownSpace(t)?factorySpace(e,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):M(t)}function M(t){return e.enter("htmlTextData"),a(t)}}const labelEnd={name:"labelEnd",resolveAll:resolveAllLabelEnd,resolveTo:resolveToLabelEnd,tokenize:tokenizeLabelEnd},resourceConstruct={tokenize:tokenizeResource},referenceFullConstruct={tokenize:tokenizeReferenceFull},referenceCollapsedConstruct={tokenize:tokenizeReferenceCollapsed};function resolveAllLabelEnd(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&splice(e,0,e.length,n),e}function resolveToLabelEnd(e,t){let n,r,o,i,a=e.length,s=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(o=a);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",l,t],["enter",c,t]],i=push$1(i,e.slice(r+1,r+s+3)),i=push$1(i,[["enter",u,t]]),i=push$1(i,resolveAll(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=push$1(i,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),i=push$1(i,e.slice(o+1)),i=push$1(i,[["exit",l,t]]),splice(e,r,e.length,i),e}function tokenizeLabelEnd(e,t,n){const r=this;let o,i,a=r.events.length;for(;a--;)if(("labelImage"===r.events[a][1].type||"labelLink"===r.events[a][1].type)&&!r.events[a][1]._balanced){o=r.events[a][1];break}return function(t){if(!o)return n(t);if(o._inactive)return u(t);return i=r.parser.defined.includes(normalizeIdentifier(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(resourceConstruct,c,i?c:u)(t):91===t?e.attempt(referenceFullConstruct,c,i?l:u)(t):i?c(t):u(t)}function l(t){return e.attempt(referenceCollapsedConstruct,c,u)(t)}function c(e){return t(e)}function u(e){return o._balanced=!0,n(e)}}function tokenizeResource(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return markdownLineEndingOrSpace(t)?factoryWhitespace(e,o)(t):o(t)}function o(t){return 41===t?c(t):factoryDestination(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return markdownLineEndingOrSpace(t)?factoryWhitespace(e,s)(t):c(t)}function a(e){return n(e)}function s(t){return 34===t||39===t||40===t?factoryTitle(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return markdownLineEndingOrSpace(t)?factoryWhitespace(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}function tokenizeReferenceFull(e,t,n){const r=this;return function(t){return factoryLabel.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(normalizeIdentifier(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}function tokenizeReferenceCollapsed(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}const labelStartImage={name:"labelStartImage",resolveAll:labelEnd.resolveAll,tokenize:tokenizeLabelStartImage};function tokenizeLabelStartImage(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}const labelStartLink={name:"labelStartLink",resolveAll:labelEnd.resolveAll,tokenize:tokenizeLabelStartLink};function tokenizeLabelStartLink(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}const lineEnding={name:"lineEnding",tokenize:tokenizeLineEnding};function tokenizeLineEnding(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),factorySpace(e,t,"linePrefix")}}const thematicBreak={name:"thematicBreak",tokenize:tokenizeThematicBreak};function tokenizeThematicBreak(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),a(i)):o>=3&&(null===i||markdownLineEnding(i))?(e.exit("thematicBreak"),t(i)):n(i)}function a(t){return t===r?(e.consume(t),o++,a):(e.exit("thematicBreakSequence"),markdownSpace(t)?factorySpace(e,i,"whitespace")(t):i(t))}}const list$5={continuation:{tokenize:tokenizeListContinuation},exit:tokenizeListEnd,name:"list",tokenize:tokenizeListStart},listItemPrefixWhitespaceConstruct={partial:!0,tokenize:tokenizeListItemPrefixWhitespace},indentConstruct={partial:!0,tokenize:tokenizeIndent$1};function tokenizeListStart(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,a=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:asciiDigit(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(thematicBreak,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return asciiDigit(t)&&++a<10?(e.consume(t),s):(!r.interrupt||a<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(blankLine,r.interrupt?n:c,e.attempt(listItemPrefixWhitespaceConstruct,d,u))}function c(e){return r.containerState.initialBlankLine=!0,i++,d(e)}function u(t){return markdownSpace(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}function tokenizeListContinuation(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(blankLine,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,factorySpace(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){if(r.containerState.furtherBlankLines||!markdownSpace(n))return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n);return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(indentConstruct,t,o)(n)});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,factorySpace(e,e.attempt(list$5,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function tokenizeIndent$1(e,t,n){const r=this;return factorySpace(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}function tokenizeListEnd(e){e.exit(this.containerState.type)}function tokenizeListItemPrefixWhitespace(e,t,n){const r=this;return factorySpace(e,function(e){const o=r.events[r.events.length-1];return!markdownSpace(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}const setextUnderline={name:"setextUnderline",resolveTo:resolveToSetextUnderline,tokenize:tokenizeSetextUnderline};function resolveToSetextUnderline(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",a,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=a,e.push(["exit",a,t]),e}function tokenizeSetextUnderline(e,t,n){const r=this;let o;return function(t){let a,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){a="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||a))return e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t);return n(t)};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),markdownSpace(t)?factorySpace(e,a,"lineSuffix")(t):a(t))}function a(r){return null===r||markdownLineEnding(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}const indent={tokenize:tokenizeIndent,partial:!0};function gfmFootnote(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:tokenizeDefinitionStart,continuation:{tokenize:tokenizeDefinitionContinuation},exit:gfmFootnoteDefinitionEnd}},text:{91:{name:"gfmFootnoteCall",tokenize:tokenizeGfmFootnoteCall},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:tokenizePotentialGfmFootnoteCall,resolveTo:resolveToPotentialGfmFootnoteCall}}}}function tokenizePotentialGfmFootnoteCall(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;o--;){const e=r.events[o][1];if("labelImage"===e.type){a=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!a||!a._balanced)return n(o);const s=normalizeIdentifier(r.sliceSerialize({start:a.end,end:r.now()}));if(94!==s.codePointAt(0)||!i.includes(s.slice(1)))return n(o);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)}}function resolveToPotentialGfmFootnoteCall(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){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)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function tokenizeGfmFootnoteCall(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(s){if(a>999||93===s&&!i||null===s||91===s||markdownLineEndingOrSpace(s))return n(s);if(93===s){e.exit("chunkString");const i=e.exit("gfmFootnoteCallString");return o.includes(normalizeIdentifier(r.sliceSerialize(i)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return markdownLineEndingOrSpace(s)||(i=!0),a++,e.consume(s),92===s?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,l):l(t)}}function tokenizeDefinitionStart(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!a||null===t||91===t||markdownLineEndingOrSpace(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return i=normalizeIdentifier(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return markdownLineEndingOrSpace(t)||(a=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(i)||o.push(i),factorySpace(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}function tokenizeDefinitionContinuation(e,t,n){return e.check(blankLine,t,e.attempt(indent,t,n))}function gfmFootnoteDefinitionEnd(e){e.exit("gfmFootnoteDefinition")}function tokenizeIndent(e,t,n){const r=this;return factorySpace(e,function(e){const o=r.events[r.events.length-1];return o&&"gfmFootnoteDefinitionIndent"===o[1].type&&4===o[2].sliceSerialize(o[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)}class EditMap{constructor(){this.map=[]}add(e,t,n){addImplementation(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function addImplementation(e,t,n,r){let o=0;if(0!==n||0!==r.length){for(;o<e.map.length;){if(e.map[o][0]===t)return e.map[o][1]+=n,void e.map[o][2].push(...r);o+=1}e.map.push([t,n,r])}}function gfmTableAlign(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if("enter"===o[0])"tableContent"===o[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===o[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===o[1].type)break}else"enter"===o[0]&&"tableDelimiterRow"===o[1].type&&(n=!0);t+=1}return r}function gfmTable$1(){return{flow:{null:{name:"table",tokenize:tokenizeTable,resolveAll:resolveTable}}}}function tokenizeTable(e,t,n){const r=this;let o,i=0,a=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const o=t>-1?r.events[t][1].type:null,i="tableHead"===o||"tableRow"===o?b:s;if(i===b&&r.parser.lazy[r.now().line])return n(e);return i(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return l(e);return o=!0,a+=1,l(e)}(t)}function l(t){return null===t?n(t):markdownLineEnding(t)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):markdownSpace(t)?factorySpace(e,l,"whitespace")(t):(a+=1,o&&(o=!1,i+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),o=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||markdownLineEndingOrSpace(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),o=!1,markdownSpace(t)?factorySpace(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t))}function p(t){return 45===t||58===t?f(t):124===t?(o=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):v(t)}function h(t){return markdownSpace(t)?factorySpace(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),A):45===t?(a+=1,A(t)):null===t||markdownLineEnding(t)?y(t):v(t)}function A(t){return 45===t?(e.enter("tableDelimiterFiller"),m(t)):v(t)}function m(t){return 45===t?(e.consume(t),m):58===t?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(t))}function g(t){return markdownSpace(t)?factorySpace(e,y,"whitespace")(t):y(t)}function y(n){return 124===n?p(n):(null===n||markdownLineEnding(n))&&o&&i===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):v(n)}function v(e){return n(e)}function b(t){return e.enter("tableRow"),x(t)}function x(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),x):null===n||markdownLineEnding(n)?(e.exit("tableRow"),t(n)):markdownSpace(n)?factorySpace(e,x,"whitespace")(n):(e.enter("data"),w(n))}function w(t){return null===t||124===t||markdownLineEndingOrSpace(t)?(e.exit("data"),x(t)):(e.consume(t),92===t?C:w)}function C(t){return 92===t||124===t?(e.consume(t),w):w(t)}}function resolveTable(e,t){let n,r,o,i=-1,a=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const p=new EditMap;for(;++i<e.length;){const h=e[i],f=h[1];"enter"===h[0]?"tableHead"===f.type?(u=!1,0!==d&&(flushTableEnd(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(i,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(a=!0,o=void 0,l=[0,0,0,0],c=[0,i+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(i,0,[["enter",r,t]])),s="tableDelimiterRow"===f.type?2:r?3:1):!s||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type?"tableCellDivider"===f.type&&(a?a=!1:(0!==l[1]&&(c[0]=c[1],o=flushCell(p,t,l,s,void 0,o)),l=c,c=[l[1],i,0,0])):(a=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],o=flushCell(p,t,l,s,void 0,o),l=[0,0,0,0]),c[2]=i)):"tableHead"===f.type?(u=!0,d=i):"tableRow"===f.type||"tableDelimiterRow"===f.type?(d=i,0!==l[1]?(c[0]=c[1],o=flushCell(p,t,l,s,i,o)):0!==c[1]&&(o=flushCell(p,t,c,s,i,o)),s=0):!s||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type||(c[3]=i)}for(0!==d&&flushTableEnd(p,t,d,n,r),p.consume(t.events),i=-1;++i<t.events.length;){const e=t.events[i];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=gfmTableAlign(t.events,i))}return e}function flushCell(e,t,n,r,o,i){const a=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(i.end=Object.assign({},getPoint(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const s=getPoint(t.events,n[1]);if(i={type:a,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",i,t]]),0!==n[2]){const o=getPoint(t.events,n[2]),i=getPoint(t.events,n[3]),a={type:"tableContent",start:Object.assign({},o),end:Object.assign({},i)};if(e.add(n[2],0,[["enter",a,t]]),2!==r){const r=t.events[n[2]],o=t.events[n[3]];if(r[1].end=Object.assign({},o[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==o&&(i.end=Object.assign({},getPoint(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function flushTableEnd(e,t,n,r,o){const i=[],a=getPoint(t.events,n);o&&(o.end=Object.assign({},a),i.push(["exit",o,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function getPoint(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const mathFlow={tokenize:tokenizeMathFenced,concrete:!0,name:"mathFlow"},nonLazyContinuation={tokenize:tokenizeNonLazyContinuation,partial:!0};function tokenizeMathFenced(e,t,n){const r=this,o=r.events[r.events.length-1],i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0;let a=0;return function(t){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),s(t)};function s(t){return 36===t?(e.consume(t),a++,s):a<2?n(t):(e.exit("mathFlowFenceSequence"),factorySpace(e,l,"whitespace")(t))}function l(t){return null===t||markdownLineEnding(t)?u(t):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return null===t||markdownLineEnding(t)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),u(t)):36===t?n(t):(e.consume(t),c)}function u(n){return e.exit("mathFlowFence"),r.interrupt?t(n):e.attempt(nonLazyContinuation,d,A)(n)}function d(t){return e.attempt({tokenize:m,partial:!0},A,p)(t)}function p(t){return(i?factorySpace(e,h,"linePrefix",i+1):h)(t)}function h(t){return null===t?A(t):markdownLineEnding(t)?e.attempt(nonLazyContinuation,d,A)(t):(e.enter("mathFlowValue"),f(t))}function f(t){return null===t||markdownLineEnding(t)?(e.exit("mathFlowValue"),h(t)):(e.consume(t),f)}function A(n){return e.exit("mathFlow"),t(n)}function m(e,t,n){let o=0;return factorySpace(e,function(t){return e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),i(t)},"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function i(t){return 36===t?(o++,e.consume(t),i):o<a?n(t):(e.exit("mathFlowFenceSequence"),factorySpace(e,s,"whitespace")(t))}function s(r){return null===r||markdownLineEnding(r)?(e.exit("mathFlowFence"),t(r)):n(r)}}}function tokenizeNonLazyContinuation(e,t,n){const r=this;return function(n){if(null===n)return t(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function mathText(e){let t={}.singleDollarTextMath;return null==t&&(t=!0),{tokenize:function(e,n,r){let o,i,a=0;return function(t){return e.enter("mathText"),e.enter("mathTextSequence"),s(t)};function s(n){return 36===n?(e.consume(n),a++,s):a<2&&!t?r(n):(e.exit("mathTextSequence"),l(n))}function l(t){return null===t?r(t):36===t?(i=e.enter("mathTextSequence"),o=0,u(t)):32===t?(e.enter("space"),e.consume(t),e.exit("space"),l):markdownLineEnding(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):(e.enter("mathTextData"),c(t))}function c(t){return null===t||32===t||36===t||markdownLineEnding(t)?(e.exit("mathTextData"),l(t)):(e.consume(t),c)}function u(t){return 36===t?(e.consume(t),o++,u):o===a?(e.exit("mathTextSequence"),e.exit("mathText"),n(t)):(i.type="mathTextData",c(t))}},resolve:resolveMathText,previous:previous,name:"mathText"}}function resolveMathText(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("mathTextData"===e[t][1].type){e[r][1].type="mathTextPadding",e[o][1].type="mathTextPadding",o+=2,r-=2;break}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="mathTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e}function previous(e){return 36!==e||"characterEscape"===this.events[this.events.length-1][1].type}function math(e){return{flow:{36:mathFlow},text:{36:mathText()}}}const hasOwnProperty$1={}.hasOwnProperty;function combineExtensions(e){const t={};let n=-1;for(;++n<e.length;)syntaxExtension(t,e[n]);return t}function syntaxExtension(e,t){let n;for(n in t){const r=(hasOwnProperty$1.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){hasOwnProperty$1.call(r,i)||(r[i]=[]);const e=o[i];constructs(r[i],Array.isArray(e)?e:e?[e]:[])}}}function constructs(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);splice(e,0,0,r)}const content={tokenize:initializeContent};function initializeContent(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),factorySpace(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):markdownLineEnding(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}const document$3={tokenize:initializeDocument},containerConstruct={tokenize:tokenizeContainer};function initializeDocument(e){const t=this,n=[];let r,o,i,a=0;return s;function s(r){if(a<n.length){const o=n[a];return t.containerState=o[1],e.attempt(o[0].continuation,l,c)(r)}return c(r)}function l(e){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&y();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}g(a);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return splice(t.events,i+1,0,t.events.slice(n)),t.events.length=s,c(e)}return s(e)}function c(o){if(a===n.length){if(!r)return p(o);if(r.currentConstruct&&r.currentConstruct.concrete)return f(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(containerConstruct,u,d)(o)}function u(e){return r&&y(),g(a),p(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,i=t.now().offset,f(e)}function p(n){return t.containerState={},e.attempt(containerConstruct,h,f)(n)}function h(e){return a++,n.push([t.currentConstruct,t.containerState]),p(e)}function f(n){return null===n?(r&&y(),g(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),A(n))}function A(n){return null===n?(m(e.exit("chunkFlow"),!0),g(0),void e.consume(n)):markdownLineEnding(n)?(e.consume(n),m(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),A)}function m(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){s=t.events[l][1].end;break}o=!0}for(g(a),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;splice(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function g(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function y(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function tokenizeContainer(e,t,n){return factorySpace(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const flow$1={tokenize:initializeFlow};function initializeFlow(e){const t=this,n=e.attempt(blankLine,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,factorySpace(e,e.attempt(this.parser.constructs.flow,r,e.attempt(content$1,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}const resolver={resolveAll:createResolver()},string$1=initializeFactory("string"),text$2=initializeFactory("text");function initializeFactory(e){return{resolveAll:createResolver("text"===e?resolveAllLineSuffixes:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,a);return i;function i(e){return l(e)?o(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function createResolver(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function resolveAllLineSuffixes(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,a=o.length,s=-1,l=0;for(;a--;){const e=o[a];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)l++,s--;if(s)break;s=-1}else if(-2===e)i=!0,l++;else if(-1!==e){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const o={type:n===e.length||i||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const document$2={42:list$5,43:list$5,45:list$5,48:list$5,49:list$5,50:list$5,51:list$5,52:list$5,53:list$5,54:list$5,55:list$5,56:list$5,57:list$5,62:blockQuote},contentInitial={91:definition},flowInitial={[-2]:codeIndented,[-1]:codeIndented,32:codeIndented},flow={35:headingAtx,42:thematicBreak,45:[setextUnderline,thematicBreak],60:htmlFlow,61:setextUnderline,95:thematicBreak,96:codeFenced,126:codeFenced},string={38:characterReference,92:characterEscape},text$1={[-5]:lineEnding,[-4]:lineEnding,[-3]:lineEnding,33:labelStartImage,38:characterReference,42:attention,60:[autolink$2,htmlText],91:labelStartLink,92:[hardBreakEscape,characterEscape],93:labelEnd,95:attention,96:codeText},insideSpan={null:[attention,resolver]},attentionMarkers={null:[42,95]},disable={null:[]},defaultConstructs=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:attentionMarkers,contentInitial:contentInitial,disable:disable,document:document$2,flow:flow,flowInitial:flowInitial,insideSpan:insideSpan,string:string,text:text$1},Symbol.toStringTag,{value:"Module"}));function createTokenizer(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 o={},i=[];let a=[],s=[];const l={attempt:m(function(e,t){g(e,t.from)}),check:m(A),consume:function(e){markdownLineEnding(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,y()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));c.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=p(),c.events.push(["enter",n,c]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=p(),c.events.push(["exit",t,c]),t},interrupt:m(A,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,y()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return serializeChunks(d(e),t)},sliceStream:d,write:function(e){if(a=push$1(a,e),h(),null!==a[a.length-1])return[];return g(t,0),c.events=resolveAll(i,c.events,c),c.events}};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(e){return sliceChunks(a,e)}function p(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function h(){let e;for(;r._index<a.length;){const t=a[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)f(t.charCodeAt(r._bufferIndex));else f(t)}}function f(e){u=u(e)}function A(e,t){t.restore()}function m(e,t){return function(n,o,i){let a,u,d,h;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function f(e){return a=e,u=0,0===e.length?i:A(e[u])}function A(e){return function(n){h=function(){const e=p(),t=c.previous,n=c.currentConstruct,o=c.events.length,i=Array.from(s);return{from:o,restore:a};function a(){r=e,c.previous=t,c.currentConstruct=n,c.events.length=o,s=i,y()}}(),d=e,e.partial||(c.currentConstruct=e);if(e.name&&c.parser.constructs.disable.null.includes(e.name))return g();return e.tokenize.call(t?Object.assign(Object.create(c),t):c,l,m,g)(n)}}function m(t){return e(d,h),o}function g(e){return h.restore(),++u<a.length?A(a[u]):i}}}function g(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&splice(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function y(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function sliceChunks(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const e=a[0];"string"==typeof e?a[0]=e.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}function serializeChunks(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if("string"==typeof i)a=i;else switch(i){case-5:a="\r";break;case-4:a="\n";break;case-3:a="\r\n";break;case-2:a=t?" ":"\t";break;case-1:if(!t&&o)continue;a=" ";break;default:a=String.fromCharCode(i)}o=-2===i,r.push(a)}return r.join("")}function parse$9(e){const t={constructs:combineExtensions([defaultConstructs,...(e||{}).extensions||[]]),content:n(content),defined:[],document:n(document$3),flow:n(flow$1),lazy:{},string:n(string$1),text:n(text$2)};return t;function n(e){return function(n){return createTokenizer(t,e,n)}}}function postprocess(e){for(;!subtokenize(e););return e}const search=/[\0\t\n\r]/g;function preprocess(){let e,t=1,n="",r=!0;return function(o,i,a){const s=[];let l,c,u,d,p;o=n+("string"==typeof o?o.toString():new TextDecoder(i||void 0).decode(o)),u=0,n="",r&&(65279===o.charCodeAt(0)&&u++,r=void 0);for(;u<o.length;){if(search.lastIndex=u,l=search.exec(o),d=l&&void 0!==l.index?l.index:o.length,p=o.charCodeAt(d),!l){n=o.slice(u);break}if(10===p&&u===d&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),u<d&&(s.push(o.slice(u,d)),t+=d-u),p){case 0:s.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),s.push(-2);t++<c;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}u=d+1}a&&(e&&s.push(-5),n&&s.push(n),s.push(null));return s}}var sharedExports=requireShared();function getText$1(e,t){return e.slice(t.start.offset,t.end.offset)}function getEvents$1(e,t={}){const n=[directive(),gfmAutolinkLiteral(),gfmFootnote(),gfmTable$1(),math(),...t.extensions||[]],r=[],o=labelEnd.tokenize;try{labelEnd.tokenize=function(t,n,i){const a=this,s=a.events;return o.call(a,t,n,t=>{let n=s.length;for(;--n>=0;){const e=s[n],[t,r]=e;if("enter"===t){const{type:e}=r;if("labelImage"===e||"labelLink"===e)break}}if(n>=0){const t=s[n],[,o]=t,i=s[s.length-1],[,l]=i,c={type:"undefinedReferenceShortcut",start:o.start,end:l.end},u={type:"undefinedReference",start:o.start,end:l.end},d=s.slice(n).filter(e=>{const[,t]=e,{type:n}=t;return"data"===n||"lineEnding"===n}),p=r.length>0&&r[r.length-1][0],h=p&&p[1];h&&h.end.line===c.start.line&&h.end.column===c.start.column&&(0===d.length?(h.type="undefinedReferenceCollapsed",h.end=l.end):(c.type="undefinedReferenceFull",c.start=h.start,r.pop()));const f=d.filter(e=>"enter"===e[0]).map(t=>getText$1(e,t[1])).join("").trim();if(f.length>0&&!f.includes("]")){const e=[];e.push(["enter",c,a],["enter",u,a]);for(const t of d){const[n,r]=t;e.push([n,{...r},a])}e.push(["exit",u,a],["exit",c,a]),r.push(e)}}return i(t)})};const i=void 0,a=!0,s=parse$9({...t,extensions:n}),l=preprocess()(e,i,a);return postprocess(s.document().write(l)).concat(...r)}finally{labelEnd.tokenize=o}}function parseInternal(e,t={},n={},r=0,o=void 0){const i=Boolean(t.freezeTokens),a=getEvents$1(e,n),s=[];let l=[];const c={type:"data",startLine:-1,startColumn:-1,endLine:-1,endColumn:-1,text:"ROOT",children:s,parent:null},u=[c];let d=c,p=null,h=null,f=!1;for(const A of a){const[a,s]=A,{type:m,start:g,end:y}=s,{column:v,line:b}=g,{column:x,line:w}=y,C=getText$1(e,s);if("enter"!==a||f)"exit"===a&&("htmlFlow"===m&&(f=!1),f||(i&&(Object.freeze(d.children),Object.freeze(d)),d=u.pop()));else{const i=d;if(u.push(i),d={type:m,startLine:b+r,startColumn:v,endLine:w+r,endColumn:x,text:C,children:[],parent:i===c?o||null:i},o&&Object.defineProperty(d,sharedExports.htmlFlowSymbol,{value:!0}),i.children.push(d),l.push(d),"htmlFlow"===d.type&&!micromarkHelpersExports.isHtmlFlowComment(d)){f=!0,p&&h||(p={...n,extensions:[{disable:{null:["codeIndented","htmlFlow"]}}]},h=e.split(sharedExports.newLineRe));const r=parseInternal(h.slice(d.startLine-1,d.endLine).join("\n"),t,p,d.startLine-1,d);d.children=r,l=l.concat(r[sharedExports.flatTokensSymbol])}}}return Object.defineProperty(s,sharedExports.flatTokensSymbol,{value:l}),i&&Object.freeze(s),s}function parse$8(e,t){return parseInternal(e,t)}const ignoredChildTypes=new Set(["codeFencedFence","definition","reference","resource"]),md044={names:["MD044","proper-names"],description:"Proper names should have the correct capitalization",tags:["spelling"],parser:"micromark",function:function(e,t){let n=e.config.names;if(n=Array.isArray(n)?n:[],n.sort((e,t)=>t.length-e.length||e.localeCompare(t)),0===n.length)return;const r=e.config.code_blocks,o=void 0===r||!!r,i=e.config.html_elements,a=void 0===i||!!i,s=new Set(["data"]);o&&(s.add("codeFlowValue"),s.add("codeTextData")),a&&(s.add("htmlFlowData"),s.add("htmlTextData"));const l=micromarkHelpersExports.filterByPredicate(e.parsers.micromark.tokens,e=>s.has(e.type),e=>e.children.filter(e=>!ignoredChildTypes.has(e.type))),c=[],u=new Set;for(const d of n){const e=helpersExports.escapeForRegExp(d),r=/^\W/.test(d)?"":"\\b_*",o=/\W$/.test(d)?"":"_*\\b",i=new RegExp(`(${r})(${e})${o}`,"gi");for(const a of l){let e=null;for(;null!==(e=i.exec(a.text));){const[,r,o]=e,i=a.startColumn+e.index+r.length,s=o.length,l=a.startLine,p={startLine:l,startColumn:i,endLine:l,endColumn:i+s-1};if(!n.includes(o)&&!c.some(e=>helpersExports.hasOverlap(e,p))){let e=[];u.has(a)||(e=micromarkHelpersExports.filterByTypes(parse$8(a.text),["literalAutolink"]).map(e=>({startLine:l,startColumn:a.startColumn+e.startColumn-1,endLine:l,endColumn:a.endColumn+e.endColumn-1})),c.push(...e),u.add(a)),e.some(e=>helpersExports.hasOverlap(e,p))||helpersExports.addErrorDetailIf(t,a.startLine,d,o,void 0,void 0,[i,s],{editColumn:i,deleteCount:s,insertText:d})}c.push(p)}}}}},altRe=helpersExports.getHtmlAttributeRe("alt"),ariaHiddenRe=helpersExports.getHtmlAttributeRe("aria-hidden"),md045={names:["MD045","no-alt-text"],description:"Images should have alternate text (alt text)",tags:["accessibility","images"],parser:"micromark",function:function(e,t){var n;const r=filterByTypesCached(["image"]);for(const i of r){if(micromarkHelpersExports.getDescendantsByType(i,["label","labelText"]).some(e=>0===e.text.length)){const e=i.startLine===i.endLine?[i.startColumn,i.endColumn-i.startColumn]:void 0;helpersExports.addError(t,i.startLine,void 0,void 0,e)}}const o=filterByTypesCached(["htmlText"],!0);for(const i of o){const{startColumn:e,startLine:r,text:o}=i,a=micromarkHelpersExports.getHtmlTagInfo(i);if(a&&!a.close&&"img"===a.name.toLowerCase()&&!altRe.test(o)&&"true"!==(null==(n=ariaHiddenRe.exec(o))?void 0:n[1].toLowerCase())){const n=[e,o.replace(helpersExports.nextLinesRe,"").length];helpersExports.addError(t,r,void 0,void 0,n)}}}},tokenTypeToStyle={codeFenced:"fenced",codeIndented:"indented"},md046={names:["MD046","code-block-style"],description:"Code block style",tags:["code"],parser:"micromark",function:function(e,t){let n=String(e.config.style||"consistent");for(const r of filterByTypesCached(["codeFenced","codeIndented"])){const{startLine:e,type:o}=r;"consistent"===n&&(n=tokenTypeToStyle[o]),helpersExports.addErrorDetailIf(t,e,n,tokenTypeToStyle[o])}}},md047={names:["MD047","single-trailing-newline"],description:"Files should end with a single newline character",tags:["blank_lines"],parser:"none",function:function(e,t){const n=e.lines.length,r=e.lines[n-1];helpersExports.isBlankLine(r)||helpersExports.addError(t,n,void 0,void 0,[r.length,1],{insertText:"\n",editColumn:r.length+1})}};function fencedCodeBlockStyleFor(e){return"~"===e[0]?"tilde":"backtick"}const md048={names:["MD048","code-fence-style"],description:"Code fence style",tags:["code"],parser:"micromark",function:function(e,t){let n=String(e.config.style||"consistent");const r=filterByTypesCached(["codeFenced"]);for(const o of r){const e=micromarkHelpersExports.getDescendantsByType(o,["codeFencedFence","codeFencedFenceSequence"])[0],{startLine:r,text:i}=e;"consistent"===n&&(n=fencedCodeBlockStyleFor(i)),helpersExports.addErrorDetailIf(t,r,n,fencedCodeBlockStyleFor(i))}}},intrawordRe=/^\w$/;function emphasisOrStrongStyleFor(e){return"*"===e[0]?"asterisk":"underscore"}const impl=(e,t,n,r,o,i,a="consistent")=>{const{lines:s,parsers:l}=e,c=micromarkHelpersExports.filterByPredicate(l.micromark.tokens,e=>e.type===n,e=>"htmlFlow"===e.type?[]:e.children);for(const u of c){const e=micromarkHelpersExports.getDescendantsByType(u,[r]),n=e[0],l=e[e.length-1];if(n&&l){const e=emphasisOrStrongStyleFor(n.text);if("consistent"===a&&(a=e),a!==e){if(!("underscore"===a&&(intrawordRe.test(s[n.startLine-1][n.startColumn-2])||intrawordRe.test(s[l.endLine-1][l.endColumn-1]))))for(const r of[n,l])helpersExports.addError(t,r.startLine,`Expected: ${a}; Actual: ${e}`,void 0,[r.startColumn,r.text.length],{editColumn:r.startColumn,deleteCount:r.text.length,insertText:"asterisk"===a?o:i})}}}},md049md050=[{names:["MD049","emphasis-style"],description:"Emphasis style",tags:["emphasis"],parser:"micromark",function:function(e,t){return impl(e,t,"emphasis","emphasisSequence","*","_",e.config.style||void 0)}},{names:["MD050","strong-style"],description:"Strong style",tags:["emphasis"],parser:"micromark",function:function(e,t){return impl(e,t,"strong","strongSequence","**","__",e.config.style||void 0)}}],idRe=helpersExports.getHtmlAttributeRe("id"),nameRe=helpersExports.getHtmlAttributeRe("name"),anchorRe=/\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu,lineFragmentRe=/^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/,childrenExclude=new Set(["image","reference","resource"]),tokensInclude=new Set(["characterEscapeValue","codeTextData","data","mathTextData"]);function convertHeadingToHTMLFragment(e){const t=micromarkHelpersExports.filterByPredicate(e.children,e=>tokensInclude.has(e.type),e=>childrenExclude.has(e.type)?[]:e.children).map(e=>e.text).join("");return"#"+encodeURIComponent(t.toLowerCase().replace(/[^\p{Letter}\p{Mark}\p{Number}\p{Connector_Punctuation}\- ]/gu,"").replace(/ /gu,"-"))}function unescapeStringTokenText(e){return micromarkHelpersExports.filterByTypes(e.children,["characterEscapeValue","data"]).map(e=>e.text).join("")}const md051={names:["MD051","link-fragments"],description:"Link fragments should be valid",tags:["links"],parser:"micromark",function:function(e,t){const n=e.config.ignore_case||!1,r=e.config.ignored_pattern||"",o=new RegExp(r||"^$"),i=new Map([["#top",0]]),a=filterByTypesCached(["atxHeadingText","setextHeadingText"]);for(const l of a){const e=convertHeadingToHTMLFragment(l);if("#"!==e){const t=i.get(e)||0;t&&i.set(`${e}-${t}`,0),i.set(e,t+1);let n=null;for(;null!==(n=anchorRe.exec(l.text));){const[,e]=n;i.has(e)||i.set(e,1)}}}for(const l of filterByTypesCached(["htmlText"],!0)){const e=micromarkHelpersExports.getHtmlTagInfo(l);if(e&&!e.close){const t=idRe.exec(l.text)||"a"===e.name.toLowerCase()&&nameRe.exec(l.text);t&&t.length>0&&i.set(`#${t[1]}`,0)}}const s=[["link","resourceDestinationString"],["definition","definitionDestinationString"]];for(const[l,c]of s){const e=filterByTypesCached([l]).filter(e=>{var t;return!("atxHeadingText"===(null==(t=e.parent)?void 0:t.type)&µmarkHelpersExports.isDocfxTab(e.parent.parent))});for(const r of e){const e=micromarkHelpersExports.filterByTypes(r.children,[c]);for(const a of e){const{endColumn:e,startColumn:s}=a,l=unescapeStringTokenText(a),c=l.slice(1),u=`#${encodeURIComponent(c)}`;if(l.length>1&&l.startsWith("#")&&!i.has(u)&&!lineFragmentRe.test(u)&&!o.test(c)){let o,a,c;r.startLine===r.endLine&&(o=r.text,a=[r.startColumn,r.endColumn-r.startColumn],c={editColumn:s,deleteCount:e-s});const u=l.toLowerCase(),d=[...i.keys()].find(e=>u===e.toLowerCase());d?((c||{}).insertText=d,n||d===l||helpersExports.addError(t,r.startLine,`Expected: ${d}; Actual: ${l}`,o,a,c)):helpersExports.addError(t,r.startLine,void 0,o,a)}}}}}},md052={names:["MD052","reference-links-images"],description:"Reference links and images should use a label that is defined",tags:["images","links"],parser:"none",function:function(e,t){const{config:n,lines:r}=e,o=n.shortcut_syntax||!1,i=new Set(n.ignored_labels||["x"]),{definitions:a,references:s,shortcuts:l}=getReferenceLinkImageData(),c=o?[...s.entries(),...l.entries()]:s.entries();for(const u of c){const[e,n]=u;if(!a.has(e)&&!i.has(e))for(const o of n){const[n,i,a]=o,s=r[n].slice(i,i+a);helpersExports.addError(t,n+1,`Missing link or image reference definition: "${e}"`,s,[i+1,s.length])}}}},linkReferenceDefinitionRe=/^ {0,3}\[([^\]]*[^\\])\]:/,md053={names:["MD053","link-image-reference-definitions"],description:"Link and image reference definitions should be needed",tags:["images","links"],parser:"none",function:function(e,t){const n=new Set(e.config.ignored_definitions||["//"]),r=e.lines,{references:o,shortcuts:i,definitions:a,duplicateDefinitions:s}=getReferenceLinkImageData(),l=e=>e.replace(linkReferenceDefinitionRe,"").trim().length>0,c={deleteCount:-1};for(const u of a.entries()){const[e,[a]]=u;if(!n.has(e)&&!o.has(e)&&!i.has(e)){const n=r[a];helpersExports.addError(t,a+1,`Unused link or image reference definition: "${e}"`,helpersExports.ellipsify(n),[1,n.length],l(n)?c:void 0)}}for(const u of s){const[e,o]=u;if(!n.has(e)){const n=r[o];helpersExports.addError(t,o+1,`Duplicate link or image reference definition: "${e}"`,helpersExports.ellipsify(n),[1,n.length],l(n)?c:void 0)}}}},backslashEscapeRe=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,removeBackslashEscapes=e=>e.replace(backslashEscapeRe,"$1"),autolinkDisallowedRe=/[ <>]/,autolinkAble=e=>{try{new URL(e)}catch{return!1}return!autolinkDisallowedRe.test(e)},md054={names:["MD054","link-image-style"],description:"Link and image style",tags:["images","links"],parser:"micromark",function:(e,t)=>{var n,r,o,i;const a=e.config,s=void 0===a.autolink||!!a.autolink,l=void 0===a.inline||!!a.inline,c=void 0===a.full||!!a.full,u=void 0===a.collapsed||!!a.collapsed,d=void 0===a.shortcut||!!a.shortcut,p=void 0===a.url_inline||!!a.url_inline;if(s&&l&&c&&u&&d&&p)return;const{definitions:h}=getReferenceLinkImageData(),f=filterByTypesCached(["autolink","image","link"]);for(const A of f){let e=null,a=null;const{endColumn:f,endLine:m,startColumn:g,startLine:y,text:v,type:b}=A,x="image"===b;let w=!1;if("autolink"===b)a=null==(n=micromarkHelpersExports.getDescendantsByType(A,[["autolinkEmail","autolinkProtocol"]])[0])?void 0:n.text,e=a,w=!s&&Boolean(a);else if(e=micromarkHelpersExports.getDescendantsByType(A,["label","labelText"])[0].text,a=null==(r=micromarkHelpersExports.getDescendantsByType(A,["resource","resourceDestination",["resourceDestinationLiteral","resourceDestinationRaw"],"resourceDestinationString"])[0])?void 0:r.text,a){const t=null==(o=micromarkHelpersExports.getDescendantsByType(A,["resource","resourceTitle","resourceTitleString"])[0])?void 0:o.text;w=!l||!p&&s&&!x&&!t&&e===a&&autolinkAble(a)}else{const t=0===micromarkHelpersExports.getDescendantsByType(A,["reference"]).length,n=null==(i=micromarkHelpersExports.getDescendantsByType(A,["reference","referenceString"])[0])?void 0:i.text,r=void 0===n,o=h.get(n||e);a=o&&o[1],w=a&&(t?!d:r?!u:!c)}if(w){let n,r;if(y===m){n=[g,f-g];let t=null;const o=l&&e,i=s&&!x&&autolinkAble(a);if(!o||!p&&i)i&&(t=`<${removeBackslashEscapes(a)}>`);else{t=`${x?"!":""}[${e.replace(/[[\]]/g,"\\$&")}](${a.replace(/[()]/g,"\\$&")})`}t&&(r={editColumn:n[0],insertText:t,deleteCount:n[1]})}helpersExports.addErrorContext(t,y,v.replace(helpersExports.nextLinesRe,""),void 0,void 0,n,r)}}}},whitespaceTypes=new Set(["linePrefix","whitespace"]),ignoreWhitespace=e=>e.filter(e=>!whitespaceTypes.has(e.type)),firstOrNothing=e=>e[0],lastOrNothing=e=>e[e.length-1],makeRange$1=(e,t)=>[e,t-e+1],md055={names:["MD055","table-pipe-style"],description:"Table pipe style",tags:["table"],parser:"micromark",function:function(e,t){let n=String(e.config.style||"consistent"),r="no_leading_or_trailing"!==n&&"trailing_only"!==n,o="no_leading_or_trailing"!==n&&"leading_only"!==n;const i=filterByTypesCached(["tableDelimiterRow","tableRow"]);for(const a of i){const e=firstOrNothing(a.children),i="tableCellDivider"===firstOrNothing(ignoreWhitespace(e.children)).type,s=lastOrNothing(a.children),l="tableCellDivider"===lastOrNothing(ignoreWhitespace(s.children)).type,c=i?l?"leading_and_trailing":"leading_only":l?"trailing_only":"no_leading_or_trailing";"consistent"===n&&(n=c,r=i,o=l),i!==r&&helpersExports.addErrorDetailIf(t,e.startLine,n,c,(r?"Missing":"Unexpected")+" leading pipe",void 0,makeRange$1(a.startColumn,e.startColumn)),l!==o&&helpersExports.addErrorDetailIf(t,s.endLine,n,c,(o?"Missing":"Unexpected")+" trailing pipe",void 0,makeRange$1(s.endColumn-1,a.endColumn-1))}}},makeRange=(e,t)=>[e,t-e+1],md056={names:["MD056","table-column-count"],description:"Table column count",tags:["table"],parser:"micromark",function:function(e,t){const n=filterByTypesCached(["tableDelimiterRow","tableRow"]);let r=0,o=null;for(const i of n){const e=micromarkHelpersExports.getParentOfType(i,["table"]);o!==e&&(r=0,o=e);const n=i.children.filter(e=>["tableData","tableDelimiter","tableHeader"].includes(e.type)),a=n.length;let s,l;r||=a,a<r?(s="Too few cells, row will be missing data",l=[i.endColumn-1,1]):r<a&&(s="Too many cells, extra data will be missing",l=makeRange(n[r].startColumn,i.endColumn-1)),helpersExports.addErrorDetailIf(t,i.endLine,r,a,s,void 0,l)}}},md058={names:["MD058","blanks-around-tables"],description:"Tables should be surrounded by blank lines",tags:["table"],parser:"micromark",function:function(e,t){const{lines:n}=e,r=filterByTypesCached(["blockQuotePrefix","linePrefix"]),o=filterByTypesCached(["table"]);for(const i of o){const e=i.startLine;helpersExports.isBlankLine(n[e-2])||helpersExports.addErrorContext(t,e,n[e-1].trim(),void 0,void 0,void 0,{insertText:micromarkHelpersExports.getBlockQuotePrefixText(r,e)});const o=i.endLine;helpersExports.isBlankLine(n[o])||helpersExports.addErrorContext(t,o,n[o-1].trim(),void 0,void 0,void 0,{lineNumber:o+1,insertText:micromarkHelpersExports.getBlockQuotePrefixText(r,o)})}}},allowedChildrenTypes=new Set(["codeText","htmlText"]),defaultProhibitedTexts=["click here","here","link","more"];function normalize$1(e){return e.replace(/[\W_]+/g," ").replace(/\s+/g," ").toLowerCase().trim()}const md059={names:["MD059","descriptive-link-text"],description:"Link text should be descriptive",tags:["accessibility","links"],parser:"micromark",function:function(e,t){const n=new Set((e.config.prohibited_texts||defaultProhibitedTexts).map(normalize$1));if(n.size>0){const e=filterByTypesCached(["link"]);for(const r of e){const e=micromarkHelpersExports.getDescendantsByType(r,["label","labelText"]);for(const r of e){const{children:e,endColumn:o,endLine:i,parent:a,startColumn:s,startLine:l,text:c}=r;if(!e.some(e=>allowedChildrenTypes.has(e.type))&&n.has(normalize$1(c))){const e=l===i?[s,o-s]:void 0;helpersExports.addErrorContext(t,l,a.text,void 0,void 0,e)}}}}}},[md019,md021]=md019md021,[md049,md050]=md049md050,rules=[md001,md003,md004,md005,md007,md009,md010,md011,md012,md013,md014,md018,md019,md020,md021,md022,md023,md024,md025,md026,md027,md028,md029,md030,md031,md032,md033,md034,md035,md036,md037,md038,md039,md040,md041,md042,md043,md044,md045,md046,md047,md048,md049,md050,md051,md052,md053,md054,md055,md056,md058,md059];for(const Wp of rules){const e=Wp.names[0].toLowerCase();Wp.information=new URL(`${homepage}/blob/v${version}/doc/${e}.md`)}function parseConfiguration(e,t,n){let r=null,o=null;const i=[];let a=0;return(n||[JSON.parse]).every(e=>{try{const n=e(t);return r=n&&"object"==typeof n&&!Array.isArray(n)?n:{},!1}catch(n){i.push(`Parser ${a++}: ${n.message}`)}return!0})&&(i.unshift(`Unable to parse '${e}'`),o=i.join("; ")),{config:r,message:o}}function validateRuleList(e,t){let n=null;if(e.length===rules.length)return n;const r={};for(const[o,i]of e.entries()){let e=function(e,n){return new Error(`Property '${e}' of custom rule at index ${t} is incorrect: '${n}'.`)};const t=o-rules.length;for(const r of["names","tags"]){const t=i[r];n||t&&Array.isArray(t)&&0!==t.length&&t.every(helpersExports.isString)&&!t.some(helpersExports.isEmptyString)||(n=e(r,t))}for(const r of[["description","string"],["function","function"]]){const t=r[0],o=i[t];n||o&&typeof o===r[1]||(n=e(t,o))}if(n||void 0===i.parser||"markdownit"===i.parser||"micromark"===i.parser||"none"===i.parser||(n=e("parser",i.parser)),n||!i.information||helpersExports.isUrl(i.information)||(n=e("information",i.information)),n||void 0===i.asynchronous||"boolean"==typeof i.asynchronous||(n=e("asynchronous",i.asynchronous)),!n&&i.asynchronous,!n){for(const e of i.names){const o=e.toUpperCase();n||void 0===r[o]||(n=new Error("Name '"+e+"' of custom rule at index "+t+" is already used as a name or tag.")),r[o]=!0}for(const e of i.tags){const o=e.toUpperCase();!n&&r[o]&&(n=new Error("Tag '"+e+"' of custom rule at index "+t+" is already used as a name.")),r[o]=!1}}}return n}function newResults(e){const t={};return Object.defineProperty(t,"toString",{value:function(n){let r=null;const o=[],i=Object.keys(t);i.sort();for(const a of i){const i=t[a];if(Array.isArray(i))for(const e of i){const t=e.ruleNames?e.ruleNames.join("/"):e.ruleName+"/"+e.ruleAlias;o.push(a+": "+e.lineNumber+": "+t+" "+e.ruleDescription+(e.errorDetail?" ["+e.errorDetail+"]":"")+(e.errorContext?' [Context: "'+e.errorContext+'"]':""))}else{if(!r){r={};for(const t of e){r[t.names[0].toUpperCase()]=t}}for(const[e,t]of Object.entries(i)){const i=r[e.toUpperCase()];for(const e of t){const t=Math.min(n?1:0,i.names.length-1),r=a+": "+e+": "+i.names[t]+" "+i.description;o.push(r)}}}}return o.join("\n")}}),t}function removeFrontMatter(e,t){let n=[];if(t){const r=e.match(t);if(r&&!r.index){const t=r[0];e=e.slice(t.length),n=t.split(helpersExports.newLineRe),n.length>0&&""===n[n.length-1]&&n.length--}}return{content:e,frontMatterLines:n}}function mapAliasToRuleNames(e){const t={};for(const n of e){const e=n.names[0].toUpperCase();for(const r of n.names){t[r.toUpperCase()]=[e]}for(const r of n.tags){const n=r.toUpperCase(),o=t[n]||[];o.push(e),t[n]=o}}return t}function getEffectiveConfig(e,t,n){const r=Object.keys(t).filter(e=>"DEFAULT"===e.toUpperCase()),o=0===r.length||!!t[r[0]],i={};for(const a of e){i[a.names[0].toUpperCase()]=o}for(const a of Object.keys(t)){let e=t[a];e?e instanceof Object||(e={}):e=!1;const r=a.toUpperCase();for(const t of n[r]||[])i[t]=e}return i}function getEnabledRulesPerLineNumber(e,t,n,r,o,i,a){let s={},l={};const c=[],u=new Array(1+n.length);function d(e,t,n){for(const[o,i]of e.entries()){if(!r){let e=null;for(;e=helpersExports.inlineCommentStartRe.exec(i);){const n=e[2].toUpperCase(),r=e.index+e[1].length,a=i.indexOf("--\x3e",r);if(-1===a)break;t(n,i.slice(r,a),o+1)}}n&&n()}}function p(e,t,n){n={...n};const r=e.startsWith("ENABLE"),o=t&&t.trim(),i=o?o.toUpperCase().split(/\s+/):c;for(const s of i)for(const e of a[s]||[])n[e]=r;return n}d([t.join("\n")],function(e,t){if("CONFIGURE-FILE"===e){const{config:e}=parseConfiguration("CONFIGURE-FILE",t,i);e&&(o={...o,...e})}});const h=getEffectiveConfig(e,o,a);for(const A of e){const e=A.names[0].toUpperCase();c.push(e),s[e]=!!h[e]}l=s,d(t,function(e,t){"ENABLE-FILE"!==e&&"DISABLE-FILE"!==e||(s=p(e,t,s))}),d(t,function(e,t){"CAPTURE"===e?l=s:"RESTORE"===e?s=l:"ENABLE"!==e&&"DISABLE"!==e||(s=p(e,t,s))},function(){u.push(s)}),d(t,function(e,t,r){const o="DISABLE-NEXT-LINE"===e;if("DISABLE-LINE"===e||o){const i=n.length+r+(o?1:0);u[i]=p(e,t,u[i])}});const f=[];for(const[A,m]of c.entries())u.some(e=>e[m])&&f.push(e[A]);return{effectiveConfig:h,enabledRulesPerLineNumber:u,enabledRuleList:f}}function lintContent(e,t,n,r,o,i,a,s,l,c,u,d,p){const h=e=>p(e instanceof Error?e:new Error(e)),f=removeFrontMatter(r=r.replace(/^\uFEFF/,""),s),{frontMatterLines:A}=f;r=f.content;const{effectiveConfig:m,enabledRulesPerLineNumber:g,enabledRuleList:y}=getEnabledRulesPerLineNumber(e,r.split(helpersExports.newLineRe),A,c,i,a,t),v=y.some(e=>"markdownit"===e.parser||void 0===e.parser),b=y.some(e=>"micromark"===e.parser),x=e.length!==rules.length,w=b?parse$8(r,{freezeTokens:x}):[],C=r,$=(r=helpersExports.clearHtmlCommentText(r)).split(helpersExports.newLineRe),_=e=>{const t=Object.freeze({markdownit:Object.freeze({tokens:e})}),r=Object.freeze({micromark:Object.freeze({tokens:w})}),o=Object.freeze({}),i={name:n,version:version,lines:Object.freeze($),frontMatterLines:Object.freeze(A)};initialize({...i,parsers:r,config:null});let a=[];const s=s=>{const c=s.names[0].toUpperCase(),u={};let d=o;void 0===s.parser?(u.tokens=e,d=t):"markdownit"===s.parser?d=t:"micromark"===s.parser&&(d=r);const p={...i,...u,parsers:d,config:m[c]};function h(e){throw new Error(`Value of '${e}' passed to onError by '${c}' is incorrect for '${n}'.`)}function f(e){(!e||!helpersExports.isNumber(e.lineNumber)||e.lineNumber<1||e.lineNumber>$.length)&&h("lineNumber");const t=e.lineNumber+A.length;if(!g[t][c])return;e.detail&&!helpersExports.isString(e.detail)&&h("detail"),e.context&&!helpersExports.isString(e.context)&&h("context"),e.information&&!helpersExports.isUrl(e.information)&&h("information"),e.range&&(!Array.isArray(e.range)||2!==e.range.length||!helpersExports.isNumber(e.range[0])||e.range[0]<1||!helpersExports.isNumber(e.range[1])||e.range[1]<1||e.range[0]+e.range[1]-1>$[e.lineNumber-1].length)&&h("range");const n=e.fixInfo,r={};if(n){helpersExports.isObject(n)||h("fixInfo"),void 0!==n.lineNumber&&((!helpersExports.isNumber(n.lineNumber)||n.lineNumber<1||n.lineNumber>$.length)&&h("fixInfo.lineNumber"),r.lineNumber=n.lineNumber+A.length);const t=n.lineNumber||e.lineNumber;void 0!==n.editColumn&&((!helpersExports.isNumber(n.editColumn)||n.editColumn<1||n.editColumn>$[t-1].length+1)&&h("fixInfo.editColumn"),r.editColumn=n.editColumn),void 0!==n.deleteCount&&((!helpersExports.isNumber(n.deleteCount)||n.deleteCount<-1||n.deleteCount>$[t-1].length)&&h("fixInfo.deleteCount"),r.deleteCount=n.deleteCount),void 0!==n.insertText&&(helpersExports.isString(n.insertText)||h("fixInfo.insertText"),r.insertText=n.insertText)}const o=e.information||s.information;a.push({lineNumber:t,ruleName:s.names[0],ruleNames:s.names,ruleDescription:s.description,ruleInformation:o?o.href:null,errorDetail:e.detail||null,errorContext:e.context||null,errorRange:e.range?[...e.range]:null,fixInfo:n?r:null})}const y=e=>f({lineNumber:1,detail:`This rule threw an exception: ${e.message||e}`}),v=()=>s.function(p,f);if(s.asynchronous){const e=Promise.resolve().then(v);return l?e.catch(y):e}try{v()}catch(b){if(!l)throw b;y(b)}return null},c=y.filter(e=>e.asynchronous),d=y.filter(e=>!e.asynchronous),f=[...c,...d],v=()=>p(null,(()=>{if(a.sort((e,t)=>e.ruleName.localeCompare(t.ruleName)||e.lineNumber-t.lineNumber),u<3){const e={ruleName:null,lineNumber:-1};a=a.filter((t,n,r)=>{delete t.fixInfo;const o=r[n-1]||e;return t.ruleName!==o.ruleName||t.lineNumber!==o.lineNumber})}if(0===u){const e={};for(const t of a){const n=e[t.ruleName]||[];n.push(t.lineNumber),e[t.ruleName]=n}a=e}else if(1===u)for(const e of a)e.ruleAlias=e.ruleNames[1]||e.ruleName,delete e.ruleNames;else for(const e of a)delete e.ruleName;return a})());try{const e=f.map(s);c.length>0?Promise.all(e.slice(0,c.length)).then(v).catch(h):v()}catch(b){h(b)}finally{initialize()}};if(!v||d){const e=v?deferRequire.requireMarkdownItCjs().getMarkdownItTokens(o(),C,$):[];_(e)}else Promise.all([__vitePreload(()=>import("./markdownit-SQF1Xc8y.js").then(e=>e.m),[]),new Promise(e=>e(o()))]).then(([e,t])=>{const n=e.getMarkdownItTokens(t,C,$);_(n)}).catch(h)}function lintFile(e,t,n,r,o,i,a,s,l,c,u,d,p){u.readFile(n,"utf8",function(u,h){return u?p(u):lintContent(e,t,n,h,r,o,i,a,s,l,c,d,p)})}function lintInput(e,t,n){n=n||function(){};const r=[(e=e||{}).customRules||[]].flat().map(e=>({names:helpersExports.cloneIfArray(e.names),description:e.description,information:helpersExports.cloneIfUrl(e.information),tags:helpersExports.cloneIfArray(e.tags),parser:e.parser,asynchronous:e.asynchronous,function:e.function})),o=rules.concat(r),i=validateRuleList(o,t);if(i)return void n(i);let a=[];Array.isArray(e.files)?a=[...e.files]:e.files&&(a=[String(e.files)]);const s=e.strings||{},l=Object.keys(s),c=e.config||{default:!0},u=e.configParsers||void 0,d=void 0===e.frontMatter?helpersExports.frontMatterRe:e.frontMatter,p=!!e.handleRuleFailures,h=!!e.noInlineConfig,f=void 0===e.resultVersion?3:e.resultVersion,A=e.markdownItFactory||(()=>{throw new Error("The option 'markdownItFactory' was required (due to the option 'customRules' including a rule requiring the 'markdown-it' parser), but 'markdownItFactory' was not set.")}),m=e.fs||fs,g=mapAliasToRuleNames(o),y=newResults(o);let v=!1,b=0;function x(){let e=null;function r(t,r){return b--,t?(v=!0,n(t)):(y[e]=r,x(),null)}if(v);else if(a.length>0)b++,e=a.shift(),lintFile(o,g,e,A,c,u,d,p,h,f,m,t,r);else if(e=l.shift())b++,lintContent(o,g,e,s[e]||"",A,c,u,d,p,h,f,t,r);else if(0===b)return v=!0,n(null,y);return null}x(),x(),x(),x(),x(),x(),x(),x()}function lintAsync(e,t){return lintInput(e,!1,t)}function lintPromise(e){return new Promise((t,n)=>{lintAsync(e,(e,r)=>{e||!r?n(e):t(r)})})}function normalizeFixInfo(e,t=0){return{lineNumber:e.lineNumber||t,editColumn:e.editColumn||1,deleteCount:e.deleteCount||0,insertText:e.insertText||""}}function applyFix(e,t,n="\n"){const{editColumn:r,deleteCount:o,insertText:i}=normalizeFixInfo(t),a=r-1;return-1===o?null:e.slice(0,a)+i.replace(/\n/g,n)+e.slice(a+o)}function applyFixes(e,t){const n=helpersExports.getPreferredLineEnding(e,os),r=e.split(helpersExports.newLineRe);let o=t.filter(e=>e.fixInfo).map(e=>normalizeFixInfo(e.fixInfo,e.lineNumber));o.sort((e,t)=>{const n=-1===e.deleteCount,r=-1===t.deleteCount;return t.lineNumber-e.lineNumber||(n?1:r?-1:0)||t.editColumn-e.editColumn||t.insertText.length-e.insertText.length});let i={};o=o.filter(e=>{const t=e.lineNumber!==i.lineNumber||e.editColumn!==i.editColumn||e.deleteCount!==i.deleteCount||e.insertText!==i.insertText;return i=e,t}),i={lineNumber:-1};for(const l of o)l.lineNumber===i.lineNumber&&l.editColumn===i.editColumn&&!l.insertText&&l.deleteCount>0&&i.insertText&&!i.deleteCount&&(l.insertText=i.insertText,i.lineNumber=0),i=l;o=o.filter(e=>e.lineNumber);let a=-1,s=-1;for(const l of o){const{lineNumber:e,editColumn:t,deleteCount:o}=l,i=e-1,c=t-1;(i!==a||-1===o||c+o<=s-(o>0?0:1))&&(r[i]=applyFix(r[i],l,n)),a=i,s=c}return r.filter(e=>null!==e).join(n)}function _getDefaults(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _defaults=_getDefaults();function changeDefaults(e){_defaults=e}var noopTest={exec:()=>null};function edit(e,t=""){let n="string"==typeof e?e:e.source;const r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(other.caret,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}var other={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},newline$1=/^(?:[ \t]*(?:\n|$))+/,blockCode=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,fences=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr$1=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading$1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bullet=/(?:[*+-]|\d{1,9}[.)])/,lheadingCore=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lheading$1=edit(lheadingCore).replace(/bull/g,bullet).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),lheadingGfm=edit(lheadingCore).replace(/bull/g,bullet).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),_paragraph=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,blockText=/^[^\n]+/,_blockLabel=/(?!\s*\])(?:\\.|[^\[\]\\])+/,def=edit(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",_blockLabel).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),list$4=edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,bullet).getRegex(),_tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",_comment=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,html=edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",_comment).replace("tag",_tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),paragraph$1=edit(_paragraph).replace("hr",hr$1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex(),blockquote$1=edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",paragraph$1).getRegex(),blockNormal={blockquote:blockquote$1,code:blockCode,def:def,fences:fences,heading:heading$1,hr:hr$1,html:html,lheading:lheading$1,list:list$4,newline:newline$1,paragraph:paragraph$1,table:noopTest,text:blockText},gfmTable=edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",hr$1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex(),blockGfm={...blockNormal,lheading:lheadingGfm,table:gfmTable,paragraph:edit(_paragraph).replace("hr",hr$1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gfmTable).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex()},blockPedantic={...blockNormal,html:edit("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",_comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:noopTest,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:edit(_paragraph).replace("hr",hr$1).replace("heading"," *#{1,6} *[^\n]").replace("lheading",lheading$1).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},escape$2=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,inlineCode=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br=/^( {2,}|\\)\n(?!\s*$)/,inlineText=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_punctuation=/[\p{P}\p{S}]/u,_punctuationOrSpace=/[\s\p{P}\p{S}]/u,_notPunctuationOrSpace=/[^\s\p{P}\p{S}]/u,punctuation=edit(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,_punctuationOrSpace).getRegex(),_punctuationGfmStrongEm=/(?!~)[\p{P}\p{S}]/u,_punctuationOrSpaceGfmStrongEm=/(?!~)[\s\p{P}\p{S}]/u,_notPunctuationOrSpaceGfmStrongEm=/(?:[^\s\p{P}\p{S}]|~)/u,blockSkip=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,emStrongLDelimCore=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,emStrongLDelim=edit(emStrongLDelimCore,"u").replace(/punct/g,_punctuation).getRegex(),emStrongLDelimGfm=edit(emStrongLDelimCore,"u").replace(/punct/g,_punctuationGfmStrongEm).getRegex(),emStrongRDelimAstCore="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",emStrongRDelimAst=edit(emStrongRDelimAstCore,"gu").replace(/notPunctSpace/g,_notPunctuationOrSpace).replace(/punctSpace/g,_punctuationOrSpace).replace(/punct/g,_punctuation).getRegex(),emStrongRDelimAstGfm=edit(emStrongRDelimAstCore,"gu").replace(/notPunctSpace/g,_notPunctuationOrSpaceGfmStrongEm).replace(/punctSpace/g,_punctuationOrSpaceGfmStrongEm).replace(/punct/g,_punctuationGfmStrongEm).getRegex(),emStrongRDelimUnd=edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_notPunctuationOrSpace).replace(/punctSpace/g,_punctuationOrSpace).replace(/punct/g,_punctuation).getRegex(),anyPunctuation=edit(/\\(punct)/,"gu").replace(/punct/g,_punctuation).getRegex(),autolink$1=edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),_inlineComment=edit(_comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),tag=edit("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",_inlineComment).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_inlineLabel=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,link$1=edit(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",_inlineLabel).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),reflink=edit(/^!?\[(label)\]\[(ref)\]/).replace("label",_inlineLabel).replace("ref",_blockLabel).getRegex(),nolink=edit(/^!?\[(ref)\](?:\[\])?/).replace("ref",_blockLabel).getRegex(),reflinkSearch=edit("reflink|nolink(?!\\()","g").replace("reflink",reflink).replace("nolink",nolink).getRegex(),inlineNormal={_backpedal:noopTest,anyPunctuation:anyPunctuation,autolink:autolink$1,blockSkip:blockSkip,br:br,code:inlineCode,del:noopTest,emStrongLDelim:emStrongLDelim,emStrongRDelimAst:emStrongRDelimAst,emStrongRDelimUnd:emStrongRDelimUnd,escape:escape$2,link:link$1,nolink:nolink,punctuation:punctuation,reflink:reflink,reflinkSearch:reflinkSearch,tag:tag,text:inlineText,url:noopTest},inlinePedantic={...inlineNormal,link:edit(/^!?\[(label)\]\((.*?)\)/).replace("label",_inlineLabel).getRegex(),reflink:edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_inlineLabel).getRegex()},inlineGfm={...inlineNormal,emStrongRDelimAst:emStrongRDelimAstGfm,emStrongLDelim:emStrongLDelimGfm,url:edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},inlineBreaks={...inlineGfm,br:edit(br).replace("{2,}","*").getRegex(),text:edit(inlineGfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},block$3={normal:blockNormal,gfm:blockGfm,pedantic:blockPedantic},inline$1={normal:inlineNormal,gfm:inlineGfm,breaks:inlineBreaks,pedantic:inlinePedantic},escapeReplacements={"&":"&","<":"<",">":">",'"':""","'":"'"},getEscapeReplacement=e=>escapeReplacements[e];function escape2(e,t){if(t){if(other.escapeTest.test(e))return e.replace(other.escapeReplace,getEscapeReplacement)}else if(other.escapeTestNoEncode.test(e))return e.replace(other.escapeReplaceNoEncode,getEscapeReplacement);return e}function cleanUrl(e){try{e=encodeURI(e).replace(other.percentDecode,"%")}catch{return null}return e}function splitCells(e,t){var n;const r=e.replace(other.findPipe,(e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(other.splitPipe);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!(null==(n=r.at(-1))?void 0:n.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(other.slashPipe,"|");return r}function rtrim(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){if(e.charAt(r-o-1)!==t)break;o++}return e.slice(0,r-o)}function findClosingBracket(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function outputLink(e,t,n,r,o){const i=t.href,a=t.title||null,s=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:i,title:a,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,l}function indentCodeCompensation(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(null===r)return t;const o=r[1];return t.split("\n").map(e=>{const t=e.match(n.other.beginningSpace);if(null===t)return e;const[r]=t;return r.length>=o.length?e.slice(o.length):e}).join("\n")}var _Tokenizer=class{options;rules;lexer;constructor(e){this.options=e||_defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:rtrim(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=indentCodeCompensation(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){const t=rtrim(e,"#");this.options.pedantic?e=t.trim():t&&!this.rules.other.endingSpaceChar.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:rtrim(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=rtrim(t[0],"\n").split("\n"),n="",r="";const o=[];for(;e.length>0;){let t=!1;const i=[];let a;for(a=0;a<e.length;a++)if(this.rules.other.blockquoteStart.test(e[a]))i.push(e[a]),t=!0;else{if(t)break;i.push(e[a])}e=e.slice(a);const s=i.join("\n"),l=s.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${s}`:s,r=r?`${r}\n${l}`:l;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,o,!0),this.lexer.state.top=c,0===e.length)break;const u=o.at(-1);if("code"===(null==u?void 0:u.type))break;if("blockquote"===(null==u?void 0:u.type)){const t=u,i=t.raw+"\n"+e.join("\n"),a=this.blockquote(i);o[o.length-1]=a,n=n.substring(0,n.length-t.raw.length)+a.raw,r=r.substring(0,r.length-t.text.length)+a.text;break}if("list"===(null==u?void 0:u.type)){const t=u,i=t.raw+"\n"+e.join("\n"),a=this.list(i);o[o.length-1]=a,n=n.substring(0,n.length-u.raw.length)+a.raw,r=r.substring(0,r.length-t.raw.length)+a.raw,e=i.substring(o.at(-1).raw.length).split("\n");continue}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let a=!1;for(;e;){let n=!1,r="",s="";if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,e=>" ".repeat(3*e.length)),c=e.split("\n",1)[0],u=!l.trim(),d=0;if(this.options.pedantic?(d=2,s=l.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=l.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),o=this.rules.other.fencesBeginRegex(d),i=this.rules.other.headingBeginRegex(d),a=this.rules.other.htmlBeginRegex(d);for(;e;){const p=e.split("\n",1)[0];let h;if(c=p,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),h=c):h=c.replace(this.rules.other.tabCharGlobal," "),o.test(c))break;if(i.test(c))break;if(a.test(c))break;if(t.test(c))break;if(n.test(c))break;if(h.search(this.rules.other.nonSpaceChar)>=d||!c.trim())s+="\n"+h.slice(d);else{if(u)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(o.test(l))break;if(i.test(l))break;if(n.test(l))break;s+="\n"+c}u||c.trim()||(u=!0),r+=p+"\n",e=e.substring(p.length+1),l=h.slice(d)}}o.loose||(a?o.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(a=!0));let p,h=null;this.options.gfm&&(h=this.rules.other.listIsTask.exec(s),h&&(p="[ ] "!==h[0],s=s.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:r,task:!!h,checked:p,loose:!1,text:s,tokens:[]}),o.raw+=r}const s=o.items.at(-1);if(!s)return;s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd(),o.raw=o.raw.trimEnd();for(let e=0;e<o.items.length;e++)if(this.lexer.state.top=!1,o.items[e].tokens=this.lexer.blockTokens(o.items[e].text,[]),!o.loose){const t=o.items[e].tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));o.loose=n}if(o.loose)for(let e=0;e<o.items.length;e++)o.items[e].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){var t;const n=this.rules.block.table.exec(e);if(!n)return;if(!this.rules.other.tableDelimiter.test(n[2]))return;const r=splitCells(n[1]),o=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(null==(t=n[3])?void 0:t.trim())?n[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],a={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===o.length){for(const e of o)this.rules.other.tableAlignRight.test(e)?a.align.push("right"):this.rules.other.tableAlignCenter.test(e)?a.align.push("center"):this.rules.other.tableAlignLeft.test(e)?a.align.push("left"):a.align.push(null);for(let e=0;e<r.length;e++)a.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:a.align[e]});for(const e of i)a.rows.push(splitCells(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const t=rtrim(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=findClosingBracket(t[2],"()");if(-2===e)return;if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),outputLink(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return outputLink(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let o,i,a=n,s=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=[...o].length,r[3]||r[4]){a+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){s+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+s);const t=[...r[0]][0].length,l=e.slice(0,n+r.index+t+i);if(Math.min(n,i)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){var t;let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=n[0],r="mailto:"+e;else{let o;do{o=n[0],n[0]=(null==(t=this.rules.inline._backpedal.exec(n[0]))?void 0:t[0])??""}while(o!==n[0]);e=n[0],r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},_Lexer=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||_defaults,this.options.tokenizer=this.options.tokenizer||new _Tokenizer,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:other,block:block$3.normal,inline:inline$1.normal};this.options.pedantic?(t.block=block$3.pedantic,t.inline=inline$1.pedantic):this.options.gfm&&(t.block=block$3.gfm,this.options.breaks?t.inline=inline$1.breaks:t.inline=inline$1.gfm),this.tokenizer.rules=t}static get rules(){return{block:block$3,inline:inline$1}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(other.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){var r,o,i;for(this.options.pedantic&&(e=e.replace(other.tabCharGlobal," ").replace(other.spaceLine,""));e;){let a;if(null==(o=null==(r=this.options.extensions)?void 0:r.block)?void 0:o.some(n=>!!(a=n.call({lexer:this},e,t))&&(e=e.substring(a.raw.length),t.push(a),!0)))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);const n=t.at(-1);1===a.raw.length&&void 0!==n?n.raw+="\n":t.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);const n=t.at(-1);"paragraph"===(null==n?void 0:n.type)||"text"===(null==n?void 0:n.type)?(n.raw+="\n"+a.raw,n.text+="\n"+a.text,this.inlineQueue.at(-1).src=n.text):t.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);const n=t.at(-1);"paragraph"===(null==n?void 0:n.type)||"text"===(null==n?void 0:n.type)?(n.raw+="\n"+a.raw,n.text+="\n"+a.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title});continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),t.push(a);continue}let s=e;if(null==(i=this.options.extensions)?void 0:i.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(a=this.tokenizer.paragraph(s))){const r=t.at(-1);n&&"paragraph"===(null==r?void 0:r.type)?(r.raw+="\n"+a.raw,r.text+="\n"+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(a),n=s.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);const n=t.at(-1);"text"===(null==n?void 0:n.type)?(n.raw+="\n"+a.raw,n.text+="\n"+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(a);continue}if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var n,r,o;let i=e,a=null;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(i));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.anyPunctuation.exec(i));)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(i));)i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,l="";for(;e;){let a;if(s||(l=""),s=!1,null==(r=null==(n=this.options.extensions)?void 0:n.inline)?void 0:r.some(n=>!!(a=n.call({lexer:this},e,t))&&(e=e.substring(a.raw.length),t.push(a),!0)))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);const n=t.at(-1);"text"===a.type&&"text"===(null==n?void 0:n.type)?(n.raw+=a.raw,n.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,i,l)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let c=e;if(null==(o=this.options.extensions)?void 0:o.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(c=e.substring(0,t+1))}if(a=this.tokenizer.inlineText(c)){e=e.substring(a.raw.length),"_"!==a.raw.slice(-1)&&(l=a.raw.slice(-1)),s=!0;const n=t.at(-1);"text"===(null==n?void 0:n.type)?(n.raw+=a.raw,n.text+=a.text):t.push(a);continue}if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},_Renderer=class{options;parser;constructor(e){this.options=e||_defaults}space(e){return""}code({text:e,lang:t,escaped:n}){var r;const o=null==(r=(t||"").match(other.notSpaceStart))?void 0:r[0],i=e.replace(other.endingNewline,"")+"\n";return o?'<pre><code class="language-'+escape2(o)+'">'+(n?i:escape2(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:escape2(i,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,n=e.start;let r="";for(let i=0;i<e.items.length;i++){const t=e.items[i];r+=this.listitem(t)}const o=t?"ol":"ul";return"<"+o+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+o+">\n"}listitem(e){var t;let n="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===(null==(t=e.tokens[0])?void 0:t.type)?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=r+" "+escape2(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):n+=r+" "}return n+=this.parser.parse(e.tokens,!!e.loose),`<li>${n}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let o=0;o<e.header.length;o++)n+=this.tablecell(e.header[o]);t+=this.tablerow({text:n});let r="";for(let o=0;o<e.rows.length;o++){const t=e.rows[o];n="";for(let e=0;e<t.length;e++)n+=this.tablecell(t[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${escape2(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),o=cleanUrl(e);if(null===o)return r;let i='<a href="'+(e=o)+'"';return t&&(i+=' title="'+escape2(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const o=cleanUrl(e);if(null===o)return escape2(n);let i=`<img src="${e=o}" alt="${n}"`;return t&&(i+=` title="${escape2(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:escape2(e.text)}},_TextRenderer=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},_Parser=class e{options;renderer;textRenderer;constructor(e){this.options=e||_defaults,this.options.renderer=this.options.renderer||new _Renderer,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _TextRenderer}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){var n,r;let o="";for(let i=0;i<e.length;i++){const a=e[i];if(null==(r=null==(n=this.options.extensions)?void 0:n.renderers)?void 0:r[a.type]){const e=a,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){o+=t||"";continue}}const s=a;switch(s.type){case"space":o+=this.renderer.space(s);continue;case"hr":o+=this.renderer.hr(s);continue;case"heading":o+=this.renderer.heading(s);continue;case"code":o+=this.renderer.code(s);continue;case"table":o+=this.renderer.table(s);continue;case"blockquote":o+=this.renderer.blockquote(s);continue;case"list":o+=this.renderer.list(s);continue;case"html":o+=this.renderer.html(s);continue;case"paragraph":o+=this.renderer.paragraph(s);continue;case"text":{let n=s,r=this.renderer.text(n);for(;i+1<e.length&&"text"===e[i+1].type;)n=e[++i],r+="\n"+this.renderer.text(n);o+=t?this.renderer.paragraph({type:"paragraph",raw:r,text:r,tokens:[{type:"text",raw:r,text:r,escaped:!0}]}):r;continue}default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return o}parseInline(e,t=this.renderer){var n,r;let o="";for(let i=0;i<e.length;i++){const a=e[i];if(null==(r=null==(n=this.options.extensions)?void 0:n.renderers)?void 0:r[a.type]){const e=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){o+=e||"";continue}}const s=a;switch(s.type){case"escape":case"text":o+=t.text(s);break;case"html":o+=t.html(s);break;case"link":o+=t.link(s);break;case"image":o+=t.image(s);break;case"strong":o+=t.strong(s);break;case"em":o+=t.em(s);break;case"codespan":o+=t.codespan(s);break;case"br":o+=t.br(s);break;case"del":o+=t.del(s);break;default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return o}},_Hooks=class{options;block;constructor(e){this.options=e||_defaults}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?_Lexer.lex:_Lexer.lexInline}provideParser(){return this.block?_Parser.parse:_Parser.parseInline}},Marked=class{defaults=_getDefaults();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=_Parser;Renderer=_Renderer;TextRenderer=_TextRenderer;Lexer=_Lexer;Tokenizer=_Tokenizer;Hooks=_Hooks;constructor(...e){this.use(...e)}walkTokens(e,t){var n,r;let o=[];for(const i of e)switch(o=o.concat(t.call(this,i)),i.type){case"table":{const e=i;for(const n of e.header)o=o.concat(this.walkTokens(n.tokens,t));for(const n of e.rows)for(const e of n)o=o.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=i;o=o.concat(this.walkTokens(e.items,t));break}default:{const e=i;(null==(r=null==(n=this.defaults.extensions)?void 0:n.childTokens)?void 0:r[e.type])?this.defaults.extensions.childTokens[e.type].forEach(n=>{const r=e[n].flat(1/0);o=o.concat(this.walkTokens(r,t))}):e.tokens&&(o=o.concat(this.walkTokens(e.tokens,t)))}}return o}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){const t=this.defaults.renderer||new _Renderer(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,o=e.renderer[r],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new _Tokenizer(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,o=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new _Hooks;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;const r=n,o=e.hooks[r],i=t[r];_Hooks.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(o.call(t,e)).then(e=>i.call(t,e));const n=o.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return _Lexer.lex(e,t??this.defaults)}parser(e,t){return _Parser.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{const r={...n},o={...this.defaults,...r},i=this.onError(!!o.silent,!!o.async);if(!0===this.defaults.async&&!1===r.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==t)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const a=o.hooks?o.hooks.provideLexer():e?_Lexer.lex:_Lexer.lexInline,s=o.hooks?o.hooks.provideParser():e?_Parser.parse:_Parser.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(t):t).then(e=>a(e,o)).then(e=>o.hooks?o.hooks.processAllTokens(e):e).then(e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then(()=>e):e).then(e=>s(e,o)).then(e=>o.hooks?o.hooks.postprocess(e):e).catch(i);try{o.hooks&&(t=o.hooks.preprocess(t));let e=a(t,o);o.hooks&&(e=o.hooks.processAllTokens(e)),o.walkTokens&&this.walkTokens(e,o.walkTokens);let n=s(e,o);return o.hooks&&(n=o.hooks.postprocess(n)),n}catch(e2){return i(e2)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+escape2(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},markedInstance=new Marked;function marked(e,t){return markedInstance.parse(e,t)}async function downloadMarkdown(e){if(!e)return void console.warn("No content provided for PDF export");const t=await(async()=>{try{const{content:t}=await lintPromise({strings:{content:e}});if(!t.length)return e;return applyFixes(e,t)||e}catch(t){return console.error("Markdown linting failed:",t),e}})();let n;marked.setOptions({breaks:!0,gfm:!0});try{n=await marked.parse(t)}catch(i){return void console.error("Markdown parsing failed:",i)}const r=document.createElement("div");r.innerHTML=n,r.style.padding="20px",r.style.fontFamily="Arial, sans-serif",r.style.fontSize="12pt",r.style.lineHeight="1.5";r.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(e=>{e.style.color="#2196f3",e.style.fontSize="1.5em",e.style.paddingTop="8px",e.style.paddingBottom="8px"});r.querySelectorAll("strong").forEach(e=>{e.style.fontWeight="bold",e.style.display="inline"});r.querySelectorAll("p").forEach(e=>{e.style.marginBottom="12px"});r.querySelectorAll("hr").forEach(e=>{e.style.marginTop="8px",e.style.marginBottom="16px",e.style.border="0",e.style.borderTop="1px solid #e0e0e0"});const o={margin:[.5,.5,.5,.5],filename:"document.pdf",image:{type:"jpeg",quality:.98},html2canvas:{scale:2,useCORS:!0},jsPDF:{unit:"in",format:"letter",orientation:"portrait"}};try{await html2pdf().from(r).set(o).output("blob").then(e=>{const t=URL.createObjectURL(e),n=ioc.routerService.listen(()=>{URL.revokeObjectURL(t),n()});ioc.layoutService.downloadFile(t,"document.pdf")})}catch(a){console.error("PDF generation failed:",a)}}marked.options=marked.setOptions=function(e){return markedInstance.setOptions(e),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.getDefaults=_getDefaults,marked.defaults=_defaults,marked.use=function(...e){return markedInstance.use(...e),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.walkTokens=function(e,t){return markedInstance.walkTokens(e,t)},marked.parseInline=markedInstance.parseInline,marked.Parser=_Parser,marked.parser=_Parser.parse,marked.Renderer=_Renderer,marked.TextRenderer=_TextRenderer,marked.Lexer=_Lexer,marked.lexer=_Lexer.lex,marked.Tokenizer=_Tokenizer,marked.Hooks=_Hooks,marked.parse=marked,marked.options,marked.setOptions,marked.use,marked.walkTokens,marked.parseInline,_Parser.parse,_Lexer.lex;class MarkdownHelperService{loggerService=YS(TYPES.loggerService);buildMarkdownFromFields=(e,t,n={})=>{this.loggerService.log("markdownHelperService buildMarkdownFromFields",{fields:e,data:t});const r=[],{visible:o}=nI(e,t,n,n.permissions),i=new Set(o),a=e=>{if(i.has(e))if(e.type!==Mn$1.Typography){if(e.type===Mn$1.Text){const o=e.compute?e.compute(t,n):e.name?lodashExports.get(t,e.name):void 0,i=e.title;if(o){const e=String(o);r.push(i?`**${i}:** ${e}`:e)}return}if(e.fields)for(const t of e.fields)a(t);e.child&&a(e.child)}else e.placeholder&&r.push(`\n## ${e.placeholder}\n`)};for(const s of e)a(s);return r.join("\n")};printFields=async(e,t,n={})=>{this.loggerService.log("markdownHelperService printFields",{fields:e,data:t});const r=this.buildMarkdownFromFields(e,t,n);await downloadMarkdown(r)}}class ExplorerHelperService{loggerService=YS(TYPES.loggerService);*deepFlat(e){this.loggerService.log("explorerHelperService deepFlat");const t=new Set,n=[...e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),"directory"===e.type&&n.push(...e.nodes),yield e)}}}zS(TYPES.errorService,()=>new ErrorService),zS(TYPES.alertService,()=>new AlertService),zS(TYPES.layoutService,()=>new LayoutService),zS(TYPES.loggerService,()=>new LoggerService),zS(TYPES.routerService,()=>new RouterService),zS(TYPES.linkService,()=>new LinkService),zS(TYPES.symbolGlobalService,()=>new SymbolGlobalService),zS(TYPES.priceGlobalService,()=>new PriceGlobalService),zS(TYPES.backtestGlobalService,()=>new BacktestGlobalService),zS(TYPES.liveGlobalService,()=>new LiveGlobalService),zS(TYPES.explorerHelperService,()=>new ExplorerHelperService),zS(TYPES.markdownHelperService,()=>new MarkdownHelperService),zS(TYPES.exchangeMockService,()=>new ExchangeMockService),zS(TYPES.notificationMockService,()=>new NotificationMockService),zS(TYPES.storageMockService,()=>new StorageMockService),zS(TYPES.logMockService,()=>new LogMockService),zS(TYPES.statusMockService,()=>new StatusMockService),zS(TYPES.markdownMockService,()=>new MarkdownMockService),zS(TYPES.explorerMockService,()=>new ExplorerMockService),zS(TYPES.signalMockService,()=>new SignalMockService),zS(TYPES.heatMockService,()=>new HeatMockService),zS(TYPES.exchangeViewService,()=>new ExchangeViewService),zS(TYPES.notificationViewService,()=>new NotificationViewService),zS(TYPES.storageViewService,()=>new StorageViewService),zS(TYPES.logViewService,()=>new LogViewService),zS(TYPES.statusViewService,()=>new StatusViewService),zS(TYPES.markdownViewService,()=>new MarkdownViewService),zS(TYPES.explorerViewService,()=>new ExplorerViewService),zS(TYPES.signalViewService,()=>new SignalViewService),zS(TYPES.heatViewService,()=>new HeatViewService);const baseServices={errorService:YS(TYPES.errorService),layoutService:YS(TYPES.layoutService),loggerService:YS(TYPES.loggerService),routerService:YS(TYPES.routerService),alertService:YS(TYPES.alertService),linkService:YS(TYPES.linkService)},globalServices={symbolGlobalService:YS(TYPES.symbolGlobalService),priceGlobalService:YS(TYPES.priceGlobalService),backtestGlobalService:YS(TYPES.backtestGlobalService),liveGlobalService:YS(TYPES.liveGlobalService)},helperServices={explorerHelperService:YS(TYPES.explorerHelperService),markdownHelperService:YS(TYPES.markdownHelperService)},mockServices={exchangeMockService:YS(TYPES.exchangeMockService),notificationMockService:YS(TYPES.notificationMockService),storageMockService:YS(TYPES.storageMockService),logMockService:YS(TYPES.logMockService),statusMockService:YS(TYPES.statusMockService),markdownMockService:YS(TYPES.markdownMockService),explorerMockService:YS(TYPES.explorerMockService),signalMockService:YS(TYPES.signalMockService),heatMockService:YS(TYPES.heatMockService)},viewServices={exchangeViewService:YS(TYPES.exchangeViewService),notificationViewService:YS(TYPES.notificationViewService),storageViewService:YS(TYPES.storageViewService),logViewService:YS(TYPES.logViewService),statusViewService:YS(TYPES.statusViewService),markdownViewService:YS(TYPES.markdownViewService),explorerViewService:YS(TYPES.explorerViewService),signalViewService:YS(TYPES.signalViewService),heatViewService:YS(TYPES.heatViewService)},ioc={...baseServices,...globalServices,...helperServices,...mockServices,...viewServices};ioc.routerService.listen(({action:e,location:t})=>{"/error_page"!==t.pathname&&"/offline_page"!==t.pathname&&"PUSH"===e&&console.clear()}),window.addEventListener("unhandledrejection",e=>{ioc.errorService.handleGlobalError(new Error(e.reason))}),window.addEventListener("error",e=>{ioc.errorService.handleGlobalError(new Error(mL(e)))}),Object.assign(window,{ioc:ioc});const AUTO_HIDE_DURATION=5e3,AlertProvider=({children:e})=>{const[t,n]=reactExports.useState(ioc.alertService.current);return Xf(()=>ioc.alertService.reloadSubject.subscribe(()=>{n(ioc.alertService.current)})),factory$1(Fragment,{children:[!!t&&factory$1(Snackbar,{open:!0,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:t.pin?void 0:AUTO_HIDE_DURATION,onClose:t.pin?void 0:ioc.alertService.hideCurrent,sx:{zIndex:9999999},message:t.message},t.key),e]})},createRedirect=e=>()=>factory$1(Dw,{handler:async()=>{await e()},height:"calc(100vh - 80px)"}),getMainRoute=async()=>new URL(location.href,location.origin).searchParams.has("pine")?"/pine_page":"/main",join$1=(...e)=>(e=e.flat(1)).flatMap(e=>Array.isArray(e)?join$1(e):e).filter(Boolean),str=(...e)=>join$1(...e).join(" ");str.newline=(...e)=>join$1(...e).join("\n"),str.space=(...e)=>join$1(...e).join(" "),str.comma=(...e)=>join$1(...e).join(", "),str.dot=(...e)=>join$1(...e).join(". "),str.semicolon=(...e)=>join$1(...e).join(";"),str.table=(...e)=>`| ${join$1(...e).join(" | ")} |`;const useStyles$t=makeStyles()(e=>({root:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,background:e.palette.background.default,height:"100vh",width:"100vw",display:"flex",alignItems:"center",flexDirection:"column",gap:20,padding:15},container:{position:"relative",overflow:"clip",minWidth:375,maxWidth:375,padding:15},reveal:{width:"auto !important"}})),ERROR_LABEL="Data is outdated. Please refresh the page",OFFLINE_LABEL="Disconnected from server",ErrorView=({onLine:e=navigator.onLine})=>{const{classes:t}=useStyles$t();return factory$1(mx,{children:factory$1(Box$1,{className:t.root,children:factory$1(Box$1,{className:t.reveal,children:factory$1(Paper,{className:t.container,children:factory$1(Stack,{direction:"column",gap:"15px",children:[factory$1("span",{children:e?ERROR_LABEL:OFFLINE_LABEL}),factory$1(Button,{variant:"contained",onClick:()=>window.location.reload(),children:e?"Reload page":"Reconnect"})]})})})})})},ErrorPage=()=>factory$1(ErrorView,{}),AccountBalance=createSvgIcon$1([factory$1("path",{d:"m6.29 6 5.21-2.74L16.71 6z",opacity:".3"},"0"),factory$1("path",{d:"M6.5 10h-2v7h2v-7zm6 0h-2v7h2v-7zm8.5 9H2v2h19v-2zm-2.5-9h-2v7h2v-7zm-7-9L2 6v2h19V6l-9.5-5zM6.29 6l5.21-2.74L16.71 6H6.29z"},"1")],"AccountBalanceTwoTone"),Analytics=createSvgIcon$1([factory$1("path",{d:"M5 5h14v14H5z",opacity:".3"},"0"),factory$1("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z"},"1"),factory$1("path",{d:"M7 12h2v5H7zm8-5h2v10h-2zm-4 7h2v3h-2zm0-4h2v2h-2z"},"2")],"AnalyticsTwoTone"),ArrowBack=createSvgIcon$1(factory$1("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"}),"ArrowBack"),ArrowForward=createSvgIcon$1(factory$1("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),Cancel=createSvgIcon$1(factory$1("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel"),Close=createSvgIcon$1(factory$1("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),CopyAll=createSvgIcon$1(factory$1("path",{d:"M18 2H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H9V4h9v12zM3 15v-2h2v2H3zm0-5.5h2v2H3v-2zM10 20h2v2h-2v-2zm-7-1.5v-2h2v2H3zM5 22c-1.1 0-2-.9-2-2h2v2zm3.5 0h-2v-2h2v2zm5 0v-2h2c0 1.1-.9 2-2 2zM5 6v2H3c0-1.1.9-2 2-2z"}),"CopyAll"),DataObject=createSvgIcon$1(factory$1("path",{d:"M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7zm17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4h-1z"}),"DataObject"),Description=createSvgIcon$1(factory$1("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"}),"Description"),DonutSmall=createSvgIcon$1([factory$1("path",{d:"M15.99 9h3.43C18.6 7 17 5.4 15 4.58v3.43c.37.28.71.62.99.99zM4 12c0 3.35 2.04 6.24 5 7.42v-3.44c-1.23-.93-2-2.4-2-3.99C7 10.4 7.77 8.93 9 8V4.58C6.04 5.76 4 8.65 4 12zm11 3.99v3.43c2-.82 3.6-2.42 4.42-4.42h-3.43c-.28.37-.62.71-.99.99z",opacity:".3"},"0"),factory$1("path",{d:"M14.82 11h7.13c-.47-4.72-4.23-8.48-8.95-8.95v7.13c.85.31 1.51.97 1.82 1.82zM15 4.58C17 5.4 18.6 7 19.42 9h-3.43c-.28-.37-.62-.71-.99-.99V4.58zM2 12c0 5.19 3.95 9.45 9 9.95v-7.13C9.84 14.4 9 13.3 9 12c0-1.3.84-2.4 2-2.82V2.05c-5.05.5-9 4.76-9 9.95zm7-7.42v3.44c-1.23.92-2 2.39-2 3.98 0 1.59.77 3.06 2 3.99v3.44C6.04 18.24 4 15.35 4 12c0-3.35 2.04-6.24 5-7.42zm4 10.24v7.13c4.72-.47 8.48-4.23 8.95-8.95h-7.13c-.31.85-.97 1.51-1.82 1.82zm2 1.17c.37-.28.71-.61.99-.99h3.43C18.6 17 17 18.6 15 19.42v-3.43z"},"1")],"DonutSmallTwoTone"),Download=createSvgIcon$1(factory$1("path",{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"}),"Download"),ErrorIcon=createSvgIcon$1(factory$1("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}),"Error"),GitHub=createSvgIcon$1(factory$1("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub"),HourglassTop=createSvgIcon$1(factory$1("path",{d:"m6 2 .01 6L10 12l-3.99 4.01L6 22h12v-6l-4-4 4-3.99V2H6zm10 14.5V20H8v-3.5l4-4 4 4z"}),"HourglassTop"),Info=createSvgIcon$1(factory$1("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info"),Layers=createSvgIcon$1([factory$1("path",{d:"M6.26 9 12 13.47 17.74 9 12 4.53z",opacity:".3"},"0"),factory$1("path",{d:"m19.37 12.8-7.38 5.74-7.37-5.73L3 14.07l9 7 9-7zM12 2 3 9l1.63 1.27L12 16l7.36-5.73L21 9l-9-7zm0 11.47L6.26 9 12 4.53 17.74 9 12 13.47z"},"1")],"LayersTwoTone"),LiveTv=createSvgIcon$1(factory$1("path",{d:"M21 6h-7.59l3.29-3.29L16 2l-4 4-4-4-.71.71L10.59 6H3c-1.1 0-2 .89-2 2v12c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.11-.9-2-2-2zm0 14H3V8h18v12zM9 10v8l7-4z"}),"LiveTv"),ManageSearch=createSvgIcon$1(factory$1("path",{d:"M7 9H2V7h5v2zm0 3H2v2h5v-2zm13.59 7-3.83-3.83c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L22 17.59 20.59 19zM17 11c0-1.65-1.35-3-3-3s-3 1.35-3 3 1.35 3 3 3 3-1.35 3-3zM2 19h10v-2H2v2z"}),"ManageSearch"),NotificationImportant=createSvgIcon$1(factory$1("path",{d:"M18 16v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-5 0h-2v-2h2v2zm0-4h-2V8h2v4zm-1 10c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2z"}),"NotificationImportant"),PictureAsPdf=createSvgIcon$1(factory$1("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}),"PictureAsPdf"),PlayArrow=createSvgIcon$1(factory$1("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),Print=createSvgIcon$1(factory$1("path",{d:"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"}),"Print"),ReportProblem=createSvgIcon$1(factory$1("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"ReportProblem"),RequestQuote=createSvgIcon$1([factory$1("path",{d:"M6 20V4h7v4h5v12H6zm5-1h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4v-2h-2V9h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1z",opacity:".3"},"0"),factory$1("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v4h5v12H6zm5-1h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4v-2h-2V9h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1z"},"1")],"RequestQuoteTwoTone"),Schedule=createSvgIcon$1([factory$1("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},"0"),factory$1("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"Schedule"),Search=createSvgIcon$1(factory$1("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search"),SwapVert=createSvgIcon$1(factory$1("path",{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3 5 6.99h3V14h2V6.99h3L9 3z"}),"SwapVert"),Timeline=createSvgIcon$1(factory$1("path",{d:"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2z"}),"Timeline"),TrendingDown=createSvgIcon$1(factory$1("path",{d:"m16 18 2.29-2.29-4.88-4.88-4 4L2 7.41 3.41 6l6 6 4-4 6.3 6.29L22 12v6z"}),"TrendingDown"),TrendingUp=createSvgIcon$1(factory$1("path",{d:"m16 6 2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"}),"TrendingUp"),Warning$4=createSvgIcon$1(factory$1("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning"),baseRoutes=[{path:"/error_page",noHeader:!0,element:ErrorPage},{path:"/pine_page",noHeader:!0,element:QI(()=>__vitePreload(()=>import("./index-CnRuFJIf.js"),[]))}],dashboardRoutes=[{path:"/main",element:QI(()=>__vitePreload(()=>import("./index-C4dzv30q.js"),__vite__mapDeps([0,1,2])))},{path:"/overview",element:QI(()=>__vitePreload(()=>import("./index-J3hGIAw0.js"),__vite__mapDeps([3,2,4,5,6])))},{path:"/dashboard",tabs:[{label:"Backtest Measures",description:str.newline("KPI metrics computed from historical backtest simulation runs.","Includes success rate, trade performance, daily trade counts, and revenue aggregated across all symbols."),isActive:()=>!0,icon:HourglassTop,path:"/dashboard/backtest",navigate:()=>ioc.routerService.push("/dashboard/backtest")},{label:"Live Measures",description:str.newline("KPI metrics collected from real-time live trading activity.","Tracks live success rate, trade performance, daily trade counts, and revenue aggregated across all symbols."),isActive:()=>!1,icon:LiveTv,path:"/dashboard/live",navigate:()=>ioc.routerService.push("/dashboard/live")}],element:QI(()=>__vitePreload(()=>import("./index-1kyziIc7.js"),__vite__mapDeps([7,5,2,4])))},{path:"/dashboard/:mode",tabs:[{label:"Backtest Measures",description:str.newline("KPI metrics computed from historical backtest simulation runs.","Includes success rate, trade performance, daily trade counts, and revenue aggregated across all symbols."),isActive:({routeParams:e})=>"backtest"===e.mode,icon:HourglassTop,path:"/dashboard/backtest",navigate:()=>ioc.routerService.push("/dashboard/backtest")},{label:"Live Measures",description:str.newline("KPI metrics collected from real-time live trading activity.","Tracks live success rate, trade performance, daily trade counts, and revenue aggregated across all symbols."),isActive:({routeParams:e})=>"live"===e.mode,icon:LiveTv,path:"/dashboard/live",navigate:()=>ioc.routerService.push("/dashboard/live")}],element:QI(()=>__vitePreload(()=>import("./index-1kyziIc7.js"),__vite__mapDeps([7,5,2,4])))},{path:"/notifications",element:QI(()=>__vitePreload(()=>import("./index-CWErSuod.js"),__vite__mapDeps([8,2,4])))},{path:"/logs",element:QI(()=>__vitePreload(()=>import("./index-9YHmY3Zv.js"),__vite__mapDeps([9,10,2,4])))},{path:"/status",element:QI(()=>__vitePreload(()=>import("./index-Bg2qm7TJ.js"),__vite__mapDeps([11,12,5,2,4,6])))},{path:"/status/:id",element:QI(()=>__vitePreload(()=>import("./index-Bg2qm7TJ.js"),__vite__mapDeps([11,12,5,2,4,6])))},{path:"/report",element:QI(()=>__vitePreload(()=>import("./index-nfZ8sdZp.js"),__vite__mapDeps([13,12,5,2,4])))},{path:"/dump",element:QI(()=>__vitePreload(()=>import("./index-C8Wdopwt.js"),__vite__mapDeps([14,12,6,10,2,4])))},{path:"/dump/:search",element:QI(()=>__vitePreload(()=>import("./index-C8Wdopwt.js"),__vite__mapDeps([14,12,6,10,2,4])))},{path:"/heat",element:QI(()=>__vitePreload(()=>import("./index-3ZYgMfYi.js"),__vite__mapDeps([15,12,1,5,2,4])))},{path:"/price_chart",element:QI(()=>__vitePreload(()=>import("./index-BR0aHfoe.js"),__vite__mapDeps([16,12,5,2,4])))},{path:"/price_chart/:symbol",element:QI(()=>__vitePreload(()=>import("./index-BR0aHfoe.js"),__vite__mapDeps([16,12,5,2,4])))},{path:"/price_chart/:symbol/:interval",element:QI(()=>__vitePreload(()=>import("./index-BR0aHfoe.js"),__vite__mapDeps([16,12,5,2,4])))}],routes$m=[{path:"/",element:createRedirect(async()=>{ioc.routerService.push(await getMainRoute())})},...baseRoutes,...dashboardRoutes],getRouteItem=(()=>{let e=null,t=null;return()=>{const{pathname:n}=ioc.routerService.location;return e!==n&&(t=GS(routes$m,ioc.routerService.location.pathname),e=n),t}})();window.getRouteItem=getRouteItem;const IconWrapper=({icon:e,color:t})=>{const n=reactExports.useMemo(()=>alpha$2(lighten(t,.5),.42),[t]);return factory$1(Box$1,{sx:{background:n,padding:"6px",marginTop:"6px",marginBottom:"6px",marginLeft:"-2px",marginRight:"12px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},children:factory$1(e,{sx:{color:t}})})};var Warning$3={},_interopRequireDefault$1=interopRequireDefaultExports;Object.defineProperty(Warning$3,"__esModule",{value:!0});var default_1$1=Warning$3.default=void 0,_createSvgIcon$1=_interopRequireDefault$1(requireCreateSvgIcon()),_jsxRuntime$1=require$$2$1,_default$1=(0,_createSvgIcon$1.default)((0,_jsxRuntime$1.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning");default_1$1=Warning$3.default=_default$1;const Context=reactExports.createContext(null);function useUniquePrefix(){const[e,t]=reactExports.useState(null);return reactExports.useEffect(()=>{t(`mui-p-${Math.round(1e5*Math.random())}`)},[]),e}function TabContext(e){const{children:t,value:n}=e,r=useUniquePrefix(),o=reactExports.useMemo(()=>({idPrefix:r,value:n}),[r,n]);return factory$1(Context.Provider,{value:o,children:t})}function useTabContext(){return reactExports.useContext(Context)}function getPanelId(e,t){const{idPrefix:n}=e;return null===n?null:`${e.idPrefix}-P-${t}`}function getTabId(e,t){const{idPrefix:n}=e;return null===n?null:`${e.idPrefix}-T-${t}`}const _excluded=["children"],TabList=reactExports.forwardRef(function(e,t){const{children:n}=e,r=_objectWithoutPropertiesLoose(e,_excluded),o=useTabContext();if(null===o)throw new TypeError("No TabContext provided");const i=reactExports.Children.map(n,e=>reactExports.isValidElement(e)?reactExports.cloneElement(e,{"aria-controls":getPanelId(o,e.props.value),id:getTabId(o,e.props.value)}):null);return factory$1(Tabs,_extends({},r,{ref:t,value:o.value,children:i}))}),sanitize={allowCustomElements:!0,allowElements:["text-underline","blank-link"],allowAttributes:{href:["blank-link"]}};var Notifications={},_interopRequireDefault=interopRequireDefaultExports;Object.defineProperty(Notifications,"__esModule",{value:!0});var default_1=Notifications.default=void 0,_createSvgIcon=_interopRequireDefault(requireCreateSvgIcon()),_jsxRuntime=require$$2$1,_default=(0,_createSvgIcon.default)((0,_jsxRuntime.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"}),"Notifications");default_1=Notifications.default=_default;const reloadSubject=new ar,Loader$1=()=>factory$1(Dw,{sx:{width:350,height:"calc(100% - 96px)"}}),useStyles$s=makeStyles()(e=>({list:{pt:1,pb:1,"& > *":{paddingTop:0,paddingBottom:0,"& > *":{paddingTop:0,paddingBottom:0}}},listItemAccient:{background:alpha$2(e.palette.getContrastText(e.palette.background.paper),.018)}})),getNotificationColor$1=e=>{switch(e.type){case"signal.opened":case"activate_scheduled.commit":case"signal_sync.open":return"#4CAF50";case"signal.closed":case"signal_sync.close":return"#2196F3";case"signal.scheduled":case"average_buy.commit":case"error.info":case"error.validation":return"#FF9800";case"signal.cancelled":case"cancel_scheduled.commit":return"#9E9E9E";case"partial_profit.available":case"partial_profit.commit":return"#8BC34A";case"partial_loss.available":case"partial_loss.commit":return"#FF5722";case"breakeven.available":case"breakeven.commit":return"#00BCD4";case"trailing_stop.commit":case"trailing_take.commit":return"#673AB7";case"close_pending.commit":return"#607D8B";case"risk.rejection":return"#F44336";case"error.critical":return"#D32F2F";case"signal.info":return"#9C27B0";default:return}},getNotificationIcon$1=e=>{const t={color:"white",mt:"-1px"};switch(e.type){case"signal.opened":case"partial_profit.available":case"partial_profit.commit":return factory$1(TrendingUp,{sx:t});case"signal.closed":case"signal_sync.close":case"close_pending.commit":return factory$1(Close,{sx:t});case"signal.scheduled":return factory$1(Schedule,{sx:t});case"signal.cancelled":case"cancel_scheduled.commit":return factory$1(Cancel,{sx:t});case"partial_loss.available":case"partial_loss.commit":case"average_buy.commit":return factory$1(TrendingDown,{sx:t});case"breakeven.available":case"breakeven.commit":return factory$1(SwapVert,{sx:t});case"activate_scheduled.commit":case"signal_sync.open":return factory$1(PlayArrow,{sx:t});case"trailing_stop.commit":case"trailing_take.commit":return factory$1(Timeline,{sx:t});case"risk.rejection":return factory$1(ReportProblem,{sx:t});case"error.info":case"error.validation":case"signal.info":return factory$1(NotificationImportant,{sx:t});case"error.critical":return factory$1(ErrorIcon,{sx:t});default:return factory$1(default_1$1,{sx:{...t,mt:"-2px"}})}},getNotificationTitle$1=e=>{switch(e.type){case"signal.opened":return`${t$1("Opened")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal.closed":return`${t$1("Closed")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;case"signal.scheduled":return`${t$1("Scheduled")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal.cancelled":return`${t$1("Cancelled")} ${e.symbol}`;case"partial_profit.available":return`${t$1("Partial profit")} ${e.level}% ${e.symbol}`;case"partial_profit.commit":return`${t$1("Profit fixed")} ${e.percentToClose}% ${e.symbol}`;case"partial_loss.available":return`${t$1("Partial loss")} ${e.level}% ${e.symbol}`;case"partial_loss.commit":return`${t$1("Loss fixed")} ${e.percentToClose}% ${e.symbol}`;case"breakeven.available":return`${t$1("Breakeven available")} ${e.symbol}`;case"breakeven.commit":return`${t$1("Breakeven set")} ${e.symbol}`;case"activate_scheduled.commit":return`${t$1("Activated")} ${e.position.toUpperCase()} ${e.symbol}`;case"average_buy.commit":return`${t$1("Average Buy")} ${e.symbol}`;case"trailing_stop.commit":return`${t$1("Trailing stop")} ${e.symbol}`;case"trailing_take.commit":return`${t$1("Trailing take")} ${e.symbol}`;case"signal_sync.open":return`${t$1("Sync Open")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal_sync.close":return`${t$1("Sync Close")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;case"cancel_scheduled.commit":return`${t$1("Cancel Scheduled")} ${e.symbol}`;case"close_pending.commit":return`${t$1("Close Pending")} ${e.symbol}`;case"risk.rejection":return`${t$1("Rejected")} ${e.position.toUpperCase()} ${e.symbol}`;case"error.info":return`${t$1("Error")}: ${e.message}`;case"error.validation":return`${t$1("Validation")}: ${e.message}`;case"error.critical":return`${t$1("Critical")}: ${e.message}`;case"signal.info":return`${t$1("Signal Info")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;default:return`${t$1("Unknown")} ${lodashExports.get(e,"type")}`}},handleNotificationClick$1=e=>{switch(e.type){case"risk.rejection":ioc.layoutService.pickRisk(e.id);break;case"signal.opened":ioc.layoutService.pickSignalOpened(e.id);break;case"signal.closed":ioc.layoutService.pickSignalClosed(e.id);break;case"signal.scheduled":ioc.layoutService.pickSignalScheduled(e.id);break;case"signal.cancelled":ioc.layoutService.pickSignalCancelled(e.id);break;case"partial_profit.available":ioc.layoutService.pickPartialProfitAvailable(e.id);break;case"partial_profit.commit":ioc.layoutService.pickPartialProfitCommit(e.id);break;case"partial_loss.available":ioc.layoutService.pickPartialLossAvailable(e.id);break;case"partial_loss.commit":ioc.layoutService.pickPartialLossCommit(e.id);break;case"breakeven.available":ioc.layoutService.pickBreakevenAvailable(e.id);break;case"breakeven.commit":ioc.layoutService.pickBreakevenCommit(e.id);break;case"trailing_stop.commit":ioc.layoutService.pickTrailingStop(e.id);break;case"trailing_take.commit":ioc.layoutService.pickTrailingTake(e.id);break;case"activate_scheduled.commit":ioc.layoutService.pickActivateScheduled(e.id);break;case"average_buy.commit":ioc.layoutService.pickAverageBuyCommit(e.id);break;case"signal_sync.open":ioc.layoutService.pickSignalSyncOpen(e.id);break;case"signal_sync.close":ioc.layoutService.pickSignalSyncClose(e.id);break;case"cancel_scheduled.commit":ioc.layoutService.pickCancelScheduled(e.id);break;case"close_pending.commit":ioc.layoutService.pickClosePending(e.id);break;case"signal.info":ioc.layoutService.pickSignalNotify(e.id)}},NotificationView$1=()=>{const[e,t]=reactExports.useState(),{classes:n}=useStyles$s(),[r,o]=reactExports.useState(0),[i,a]=reactExports.useState("all");return factory$1(Fragment,{children:[factory$1(Zl,{onClick:async({currentTarget:e})=>{reloadSubject.next(),t(e)},onLoadStart:()=>o(e=>e+1),onLoadEnd:()=>o(e=>e-1),color:"inherit",sx:{ml:{xs:1,md:2},mr:{xs:1,sm:2}},children:factory$1(Tooltip$2,{title:t$1("Notifications"),children:factory$1(default_1,{sx:{color:"white !important",opacity:r?.8:1}})})}),factory$1(Popover$1,{open:!!e,anchorEl:e,hidden:!1,onClose:()=>{t(null),a("all")},anchorOrigin:{vertical:"bottom",horizontal:"right"},children:factory$1(TabContext,{value:i,children:factory$1(List,{sx:{width:350,height:448},subheader:factory$1(Stack,{direction:"row",justifyContent:"space-between",children:[factory$1(ListSubheader,{component:Typography,sx:{fontWeight:"bold"},children:t$1("all"===i?"All":"Signals")}),factory$1(TabList,{onChange:(e,t)=>a(t),sx:{"& .MuiTabs-indicator":{background:"#3F51B5 !important"}},color:"secondary",variant:"standard",children:[factory$1(Tab,{icon:factory$1(ManageSearch,{}),value:"all"}),factory$1(Tab,{icon:factory$1(TrendingUp,{}),value:"signals"})]})]}),children:["all"===i&&factory$1(Jr,{Loader:Loader$1,children:async()=>{const e=await ioc.notificationViewService.getList();return factory$1(vi$1,{className:n.list,sx:{width:350,height:"calc(100% - 48px)"},children:e.map((e,r)=>factory$1(ListItem,{className:clsx$2({[n.listItemAccient]:r%2==0}),disableGutters:!0,children:factory$1(ListItemButton,{onClick:()=>{handleNotificationClick$1(e),t(null)},children:[factory$1(ListItemAvatar,{children:factory$1(Avatar,{sx:{background:getNotificationColor$1(e)},children:getNotificationIcon$1(e)})}),factory$1(ListItemText,{primary:factory$1(DE,{config:sanitize,handler:()=>getNotificationTitle$1(e)}),secondary:"timestamp"in e?J$2(e.timestamp).format("HH:mm DD/MM/YYYY"):"N/A"}),factory$1(IconButton,{disableRipple:!0,children:factory$1(default_1$k,{})})]})},e.id))})}}),"signals"===i&&factory$1(Jr,{Loader:Loader$1,children:async()=>{const e=(await ioc.notificationViewService.getList()).filter(e=>e.type.startsWith("signal.")||e.type.startsWith("signal_sync."));return factory$1(vi$1,{className:n.list,sx:{width:350,height:"calc(100% - 48px)"},children:e.map((e,r)=>factory$1(ListItem,{className:clsx$2({[n.listItemAccient]:r%2==0}),disableGutters:!0,children:factory$1(ListItemButton,{onClick:()=>{handleNotificationClick$1(e),t(null)},children:[factory$1(ListItemAvatar,{children:factory$1(Avatar,{sx:{background:getNotificationColor$1(e)},children:getNotificationIcon$1(e)})}),factory$1(ListItemText,{primary:factory$1(DE,{config:sanitize,handler:()=>getNotificationTitle$1(e)}),secondary:"timestamp"in e?J$2(e.timestamp).format("HH:mm DD/MM/YYYY"):"N/A"}),factory$1(IconButton,{disableRipple:!0,children:factory$1(default_1$k,{})})]})},e.id))})}})]})})})]})},Tooltip=({description:e,placement:t="left",children:n})=>{const{isDesktop:r}=tl(),o=reactExports.useMemo(()=>({popper:{sx:{pointerEvents:"none"},modifiers:r?[{name:"fallbackPlacements",options:{fallbackPlacements:["right","top","bottom"]}}]:void 0},tooltip:{sx:{background:"black",p:1.5,fontSize:"16px"}},arrow:{sx:{color:"black"}}}),[r]),i=reactExports.useMemo(()=>({placement:r?t:void 0}),[r,t]);return factory$1(Tooltip$2,{title:e,slotProps:o,...i,arrow:!0,children:n})},LOADER_HEIGHT=4,TAB_ACTION_PREFIX="tab-action-",LOGO_SRC="/logo/icon512_maskable.png",LOGO_CLASS="backtest-kit-logo",LOGO_SIDE=32,HEADER_HEIGHT$3="80px",MARGIN_BOTTOM="10px",useStyles$r=makeStyles()(e=>({root:{position:"sticky",top:0,zIndex:9,height:HEADER_HEIGHT$3,display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"},container:{flex:1,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"8px",paddingRight:"8px",position:"relative",marginBottom:MARGIN_BOTTOM,alignItems:"center",backdropFilter:"saturate(180%) blur(20px)",backgroundColor:alpha$2(darken$1(e.palette.primary.main,.2),.8),"&:hover":{[`& .${LOGO_CLASS}`]:{opacity:1}}},title:{color:"white",paddingLeft:e.spacing(1),paddingRight:e.spacing(3),transition:"opacity 500ms",opacity:"0.8",cursor:"pointer",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold"},loader:{position:"absolute",bottom:0,left:0,width:"100%",minHeight:`${LOADER_HEIGHT}px`,maxHeight:`${LOADER_HEIGHT}px`,marginTop:`-${LOADER_HEIGHT}px`,zIndex:2},logo:{transition:"opacity 500ms",marginLeft:"8px",marginRight:"-6px",opacity:"0.5"},actionMenu:{"& svg":{color:"white"}},stretch:{flex:1},tabsRoot:{minHeight:`calc(${HEADER_HEIGHT$3} - ${MARGIN_BOTTOM})`,height:`calc(${HEADER_HEIGHT$3} - ${MARGIN_BOTTOM})`,color:"white"},tabRoot:{minHeight:`calc(${HEADER_HEIGHT$3} - ${MARGIN_BOTTOM})`,height:`calc(${HEADER_HEIGHT$3} - ${MARGIN_BOTTOM})`,color:"white"},tabIndicator:{height:"4px",background:"white"}})),default_actions=[{action:"github-action",icon:()=>factory$1(IconWrapper,{icon:GitHub,color:"#6A1B9A "}),label:"Open GitHub"}],AppHeader=({routeItem:e,routeParams:t,pathname:n,loading:r})=>{const{classes:o,cx:i}=useStyles$r(),{activeTabPath:a,tabs:s}=reactExports.useMemo(()=>{if(!e.tabs)return{tabs:[],activeTabPath:""};const r=e.tabs.find(({isActive:r})=>r({routeItem:e,routeParams:t,pathname:n}));return{activeTabPath:(null==r?void 0:r.path)??"",tabs:e.tabs}},[e,t,n]),l=reactExports.useMemo(()=>a?s.filter(({isActive:r})=>!r({pathname:n,routeItem:e,routeParams:t})).map(({label:e,icon:t},n)=>({label:e,action:`${TAB_ACTION_PREFIX}${n}`,icon:t?()=>factory$1(IconWrapper,{icon:t,color:"#4caf50"}):void 0})):default_actions,[a,s]);if(e.noHeader)return null;return factory$1(Box$1,{className:o.root,children:factory$1(Box$1,{className:o.container,children:[factory$1(rb,{onClick:()=>ioc.routerService.push("/main"),className:i(o.logo,LOGO_CLASS),children:factory$1(Avatar,{style:{height:LOGO_SIDE,width:LOGO_SIDE},src:LOGO_SRC})}),factory$1(Typography,{variant:"h4",onClick:()=>ioc.routerService.push("/main"),className:i(o.title,LOGO_CLASS),sx:{display:{xs:"none",sm:"flex"},whiteSpace:"nowrap"},children:"Backtest Kit"}),s.length?factory$1(Tabs,{variant:"scrollable",value:a,textColor:"inherit",sx:{display:{xs:"none",sm:"flex"}},classes:{root:o.tabsRoot,indicator:o.tabIndicator},children:s.filter(({visible:e=!0})=>e).map(({label:r,icon:i,disabled:a,path:s,description:l,navigate:c},u,d)=>factory$1(Tab,{sx:{minWidth:128,fontWeight:"bold",mr:u<d.length-1?2:0},value:s,label:factory$1(Tooltip,{description:l,placement:"bottom",children:factory$1(Typography,{variant:"h6",children:r})}),onClick:()=>c({routeItem:e,routeParams:t,pathname:n}),disabled:a,icon:i&&factory$1(i,{}),iconPosition:"start",classes:{root:o.tabRoot}},`${s}-${u}`))},e.path):null,factory$1("div",{className:o.stretch}),factory$1(NotificationView$1,{}),factory$1(xa,{className:o.actionMenu,sx:{ml:{xs:1,md:2},mr:{xs:1,sm:2}},transparent:!0,onAction:async r=>{"github-action"===r&&ak("https://github.com/tripolskypetr/backtest-kit"),r.startsWith(TAB_ACTION_PREFIX)&&(r=>{const o=parseInt(r.slice(TAB_ACTION_PREFIX.length)),i=s.filter(({isActive:r})=>!r({pathname:n,routeItem:e,routeParams:t})).find((e,t)=>t===o);i&&i.navigate({routeItem:e,routeParams:t,pathname:n})})(r)},options:l}),!!r&&factory$1(LinearProgress,{className:o.loader})]})})};var define_process_env_default$1={},noop=function(){},_process$env;function createGetCachedLinkHref(){var e,t=getCreateObjectURL(),n=null;return function(r){return r===n?e:(t===noop&&(t=getCreateObjectURL()),e=(n=r)?t(new Blob([r],{type:"text/css"})):void 0)}}function getCreateObjectURL(){return"undefined"==typeof window?noop:(window.URL||window.webkitURL).createObjectURL||noop}var IS_PRODUCTION=void 0!==process$1&&"production"===(null==(_process$env=define_process_env_default$1)?void 0:_process$env.NODE_ENV),DEFAULT_OPTIONS={hasSourceMap:!IS_PRODUCTION,isMinified:IS_PRODUCTION,isPrefixed:!0},globalOptions=Object.assign({},DEFAULT_OPTIONS),hasOwnProperty=Object.prototype.hasOwnProperty;function normalizeOptions(e){var t,n=Object.assign({},globalOptions);for(t in e)hasOwnProperty.call(n,t)&&null!=e[t]&&(n[t]=!!e[t]);return n}function isName(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"-_*.:#[]".indexOf(e)>=0}function isQuote(e){return"'"===e||'"'===e}function isWhitespace$1(e){return" "===e||"\n"===e||"\t"===e||"\r"===e||"\f"===e}function beautify(e,t){void 0===t&&(t={}),e=e.replace(/\r\n/g,"\n");var n,r,o,i,a=t,s=a.autosemicolon,l=void 0!==s&&s,c=a.indent,u=void 0===c?" ":c,d=a.openbrace,p=void 0===d||d,h=0,f=e.length,A=[],m="",g=0,y=1,v=2,b=3,x=4,w=5,C=6,$=7,_=8,S=g,E=0,k=!1;function B(){for(var e=E;e>0;--e)m+=u}function P(){m=m.trimEnd(),p?m+=" {":(m+="\n",B(),m+="{"),"\n"!==r&&(m+="\n"),E+=1}function T(){var e;E-=1,(m=m.trimEnd()).length>0&&l&&";"!==(e=m.charAt(m.length-1))&&"{"!==e&&(m+=";"),m+="\n",B(),m+="}",A.push(m),m=""}for(;h<f;)if(n=e.charAt(h),r=e.charAt(h+1),++h,isQuote(i))m+=n,n===i&&(i=null),"\\"===n&&r===i&&(m+=r,++h);else if(isQuote(n))m+=n,i=n;else if(k)m+=n,"*"===n&&"/"===r&&(k=!1,m+=r,++h);else if("/"!==n||"*"!==r){if(S===g){if(0===A.length&&isWhitespace$1(n)&&0===m.length)continue;if(n<=" "||n.charCodeAt(0)>=128){S=g,m+=n;continue}if(isName(n)||"@"===n){if(0===(o=m.trimEnd()).length)A.length>0&&(m="\n\n");else{var I=o.charAt(o.length-1);if("}"===I||";"===I)m=o+"\n\n";else for(;" "===(r=m.charAt(m.length-1))||9===r.charCodeAt(0);)m=m.substr(0,m.length-1)}m+=n,S="@"===n?y:b;continue}}if(S!==y)if(S!==v)if(S!==b)if(S!==x)if(S!==w)if(S!==C)if(S!==$)S===_&&")"===n&&m.charAt(m.length-1!=="\\"?1:0)?(m+=n,S=$):m+=n;else{if("}"===n){T(),S=g,E>0&&(S=v);continue}if(";"===n){m=m.trimEnd(),m+=";\n",S=x;continue}if(m+=n,"("===n&&"l"===m.charAt(m.length-2)&&"r"===m.charAt(m.length-3)&&"u"===m.charAt(m.length-4)){S=_;continue}}else{if(!isWhitespace$1(n)){m+=n,S=$;continue}isQuote(r)&&(S=$)}else{if(":"===n){m=m.trimEnd(),m+=": ",S=$,isWhitespace$1(r)&&(S=C);continue}if("}"===n){T(),S=g,E>0&&(S=v);continue}m+=n}else{if("}"===n){T(),S=g,E>0&&(S=v);continue}if("\n"===n){m=m.trimEnd(),m+="\n";continue}if(!isWhitespace$1(n)){m=m.trimEnd(),m+="\n",B(),m+=n,S=w;continue}m+=n}else{if("{"===n){P(),S=x;continue}if("}"===n){T(),S=g;continue}m+=n}else{if(isName(n)){if(0===(o=m.trimEnd()).length)A.length>0&&(m="\n\n");else if("}"===o.charAt(o.length-1))m=o+"\n\n";else for(;" "===(r=m.charAt(m.length-1))||9===r.charCodeAt(0);)m=m.substr(0,m.length-1);B(),m+=n,S=b;continue}if("}"===n){T(),S=g;continue}m+=n}else{if(";"===n){m+=n,S=g;continue}if("{"===n){o=m.trimEnd(),P(),S="@font-face"===o?x:v;continue}m+=n}}else k=!0,m+=n,m+=r,++h;return m=A.join("")+m}function getProcessedStyles(e,t){return serialize(compile$1(e),t.isPrefixed?middleware([prefixer$1,stringify$8]):stringify$8)}function getRenderedStyles(e,t){var n=getProcessedStyles(e,t);return t.isMinified?n:beautify(n,{autosemicolon:!0,indent:" "})}var INTERNAL_PROPS={children:!0,hasSourceMap:!0,isMinified:!0,isPrefixed:!0};function useTagProps(e){var t={};for(var n in e)INTERNAL_PROPS[n]||(t[n]=e[n]);return t}function useStyle(e,t){var n=reactExports.useRef(e),r=reactExports.useRef();return r.current&&n.current===e||(r.current=getRenderedStyles(e,t),n.current=e),r.current}var Link=reactExports.forwardRef(function(e,t){var n=e.passedProps,r=e.style,o=reactExports.useMemo(createGetCachedLinkHref,[]);return reactExports.createElement("link",Object.assign({},n,{href:o(r),rel:"stylesheet",ref:t}))}),Style=reactExports.forwardRef(function(e,t){var n=e.hasSourceMap,r=e.isMinified,o=e.isPrefixed,i=useTagProps(e),a=reactExports.useMemo(function(){return normalizeOptions({hasSourceMap:n,isMinified:r,isPrefixed:o})},[n,r,o]),s=useStyle(e.children,a);return a.hasSourceMap?reactDomExports.createPortal(reactExports.createElement(Link,{passedProps:i,ref:t,style:s}),document.head):reactDomExports.createPortal(reactExports.createElement("style",Object.assign({},i,{ref:t}),s),document.head)});const IMAGE_SIDE="5vmin",IMAGE_LIST=["/images/cubes.png","/images/snow.png","/images/square.png","/images/triangle.png","/images/dots.png"],randomImage=()=>{const e=Math.floor(Date.now()/1e3/60)%IMAGE_LIST.length;return IMAGE_LIST[e]},BottomImage=()=>{const[e,t]=reactExports.useState(()=>randomImage());return reactExports.useEffect(()=>mr.fromInterval(6e4).connect(()=>t(randomImage())),[]),factory$1(Style,{children:`\n body {\n background-position: top calc(100vh - ${IMAGE_SIDE} - 24px) right 24px !important;\n background-size: ${IMAGE_SIDE}, auto, contain !important;\n background-image: url("${e}") !important;\n }\n `})},Loader=()=>factory$1(Box$1,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,height:"100vh",width:"100vw",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,background:e=>e.palette.background.paper},children:factory$1(eS,{})}),Fragment2=()=>factory$1(Fragment,{}),useStyles$q=makeStyles()(e=>({switch:{paddingLeft:e.spacing(1),paddingRight:e.spacing(1)}})),handleInit=so(async()=>{await WS.waitForProvide(!0),await WS.prefetch(!0)}),handleLoadStart=()=>{ioc.layoutService.setAppbarLoader(!0)},handleLoadEnd=()=>{ioc.layoutService.setAppbarLoader(!1)},App=()=>{const{classes:e}=useStyles$q(),[t,n]=reactExports.useState(()=>getRouteItem()),[r,o]=reactExports.useState(()=>KS(routes$m,ioc.routerService.location.pathname)),[i,a]=reactExports.useState(ioc.routerService.location.pathname),[s,l]=reactExports.useState(ioc.layoutService.hasAppbarLoader),[c,u]=reactExports.useState(ioc.layoutService.hasModalLoader);return Xf(()=>ioc.routerService.reloadSubject.subscribe(()=>{queueMicrotask(()=>reactDomExports.flushSync(()=>{n(getRouteItem()),o(KS(routes$m,ioc.routerService.location.pathname)),a(ioc.routerService.location.pathname)}))})),Xf(()=>ioc.layoutService.appbarSubject.subscribe(()=>{l(ioc.layoutService.hasAppbarLoader)})),Xf(()=>ioc.layoutService.modalSubject.subscribe(()=>{u(ioc.layoutService.hasModalLoader)})),factory$1(Fragment,{children:[!!t&&factory$1(AppHeader,{pathname:i,routeItem:t,routeParams:r,loading:s}),factory$1(Gg,{className:e.switch,Loader:Fragment2,history:ioc.routerService,items:routes$m,fallback:ioc.errorService.handleGlobalError,onLoadStart:handleLoadStart,onLoadEnd:handleLoadEnd,onInit:handleInit}),c&&factory$1(Loader,{}),factory$1(BottomImage,{})]})},lightPrimary={main:"#3F51B5",light:"#4E65C9"},lightSecondary={main:"#2196F3"},lightError={main:"#ec4c47"},lightWarning={main:"#d9822b"},lightInfo={main:"#1070CA"},lightSuccess={main:"#27AB6E"},lightBackground={muiTab:"#6974b066",muiAppBar:"#6974B0"},lightText={primary:"#000000DE",secondary:"#00000099",disabled:"#cccccc"},BREAKPOINTS={xs:0,sm:800,md:1100,lg:1300,xl:1736},muiTheme=createTheme$1({breakpoints:{values:BREAKPOINTS},palette:{mode:"light",primary:{main:lightPrimary.main},secondary:{main:lightSecondary.main},warning:{main:lightWarning.main},info:{main:lightInfo.main},success:{main:lightSuccess.main},error:{main:lightError.main},text:{primary:lightText.primary,secondary:lightText.secondary,disabled:lightText.disabled},background:{default:"#E8E9ED !important",paper:"#fff"}},shape:{borderRadius:12},shadows:["none","0px 1px 2px rgba(0, 0, 0, 0.1)","0px 2px 4px rgba(0, 0, 0, 0.1)","0px 3px 6px rgba(0, 0, 0, 0.2)","0px 4px 8px rgba(0, 0, 0, 0.2)","0px 5px 10px rgba(0, 0, 0, 0.3)","0px 6px 12px rgba(0, 0, 0, 0.3)","0px 7px 14px rgba(0, 0, 0, 0.4)","0px 8px 16px rgba(0, 0, 0, 0.4)","0px 9px 18px rgba(0, 0, 0, 0.5)","0px 10px 20px rgba(0, 0, 0, 0.5)","0px 11px 22px rgba(0, 0, 0, 0.6)","0px 12px 24px rgba(0, 0, 0, 0.6)","0px 13px 26px rgba(0, 0, 0, 0.7)","0px 14px 28px rgba(0, 0, 0, 0.7)","0px 15px 30px rgba(0, 0, 0, 0.8)","0px 16px 32px rgba(0, 0, 0, 0.8)","0px 17px 34px rgba(0, 0, 0, 0.9)","0px 18px 36px rgba(0, 0, 0, 0.9)","0px 19px 38px rgba(0, 0, 0, 1)","0px 20px 40px rgba(0, 0, 0, 1)","0px 21px 42px rgba(0, 0, 0, 1)","0px 22px 44px rgba(0, 0, 0, 1)","0px 23px 46px rgba(0, 0, 0, 1)","0px 24px 48px rgba(0, 0, 0, 1)"],components:{MuiModal:{styleOverrides:{backdrop:{backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)"}}},MuiPaper:{defaultProps:{elevation:3},styleOverrides:{root:{borderRadius:"12px",backgroundColor:"#ffffff",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.1)"}}},MuiCard:{styleOverrides:{root:{overflow:"clip"}}},MuiAppBar:{styleOverrides:{root:{background:lightBackground.muiAppBar}}},MuiTab:{styleOverrides:{fullWidth:{background:lightBackground.muiTab,color:"white !important",fontWeight:"bold"}}},MuiIconButton:{styleOverrides:{root:{borderRadius:6,padding:8},sizeSmall:{padding:4}}},MuiButton:{styleOverrides:{contained:{background:lightPrimary.main,"&:hover":{background:lightPrimary.light}}}},MuiBadge:{styleOverrides:{badge:{background:"#2e41a9"}}},MuiSnackbar:{styleOverrides:{root:{boxShadow:"none",border:"unset","& > *":{color:"black !important"},"& > .MuiPaper-root":{border:"1px solid black",borderRadius:"12px",boxShadow:"0 0 5px 2px grey"}}}}}}),mantineTheme=createTheme({});function getNextIndex({direction:e,levelIndex:t,rowIndex:n,cellIndex:r,size:o}){switch(e){case"up":return 0===t&&0===n?null:0===n?{levelIndex:t-1,rowIndex:r<=o[t-1][o[t-1].length-1]-1?o[t-1].length-1:o[t-1].length-2,cellIndex:r}:{levelIndex:t,rowIndex:n-1,cellIndex:r};case"down":return n===o[t].length-1||n===o[t].length-2&&r>=o[t][o[t].length-1]?{levelIndex:t+1,rowIndex:0,cellIndex:r}:{levelIndex:t,rowIndex:n+1,cellIndex:r};case"left":return 0===t&&0===n&&0===r?null:0===n&&0===r?{levelIndex:t-1,rowIndex:o[t-1].length-1,cellIndex:o[t-1][o[t-1].length-1]-1}:0===r?{levelIndex:t,rowIndex:n-1,cellIndex:o[t][n-1]-1}:{levelIndex:t,rowIndex:n,cellIndex:r-1};case"right":return n===o[t].length-1&&r===o[t][n]-1?{levelIndex:t+1,rowIndex:0,cellIndex:0}:r===o[t][n]-1?{levelIndex:t,rowIndex:n+1,cellIndex:0}:{levelIndex:t,rowIndex:n,cellIndex:r+1};default:return{levelIndex:t,rowIndex:n,cellIndex:r}}}function focusOnNextFocusableControl({controlsRef:e,direction:t,levelIndex:n,rowIndex:r,cellIndex:o,size:i}){var a,s,l;const c=getNextIndex({direction:t,size:i,rowIndex:r,cellIndex:o,levelIndex:n});if(!c)return;const u=null==(l=null==(s=null==(a=e.current)?void 0:a[c.levelIndex])?void 0:s[c.rowIndex])?void 0:l[c.cellIndex];u&&(u.disabled||u.getAttribute("data-hidden")||u.getAttribute("data-outside")?focusOnNextFocusableControl({controlsRef:e,direction:t,levelIndex:c.levelIndex,cellIndex:c.cellIndex,rowIndex:c.rowIndex,size:i}):u.focus())}function getDirection(e){switch(e){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function getControlsSize(e){var t;return null==(t=e.current)?void 0:t.map(e=>e.map(e=>e.length))}function handleControlKeyDown({controlsRef:e,levelIndex:t,rowIndex:n,cellIndex:r,event:o}){const i=getDirection(o.key);if(i){o.preventDefault();focusOnNextFocusableControl({controlsRef:e,direction:i,levelIndex:t,rowIndex:n,cellIndex:r,size:getControlsSize(e)})}}function assignTime(e,t){if(!e||!t)return t;const n=e.getHours(),r=e.getMinutes(),o=e.getSeconds(),i=e.getMilliseconds(),a=new Date(t);return a.setHours(n),a.setMinutes(r),a.setSeconds(o),a.setMilliseconds(i),a}var timezone={exports:{}};timezone.exports=function(){var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,o){var i,a=function(e,n,r){void 0===r&&(r={});var o=new Date(e);return function(e,n){void 0===n&&(n={});var r=n.timeZoneName||"short",o=e+"|"+r,i=t[o];return i||(i=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:r}),t[o]=i),i}(n,r).formatToParts(o)},s=function(t,n){for(var r=a(t,n),i=[],s=0;s<r.length;s+=1){var l=r[s],c=l.type,u=l.value,d=e[c];d>=0&&(i[d]=parseInt(u,10))}var p=i[3],h=24===p?0:p,f=i[0]+"-"+i[1]+"-"+i[2]+" "+h+":"+i[4]+":"+i[5]+":000",A=+t;return(o.utc(f).valueOf()-(A-=A%1e3))/6e4},l=r.prototype;l.tz=function(e,t){void 0===e&&(e=i);var n,r=this.utcOffset(),a=this.toDate(),s=a.toLocaleString("en-US",{timeZone:e}),l=Math.round((a-new Date(s))/1e3/60),c=15*-Math.round(a.getTimezoneOffset()/15)-l;if(Number(c)){if(n=o(s,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(c,!0),t){var u=n.utcOffset();n=n.add(r-u,"minute")}}else n=this.utcOffset(0,t);return n.$x.$timezone=e,n},l.offsetName=function(e){var t=this.$x.$timezone||o.tz.guess(),n=a(this.valueOf(),t,{timeZoneName:e}).find(function(e){return"timezonename"===e.type.toLowerCase()});return n&&n.value};var c=l.startOf;l.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var n=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return c.call(n,e,t).tz(this.$x.$timezone,!0)},o.tz=function(e,t,n){var r=n&&t,a=n||t||i,l=s(+o(),a);if("string"!=typeof e)return o(e).tz(a);var c=function(e,t,n){var r=e-60*t*1e3,o=s(r,n);if(t===o)return[r,t];var i=s(r-=60*(o-t)*1e3,n);return o===i?[r,o]:[e-60*Math.min(o,i)*1e3,Math.max(o,i)]}(o.utc(e,r).valueOf(),l,a),u=c[0],d=c[1],p=o(u).utcOffset(d);return p.$x.$timezone=a,p},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(e){i=e}}}();var timezoneExports=timezone.exports;const timezonePlugin=getDefaultExportFromCjs$1(timezoneExports);function getTimezoneOffset(e,t){return t?J$2(e).tz(t).utcOffset()+e.getTimezoneOffset():0}J$2.extend(utcPlugin),J$2.extend(timezonePlugin);const updateTimezone=(e,t,n)=>{if(!e)return null;if(!t)return e;let r=getTimezoneOffset(e,t);return"remove"===n&&(r*=-1),J$2(e).add(r,"minutes").toDate()};function shiftTimezone(e,t,n,r){return r||!t?t:Array.isArray(t)?t.map(t=>updateTimezone(t,n,e)):updateTimezone(t,n,e)}const DATES_PROVIDER_DEFAULT_SETTINGS={locale:"en",timezone:null,firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},DatesProviderContext=reactExports.createContext(DATES_PROVIDER_DEFAULT_SETTINGS);function useDatesContext(){const e=reactExports.useContext(DatesProviderContext),t=reactExports.useCallback(t=>t||e.locale,[e.locale]),n=reactExports.useCallback(t=>t||e.timezone||void 0,[e.timezone]),r=reactExports.useCallback(t=>"number"==typeof t?t:e.firstDayOfWeek,[e.firstDayOfWeek]),o=reactExports.useCallback(t=>Array.isArray(t)?t:e.weekendDays,[e.weekendDays]),i=reactExports.useCallback(t=>"string"==typeof t?t:e.labelSeparator,[e.labelSeparator]);return{...e,getLocale:t,getTimezone:n,getFirstDayOfWeek:r,getWeekendDays:o,getLabelSeparator:i}}function formatValue(e,t){if("range"===t&&Array.isArray(e)){const[t,n]=e;return t?n?`${t.toISOString()} – ${n.toISOString()}`:`${t.toISOString()} –`:""}return"multiple"===t&&Array.isArray(e)?e.map(e=>null==e?void 0:e.toISOString()).filter(Boolean).join(", "):!Array.isArray(e)&&e?e.toISOString():""}function HiddenDatesInput({value:e,type:t,name:n,form:r}){return factory$1("input",{type:"hidden",value:formatValue(e,t),name:n,form:r})}HiddenDatesInput.displayName="@mantine/dates/HiddenDatesInput";var classes$7={day:"m_396ce5cb"};const defaultProps$f={},varsResolver$3=createVarsResolver((e,{size:t})=>({day:{"--day-size":getSize(t,"day-size")}})),Day=factory((e,t)=>{const n=useProps("Day",defaultProps$f,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,date:c,disabled:u,__staticSelector:d,weekend:p,outside:h,selected:f,renderDay:A,inRange:m,firstInRange:g,lastInRange:y,hidden:v,static:b,highlightToday:x,...w}=n,C=useStyles$u({name:d||"Day",classes:classes$7,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$3,rootSelector:"day"}),$=useDatesContext();return factory$1(UnstyledButton,{...C("day",{style:v?{display:"none"}:void 0}),component:b?"div":"button",ref:t,disabled:u,"data-today":J$2(c).isSame(shiftTimezone("add",new Date,$.getTimezone()),"day")||void 0,"data-hidden":v||void 0,"data-highlight-today":x||void 0,"data-disabled":u||void 0,"data-weekend":!u&&!h&&p||void 0,"data-outside":!u&&h||void 0,"data-selected":!u&&f||void 0,"data-in-range":m&&!u||void 0,"data-first-in-range":g&&!u||void 0,"data-last-in-range":y&&!u||void 0,"data-static":b||void 0,unstyled:s,...w,children:(null==A?void 0:A(c))||c.getDate()})});function getWeekdayNames({locale:e,format:t="dd",firstDayOfWeek:n=1}){const r=J$2().day(n),o=[];for(let i=0;i<7;i+=1)"string"==typeof t?o.push(J$2(r).add(i,"days").locale(e).format(t)):o.push(t(J$2(r).add(i,"days").toDate()));return o}Day.classes=classes$7,Day.displayName="@mantine/dates/Day";var classes$6={weekday:"m_18a3eca"};const defaultProps$e={},varsResolver$2=createVarsResolver((e,{size:t})=>({weekdaysRow:{"--wr-fz":getFontSize(t),"--wr-spacing":getSpacing(t)}})),WeekdaysRow=factory((e,t)=>{const n=useProps("WeekdaysRow",defaultProps$e,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,locale:c,firstDayOfWeek:u,weekdayFormat:d,cellComponent:p="th",__staticSelector:h,...f}=n,A=useStyles$u({name:h||"WeekdaysRow",classes:classes$6,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$2,rootSelector:"weekdaysRow"}),m=useDatesContext(),g=getWeekdayNames({locale:m.getLocale(c),format:d,firstDayOfWeek:m.getFirstDayOfWeek(u)}).map((e,t)=>factory$1(p,{...A("weekday"),children:e}));return factory$1(Box,{component:"tr",ref:t,...A("weekdaysRow"),...f,children:g})});function getEndOfWeek(e,t=1){const n=new Date(e),r=0===t?6:t-1;for(;n.getDay()!==r;)n.setDate(n.getDate()+1);return n}function getStartOfWeek(e,t=1){const n=new Date(e);for(;n.getDay()!==t;)n.setDate(n.getDate()-1);return n}function getMonthDays({month:e,firstDayOfWeek:t=1,consistentWeeks:n}){const r=e.getMonth(),o=new Date(e.getFullYear(),r,1),i=getEndOfWeek(new Date(e.getFullYear(),e.getMonth()+1,0),t),a=getStartOfWeek(o,t),s=[];for(;a<=i;){const e=[];for(let t=0;t<7;t+=1)e.push(new Date(a)),a.setDate(a.getDate()+1);s.push(e)}if(n&&s.length<6){const e=s[s.length-1],t=e[e.length-1],n=new Date(t);for(n.setDate(n.getDate()+1);s.length<6;){const e=[];for(let t=0;t<7;t+=1)e.push(new Date(n)),n.setDate(n.getDate()+1);s.push(e)}}return s}function isSameMonth(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function isAfterMinDate(e,t){return!(t instanceof Date)||J$2(e).isAfter(J$2(t).subtract(1,"day"),"day")}function isBeforeMaxDate(e,t){return!(t instanceof Date)||J$2(e).isBefore(J$2(t).add(1,"day"),"day")}function getDateInTabOrder(e,t,n,r,o,i,a){const s=e.flat().filter(e=>{var s;return isBeforeMaxDate(e,n)&&isAfterMinDate(e,t)&&!(null==o?void 0:o(e))&&!(null==(s=null==r?void 0:r(e))?void 0:s.disabled)&&(!i||isSameMonth(e,a))}),l=s.find(e=>{var t;return null==(t=null==r?void 0:r(e))?void 0:t.selected});if(l)return l;const c=s.find(e=>J$2().isSame(e,"date"));return c||s[0]}WeekdaysRow.classes=classes$6,WeekdaysRow.displayName="@mantine/dates/WeekdaysRow";var classes$5={month:"m_cc9820d3",monthCell:"m_8f457cd5"};const defaultProps$d={withCellSpacing:!0},Month=factory((e,t)=>{const n=useProps("Month",defaultProps$d,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,__staticSelector:c,locale:u,firstDayOfWeek:d,weekdayFormat:p,month:h,weekendDays:f,getDayProps:A,excludeDate:m,minDate:g,maxDate:y,renderDay:v,hideOutsideDates:b,hideWeekdays:x,getDayAriaLabel:w,static:C,__getDayRef:$,__onDayKeyDown:_,__onDayClick:S,__onDayMouseEnter:E,__preventFocus:k,__stopPropagation:B,withCellSpacing:P,size:T,highlightToday:I,...L}=n,M=useStyles$u({name:c||"Month",classes:classes$5,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,rootSelector:"month"}),D=useDatesContext(),N=getMonthDays({month:h,firstDayOfWeek:D.getFirstDayOfWeek(d),consistentWeeks:D.consistentWeeks}),F=getDateInTabOrder(N,g,y,A,m,b,h),{resolvedClassNames:O,resolvedStyles:R}=useResolvedStylesApi({classNames:r,styles:a,props:n}),U=N.map((e,t)=>{const n=e.map((e,n)=>{const r=!isSameMonth(e,h),o=(null==w?void 0:w(e))||J$2(e).locale(u||D.locale).format("D MMMM YYYY"),i=null==A?void 0:A(e),a=J$2(e).isSame(F,"date");return factory$1("td",{...M("monthCell"),"data-with-spacing":P||void 0,children:factory$1(Day,{__staticSelector:c||"Month",classNames:O,styles:R,unstyled:s,"data-mantine-stop-propagation":B||void 0,highlightToday:I,renderDay:v,date:e,size:T,weekend:D.getWeekendDays(f).includes(e.getDay()),outside:r,hidden:!!b&&r,"aria-label":o,static:C,disabled:(null==m?void 0:m(e))||!isBeforeMaxDate(e,y)||!isAfterMinDate(e,g),ref:e=>null==$?void 0:$(t,n,e),...i,onKeyDown:r=>{var o;null==(o=null==i?void 0:i.onKeyDown)||o.call(i,r),null==_||_(r,{rowIndex:t,cellIndex:n,date:e})},onMouseEnter:t=>{var n;null==(n=null==i?void 0:i.onMouseEnter)||n.call(i,t),null==E||E(t,e)},onClick:t=>{var n;null==(n=null==i?void 0:i.onClick)||n.call(i,t),null==S||S(t,e)},onMouseDown:e=>{var t;null==(t=null==i?void 0:i.onMouseDown)||t.call(i,e),k&&e.preventDefault()},tabIndex:k||!a?-1:0})},e.toString())});return factory$1("tr",{...M("monthRow"),children:n})});return factory$1(Box,{component:"table",...M("month"),size:T,ref:t,...L,children:[!x&&factory$1("thead",{...M("monthThead"),children:factory$1(WeekdaysRow,{__staticSelector:c||"Month",locale:u,firstDayOfWeek:d,weekdayFormat:p,size:T,classNames:O,styles:R,unstyled:s})}),factory$1("tbody",{...M("monthTbody"),children:U})]})});Month.classes=classes$5,Month.displayName="@mantine/dates/Month";var classes$4={pickerControl:"m_dc6a3c71"};const defaultProps$c={},varsResolver$1=createVarsResolver((e,{size:t})=>({pickerControl:{"--dpc-fz":getFontSize(t),"--dpc-size":getSize(t,"dpc-size")}})),PickerControl=factory((e,t)=>{const n=useProps("PickerControl",defaultProps$c,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,firstInRange:c,lastInRange:u,inRange:d,__staticSelector:p,selected:h,disabled:f,...A}=n,m=useStyles$u({name:p||"PickerControl",classes:classes$4,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$1,rootSelector:"pickerControl"});return factory$1(UnstyledButton,{...m("pickerControl"),ref:t,unstyled:s,"data-picker-control":!0,"data-selected":h&&!f||void 0,"data-disabled":f||void 0,"data-in-range":d&&!f&&!h||void 0,"data-first-in-range":c&&!f||void 0,"data-last-in-range":u&&!f||void 0,disabled:f,...A})});function isYearDisabled(e,t,n){return!(!t&&!n)&&(!(!t||!J$2(e).isBefore(t,"year"))||!(!n||!J$2(e).isAfter(n,"year")))}function getYearInTabOrder(e,t,n,r){const o=e.flat().filter(e=>{var o;return!isYearDisabled(e,t,n)&&!(null==(o=null==r?void 0:r(e))?void 0:o.disabled)}),i=o.find(e=>{var t;return null==(t=null==r?void 0:r(e))?void 0:t.selected});if(i)return i;const a=o.find(e=>J$2().isSame(e,"year"));return a||o[0]}function getYearsData(e){const t=e.getFullYear(),n=t-t%10;let r=0;const o=[[],[],[],[]];for(let i=0;i<4;i+=1){const e=3===i?1:3;for(let t=0;t<e;t+=1)o[i].push(new Date(n+r,0)),r+=1}return o}PickerControl.classes=classes$4,PickerControl.displayName="@mantine/dates/PickerControl";var classes$3={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const defaultProps$b={yearsListFormat:"YYYY",withCellSpacing:!0},YearsList=factory((e,t)=>{const n=useProps("YearsList",defaultProps$b,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,decade:c,yearsListFormat:u,locale:d,minDate:p,maxDate:h,getYearControlProps:f,__staticSelector:A,__getControlRef:m,__onControlKeyDown:g,__onControlClick:y,__onControlMouseEnter:v,__preventFocus:b,__stopPropagation:x,withCellSpacing:w,size:C,...$}=n,_=useStyles$u({name:A||"YearsList",classes:classes$3,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,rootSelector:"yearsList"}),S=useDatesContext(),E=getYearsData(c),k=getYearInTabOrder(E,p,h,f),B=E.map((e,t)=>{const n=e.map((e,n)=>{const r=null==f?void 0:f(e),o=J$2(e).isSame(k,"year");return factory$1("td",{..._("yearsListCell"),"data-with-spacing":w||void 0,children:factory$1(PickerControl,{..._("yearsListControl"),size:C,unstyled:s,"data-mantine-stop-propagation":x||void 0,disabled:isYearDisabled(e,p,h),ref:e=>null==m?void 0:m(t,n,e),...r,onKeyDown:o=>{var i;null==(i=null==r?void 0:r.onKeyDown)||i.call(r,o),null==g||g(o,{rowIndex:t,cellIndex:n,date:e})},onClick:t=>{var n;null==(n=null==r?void 0:r.onClick)||n.call(r,t),null==y||y(t,e)},onMouseEnter:t=>{var n;null==(n=null==r?void 0:r.onMouseEnter)||n.call(r,t),null==v||v(t,e)},onMouseDown:e=>{var t;null==(t=null==r?void 0:r.onMouseDown)||t.call(r,e),b&&e.preventDefault()},tabIndex:b||!o?-1:0,children:J$2(e).locale(S.getLocale(d)).format(u)})})});return factory$1("tr",{..._("yearsListRow"),children:n})});return factory$1(Box,{component:"table",ref:t,size:C,..._("yearsList"),...$,children:factory$1("tbody",{children:B})})});function isMonthDisabled(e,t,n){return!(!t&&!n)&&(!(!t||!J$2(e).isBefore(t,"month"))||!(!n||!J$2(e).isAfter(n,"month")))}function getMonthInTabOrder(e,t,n,r){const o=e.flat().filter(e=>{var o;return!isMonthDisabled(e,t,n)&&!(null==(o=null==r?void 0:r(e))?void 0:o.disabled)}),i=o.find(e=>{var t;return null==(t=null==r?void 0:r(e))?void 0:t.selected});if(i)return i;const a=o.find(e=>J$2().isSame(e,"month"));return a||o[0]}function getMonthsData(e){const t=J$2(e).startOf("year").toDate(),n=[[],[],[],[]];let r=0;for(let o=0;o<4;o+=1)for(let e=0;e<3;e+=1)n[o].push(J$2(t).add(r,"months").toDate()),r+=1;return n}YearsList.classes=classes$3,YearsList.displayName="@mantine/dates/YearsList";var classes$2={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const defaultProps$a={monthsListFormat:"MMM",withCellSpacing:!0},MonthsList=factory((e,t)=>{const n=useProps("MonthsList",defaultProps$a,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,__staticSelector:c,year:u,monthsListFormat:d,locale:p,minDate:h,maxDate:f,getMonthControlProps:A,__getControlRef:m,__onControlKeyDown:g,__onControlClick:y,__onControlMouseEnter:v,__preventFocus:b,__stopPropagation:x,withCellSpacing:w,size:C,...$}=n,_=useStyles$u({name:c||"MonthsList",classes:classes$2,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,rootSelector:"monthsList"}),S=useDatesContext(),E=getMonthsData(u),k=getMonthInTabOrder(E,h,f,A),B=E.map((e,t)=>{const n=e.map((e,n)=>{const r=null==A?void 0:A(e),o=J$2(e).isSame(k,"month");return factory$1("td",{..._("monthsListCell"),"data-with-spacing":w||void 0,children:factory$1(PickerControl,{..._("monthsListControl"),size:C,unstyled:s,__staticSelector:c||"MonthsList","data-mantine-stop-propagation":x||void 0,disabled:isMonthDisabled(e,h,f),ref:e=>null==m?void 0:m(t,n,e),...r,onKeyDown:o=>{var i;null==(i=null==r?void 0:r.onKeyDown)||i.call(r,o),null==g||g(o,{rowIndex:t,cellIndex:n,date:e})},onClick:t=>{var n;null==(n=null==r?void 0:r.onClick)||n.call(r,t),null==y||y(t,e)},onMouseEnter:t=>{var n;null==(n=null==r?void 0:r.onMouseEnter)||n.call(r,t),null==v||v(t,e)},onMouseDown:e=>{var t;null==(t=null==r?void 0:r.onMouseDown)||t.call(r,e),b&&e.preventDefault()},tabIndex:b||!o?-1:0,children:J$2(e).locale(S.getLocale(p)).format(d)})})});return factory$1("tr",{..._("monthsListRow"),children:n})});return factory$1(Box,{component:"table",ref:t,size:C,..._("monthsList"),...$,children:factory$1("tbody",{children:B})})});MonthsList.classes=classes$2,MonthsList.displayName="@mantine/dates/MonthsList";var classes$1={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const defaultProps$9={nextDisabled:!1,previousDisabled:!1,hasNextLevel:!0,withNext:!0,withPrevious:!0},varsResolver=createVarsResolver((e,{size:t})=>({calendarHeader:{"--dch-control-size":getSize(t,"dch-control-size"),"--dch-fz":getFontSize(t)}})),CalendarHeader=factory((e,t)=>{const n=useProps("CalendarHeader",defaultProps$9,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,nextIcon:c,previousIcon:u,nextLabel:d,previousLabel:p,onNext:h,onPrevious:f,onLevelClick:A,label:m,nextDisabled:g,previousDisabled:y,hasNextLevel:v,levelControlAriaLabel:b,withNext:x,withPrevious:w,__staticSelector:C,__preventFocus:$,__stopPropagation:_,...S}=n,E=useStyles$u({name:C||"CalendarHeader",classes:classes$1,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver,rootSelector:"calendarHeader"}),k=$?e=>e.preventDefault():void 0;return factory$1(Box,{...E("calendarHeader"),ref:t,...S,children:[w&&factory$1(UnstyledButton,{...E("calendarHeaderControl"),"data-direction":"previous","aria-label":p,onClick:f,unstyled:s,onMouseDown:k,disabled:y,"data-disabled":y||void 0,tabIndex:$||y?-1:0,"data-mantine-stop-propagation":_||void 0,children:u||factory$1(AccordionChevron,{...E("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})}),factory$1(UnstyledButton,{component:v?"button":"div",...E("calendarHeaderLevel"),onClick:v?A:void 0,unstyled:s,onMouseDown:v?k:void 0,disabled:!v,"data-static":!v||void 0,"aria-label":b,tabIndex:$||!v?-1:0,"data-mantine-stop-propagation":_||void 0,children:m}),x&&factory$1(UnstyledButton,{...E("calendarHeaderControl"),"data-direction":"next","aria-label":d,onClick:h,unstyled:s,onMouseDown:k,disabled:g,"data-disabled":g||void 0,tabIndex:$||g?-1:0,"data-mantine-stop-propagation":_||void 0,children:c||factory$1(AccordionChevron,{...E("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})})]})});function getDecadeRange(e){const t=getYearsData(e);return[t[0][0],t[3][0]]}CalendarHeader.classes=classes$1,CalendarHeader.displayName="@mantine/dates/CalendarHeader";const defaultProps$8={decadeLabelFormat:"YYYY"},DecadeLevel=factory((e,t)=>{const n=useProps("DecadeLevel",defaultProps$8,e),{decade:r,locale:o,minDate:i,maxDate:a,yearsListFormat:s,getYearControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:p,withCellSpacing:h,__preventFocus:f,nextIcon:A,previousIcon:m,nextLabel:g,previousLabel:y,onNext:v,onPrevious:b,nextDisabled:x,previousDisabled:w,levelControlAriaLabel:C,withNext:$,withPrevious:_,decadeLabelFormat:S,classNames:E,styles:k,unstyled:B,__staticSelector:P,__stopPropagation:T,size:I,...L}=n,M=useDatesContext(),[D,N]=getDecadeRange(r),F={__staticSelector:P||"DecadeLevel",classNames:E,styles:k,unstyled:B,size:I},O="boolean"==typeof x?x:!!a&&!J$2(N).endOf("year").isBefore(a),R="boolean"==typeof w?w:!!i&&!J$2(D).startOf("year").isAfter(i),U=(e,t)=>J$2(e).locale(o||M.locale).format(t);return factory$1(Box,{"data-decade-level":!0,size:I,ref:t,...L,children:[factory$1(CalendarHeader,{label:"function"==typeof S?S(D,N):`${U(D,S)} – ${U(N,S)}`,__preventFocus:f,__stopPropagation:T,nextIcon:A,previousIcon:m,nextLabel:g,previousLabel:y,onNext:v,onPrevious:b,nextDisabled:O,previousDisabled:R,hasNextLevel:!1,levelControlAriaLabel:C,withNext:$,withPrevious:_,...F}),factory$1(YearsList,{decade:r,locale:o,minDate:i,maxDate:a,yearsListFormat:s,getYearControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:p,__preventFocus:f,__stopPropagation:T,withCellSpacing:h,...F})]})});DecadeLevel.classes={...YearsList.classes,...CalendarHeader.classes},DecadeLevel.displayName="@mantine/dates/DecadeLevel";const defaultProps$7={yearLabelFormat:"YYYY"},YearLevel=factory((e,t)=>{const n=useProps("YearLevel",defaultProps$7,e),{year:r,locale:o,minDate:i,maxDate:a,monthsListFormat:s,getMonthControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:p,withCellSpacing:h,__preventFocus:f,nextIcon:A,previousIcon:m,nextLabel:g,previousLabel:y,onNext:v,onPrevious:b,onLevelClick:x,nextDisabled:w,previousDisabled:C,hasNextLevel:$,levelControlAriaLabel:_,withNext:S,withPrevious:E,yearLabelFormat:k,__staticSelector:B,__stopPropagation:P,size:T,classNames:I,styles:L,unstyled:M,...D}=n,N=useDatesContext(),F={__staticSelector:B||"YearLevel",classNames:I,styles:L,unstyled:M,size:T},O="boolean"==typeof w?w:!!a&&!J$2(r).endOf("year").isBefore(a),R="boolean"==typeof C?C:!!i&&!J$2(r).startOf("year").isAfter(i);return factory$1(Box,{"data-year-level":!0,size:T,ref:t,...D,children:[factory$1(CalendarHeader,{label:"function"==typeof k?k(r):J$2(r).locale(o||N.locale).format(k),__preventFocus:f,__stopPropagation:P,nextIcon:A,previousIcon:m,nextLabel:g,previousLabel:y,onNext:v,onPrevious:b,onLevelClick:x,nextDisabled:O,previousDisabled:R,hasNextLevel:$,levelControlAriaLabel:_,withNext:S,withPrevious:E,...F}),factory$1(MonthsList,{year:r,locale:o,minDate:i,maxDate:a,monthsListFormat:s,getMonthControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:p,__preventFocus:f,__stopPropagation:P,withCellSpacing:h,...F})]})});YearLevel.classes={...CalendarHeader.classes,...MonthsList.classes},YearLevel.displayName="@mantine/dates/YearLevel";const defaultProps$6={monthLabelFormat:"MMMM YYYY"},MonthLevel=factory((e,t)=>{const n=useProps("MonthLevel",defaultProps$6,e),{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:a,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:d,renderDay:p,hideOutsideDates:h,hideWeekdays:f,getDayAriaLabel:A,__getDayRef:m,__onDayKeyDown:g,__onDayClick:y,__onDayMouseEnter:v,withCellSpacing:b,highlightToday:x,__preventFocus:w,__stopPropagation:C,nextIcon:$,previousIcon:_,nextLabel:S,previousLabel:E,onNext:k,onPrevious:B,onLevelClick:P,nextDisabled:T,previousDisabled:I,hasNextLevel:L,levelControlAriaLabel:M,withNext:D,withPrevious:N,monthLabelFormat:F,classNames:O,styles:R,unstyled:U,__staticSelector:j,size:H,static:Q,...z}=n,V=useDatesContext(),W={__staticSelector:j||"MonthLevel",classNames:O,styles:R,unstyled:U,size:H},Y="boolean"==typeof T?T:!!d&&!J$2(r).endOf("month").isBefore(d),G="boolean"==typeof I?I:!!u&&!J$2(r).startOf("month").isAfter(u);return factory$1(Box,{"data-month-level":!0,size:H,ref:t,...z,children:[factory$1(CalendarHeader,{label:"function"==typeof F?F(r):J$2(r).locale(o||V.locale).format(F),__preventFocus:w,__stopPropagation:C,nextIcon:$,previousIcon:_,nextLabel:S,previousLabel:E,onNext:k,onPrevious:B,onLevelClick:P,nextDisabled:Y,previousDisabled:G,hasNextLevel:L,levelControlAriaLabel:M,withNext:D,withPrevious:N,...W}),factory$1(Month,{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:a,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:d,renderDay:p,hideOutsideDates:h,hideWeekdays:f,getDayAriaLabel:A,__getDayRef:m,__onDayKeyDown:g,__onDayClick:y,__onDayMouseEnter:v,__preventFocus:w,__stopPropagation:C,static:Q,withCellSpacing:b,highlightToday:x,...W})]})});MonthLevel.classes={...Month.classes,...CalendarHeader.classes},MonthLevel.displayName="@mantine/dates/MonthLevel";var classes={levelsGroup:"m_30b26e33"};const defaultProps$5={},LevelsGroup=factory((e,t)=>{const n=useProps("LevelsGroup",defaultProps$5,e),{classNames:r,className:o,style:i,styles:a,unstyled:s,vars:l,__staticSelector:c,...u}=n,d=useStyles$u({name:c||"LevelsGroup",classes:classes,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,rootSelector:"levelsGroup"});return factory$1(Box,{ref:t,...d("levelsGroup"),...u})});LevelsGroup.classes=classes,LevelsGroup.displayName="@mantine/dates/LevelsGroup";const defaultProps$4={numberOfColumns:1},DecadeLevelGroup=factory((e,t)=>{const n=useProps("DecadeLevelGroup",defaultProps$4,e),{decade:r,locale:o,minDate:i,maxDate:a,yearsListFormat:s,getYearControlProps:l,__onControlClick:c,__onControlMouseEnter:u,withCellSpacing:d,__preventFocus:p,nextIcon:h,previousIcon:f,nextLabel:A,previousLabel:m,onNext:g,onPrevious:y,nextDisabled:v,previousDisabled:b,classNames:x,styles:w,unstyled:C,__staticSelector:$,__stopPropagation:_,numberOfColumns:S,levelControlAriaLabel:E,decadeLabelFormat:k,size:B,vars:P,...T}=n,I=reactExports.useRef([]),L=Array(S).fill(0).map((e,t)=>{const n=J$2(r).add(10*t,"years").toDate();return factory$1(DecadeLevel,{size:B,yearsListFormat:s,decade:n,withNext:t===S-1,withPrevious:0===t,decadeLabelFormat:k,__onControlClick:c,__onControlMouseEnter:u,__onControlKeyDown:(e,n)=>handleControlKeyDown({levelIndex:t,rowIndex:n.rowIndex,cellIndex:n.cellIndex,event:e,controlsRef:I}),__getControlRef:(e,n,r)=>{Array.isArray(I.current[t])||(I.current[t]=[]),Array.isArray(I.current[t][e])||(I.current[t][e]=[]),I.current[t][e][n]=r},levelControlAriaLabel:"function"==typeof E?E(n):E,locale:o,minDate:i,maxDate:a,__preventFocus:p,__stopPropagation:_,nextIcon:h,previousIcon:f,nextLabel:A,previousLabel:m,onNext:g,onPrevious:y,nextDisabled:v,previousDisabled:b,getYearControlProps:l,__staticSelector:$||"DecadeLevelGroup",classNames:x,styles:w,unstyled:C,withCellSpacing:d})});return factory$1(LevelsGroup,{classNames:x,styles:w,__staticSelector:$||"DecadeLevelGroup",ref:t,size:B,unstyled:C,...T,children:L})});DecadeLevelGroup.classes={...LevelsGroup.classes,...DecadeLevel.classes},DecadeLevelGroup.displayName="@mantine/dates/DecadeLevelGroup";const defaultProps$3={numberOfColumns:1},YearLevelGroup=factory((e,t)=>{const n=useProps("YearLevelGroup",defaultProps$3,e),{year:r,locale:o,minDate:i,maxDate:a,monthsListFormat:s,getMonthControlProps:l,__onControlClick:c,__onControlMouseEnter:u,withCellSpacing:d,__preventFocus:p,nextIcon:h,previousIcon:f,nextLabel:A,previousLabel:m,onNext:g,onPrevious:y,onLevelClick:v,nextDisabled:b,previousDisabled:x,hasNextLevel:w,classNames:C,styles:$,unstyled:_,__staticSelector:S,__stopPropagation:E,numberOfColumns:k,levelControlAriaLabel:B,yearLabelFormat:P,size:T,vars:I,...L}=n,M=reactExports.useRef([]),D=Array(k).fill(0).map((e,t)=>{const n=J$2(r).add(t,"years").toDate();return factory$1(YearLevel,{size:T,monthsListFormat:s,year:n,withNext:t===k-1,withPrevious:0===t,yearLabelFormat:P,__stopPropagation:E,__onControlClick:c,__onControlMouseEnter:u,__onControlKeyDown:(e,n)=>handleControlKeyDown({levelIndex:t,rowIndex:n.rowIndex,cellIndex:n.cellIndex,event:e,controlsRef:M}),__getControlRef:(e,n,r)=>{Array.isArray(M.current[t])||(M.current[t]=[]),Array.isArray(M.current[t][e])||(M.current[t][e]=[]),M.current[t][e][n]=r},levelControlAriaLabel:"function"==typeof B?B(n):B,locale:o,minDate:i,maxDate:a,__preventFocus:p,nextIcon:h,previousIcon:f,nextLabel:A,previousLabel:m,onNext:g,onPrevious:y,onLevelClick:v,nextDisabled:b,previousDisabled:x,hasNextLevel:w,getMonthControlProps:l,classNames:C,styles:$,unstyled:_,__staticSelector:S||"YearLevelGroup",withCellSpacing:d})});return factory$1(LevelsGroup,{classNames:C,styles:$,__staticSelector:S||"YearLevelGroup",ref:t,size:T,unstyled:_,...L,children:D})});YearLevelGroup.classes={...YearLevel.classes,...LevelsGroup.classes},YearLevelGroup.displayName="@mantine/dates/YearLevelGroup";const defaultProps$2={numberOfColumns:1},MonthLevelGroup=factory((e,t)=>{const n=useProps("MonthLevelGroup",defaultProps$2,e),{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:a,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:d,renderDay:p,hideOutsideDates:h,hideWeekdays:f,getDayAriaLabel:A,__onDayClick:m,__onDayMouseEnter:g,withCellSpacing:y,highlightToday:v,__preventFocus:b,nextIcon:x,previousIcon:w,nextLabel:C,previousLabel:$,onNext:_,onPrevious:S,onLevelClick:E,nextDisabled:k,previousDisabled:B,hasNextLevel:P,classNames:T,styles:I,unstyled:L,numberOfColumns:M,levelControlAriaLabel:D,monthLabelFormat:N,__staticSelector:F,__stopPropagation:O,size:R,static:U,vars:j,...H}=n,Q=reactExports.useRef([]),z=Array(M).fill(0).map((e,t)=>{const n=J$2(r).add(t,"months").toDate();return factory$1(MonthLevel,{month:n,withNext:t===M-1,withPrevious:0===t,monthLabelFormat:N,__stopPropagation:O,__onDayClick:m,__onDayMouseEnter:g,__onDayKeyDown:(e,n)=>handleControlKeyDown({levelIndex:t,rowIndex:n.rowIndex,cellIndex:n.cellIndex,event:e,controlsRef:Q}),__getDayRef:(e,n,r)=>{Array.isArray(Q.current[t])||(Q.current[t]=[]),Array.isArray(Q.current[t][e])||(Q.current[t][e]=[]),Q.current[t][e][n]=r},levelControlAriaLabel:"function"==typeof D?D(n):D,locale:o,firstDayOfWeek:i,weekdayFormat:a,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:d,renderDay:p,hideOutsideDates:h,hideWeekdays:f,getDayAriaLabel:A,__preventFocus:b,nextIcon:x,previousIcon:w,nextLabel:C,previousLabel:$,onNext:_,onPrevious:S,onLevelClick:E,nextDisabled:k,previousDisabled:B,hasNextLevel:P,classNames:T,styles:I,unstyled:L,__staticSelector:F||"MonthLevelGroup",size:R,static:U,withCellSpacing:y,highlightToday:v})});return factory$1(LevelsGroup,{classNames:T,styles:I,__staticSelector:F||"MonthLevelGroup",ref:t,size:R,...H,children:z})});MonthLevelGroup.classes={...LevelsGroup.classes,...MonthLevel.classes},MonthLevelGroup.displayName="@mantine/dates/MonthLevelGroup";const getEmptyValue=e=>"range"===e?[null,null]:"multiple"===e?[]:null;function useUncontrolledDates({type:e,value:t,defaultValue:n,onChange:r,applyTimezone:o=!0}){const i=reactExports.useRef(e),a=useDatesContext(),[s,l,c]=useUncontrolled({value:shiftTimezone("add",t,a.getTimezone(),!o),defaultValue:shiftTimezone("add",n,a.getTimezone(),!o),finalValue:getEmptyValue(e),onChange:e=>{null==r||r(shiftTimezone("remove",e,a.getTimezone(),!o))}});let u=s;return i.current!==e&&(i.current=e,void 0===t&&(u=void 0!==n?n:getEmptyValue(e),l(u))),[u,l,c]}function levelToNumber(e,t){return e?"month"===e?0:"year"===e?1:2:t||0}function levelNumberToLevel(e){return 0===e?"month":1===e?"year":"decade"}function clampLevel(e,t,n){return levelNumberToLevel(clamp$2(levelToNumber(e,0),levelToNumber(t,0),levelToNumber(n,2)))}const defaultProps$1={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0},Calendar=factory((e,t)=>{const n=useProps("Calendar",defaultProps$1,e),{vars:r,maxLevel:o,minLevel:i,defaultLevel:a,level:s,onLevelChange:l,date:c,defaultDate:u,onDateChange:d,numberOfColumns:p,columnsToScroll:h,ariaLabels:f,onYearSelect:A,onMonthSelect:m,onYearMouseEnter:g,onMonthMouseEnter:y,__updateDateOnYearSelect:v,__updateDateOnMonthSelect:b,firstDayOfWeek:x,weekdayFormat:w,weekendDays:C,getDayProps:$,excludeDate:_,renderDay:S,hideOutsideDates:E,hideWeekdays:k,getDayAriaLabel:B,monthLabelFormat:P,nextIcon:T,previousIcon:I,__onDayClick:L,__onDayMouseEnter:M,withCellSpacing:D,highlightToday:N,monthsListFormat:F,getMonthControlProps:O,yearLabelFormat:R,yearsListFormat:U,getYearControlProps:j,decadeLabelFormat:H,classNames:Q,styles:z,unstyled:V,minDate:W,maxDate:Y,locale:G,__staticSelector:K,size:q,__preventFocus:J,__stopPropagation:Z,onNextDecade:X,onPreviousDecade:ee,onNextYear:te,onPreviousYear:ne,onNextMonth:re,onPreviousMonth:oe,static:ie,__timezoneApplied:ae,...se}=n,{resolvedClassNames:le,resolvedStyles:ce}=useResolvedStylesApi({classNames:Q,styles:z,props:n}),[ue,de]=useUncontrolled({value:s?clampLevel(s,i,o):void 0,defaultValue:a?clampLevel(a,i,o):void 0,finalValue:clampLevel(void 0,i,o),onChange:l}),[pe,he]=useUncontrolledDates({type:"default",value:c,defaultValue:u,onChange:d,applyTimezone:!ae}),fe={__staticSelector:K||"Calendar",styles:ce,classNames:le,unstyled:V,size:q},Ae=useDatesContext(),me=h||p||1,ge=new Date,ye=pe||shiftTimezone("add",W&&W>ge?W:ge,Ae.getTimezone());return factory$1(Box,{ref:t,size:q,"data-calendar":!0,...se,children:["month"===ue&&factory$1(MonthLevelGroup,{month:ye,minDate:W,maxDate:Y,firstDayOfWeek:x,weekdayFormat:w,weekendDays:C,getDayProps:$,excludeDate:_,renderDay:S,hideOutsideDates:E,hideWeekdays:k,getDayAriaLabel:B,onNext:()=>{const e=J$2(ye).add(me,"month").toDate();null==re||re(e),he(e)},onPrevious:()=>{const e=J$2(ye).subtract(me,"month").toDate();null==oe||oe(e),he(e)},hasNextLevel:"month"!==o,onLevelClick:()=>de("year"),numberOfColumns:p,locale:G,levelControlAriaLabel:null==f?void 0:f.monthLevelControl,nextLabel:null==f?void 0:f.nextMonth,nextIcon:T,previousLabel:null==f?void 0:f.previousMonth,previousIcon:I,monthLabelFormat:P,__onDayClick:L,__onDayMouseEnter:M,__preventFocus:J,__stopPropagation:Z,static:ie,withCellSpacing:D,highlightToday:N,...fe}),"year"===ue&&factory$1(YearLevelGroup,{year:ye,numberOfColumns:p,minDate:W,maxDate:Y,monthsListFormat:F,getMonthControlProps:O,locale:G,onNext:()=>{const e=J$2(ye).add(me,"year").toDate();null==te||te(e),he(e)},onPrevious:()=>{const e=J$2(ye).subtract(me,"year").toDate();null==ne||ne(e),he(e)},hasNextLevel:"month"!==o&&"year"!==o,onLevelClick:()=>de("decade"),levelControlAriaLabel:null==f?void 0:f.yearLevelControl,nextLabel:null==f?void 0:f.nextYear,nextIcon:T,previousLabel:null==f?void 0:f.previousYear,previousIcon:I,yearLabelFormat:R,__onControlMouseEnter:y,__onControlClick:(e,t)=>{b&&he(t),de(clampLevel("month",i,o)),null==m||m(t)},__preventFocus:J,__stopPropagation:Z,withCellSpacing:D,...fe}),"decade"===ue&&factory$1(DecadeLevelGroup,{decade:ye,minDate:W,maxDate:Y,yearsListFormat:U,getYearControlProps:j,locale:G,onNext:()=>{const e=J$2(ye).add(10*me,"year").toDate();null==X||X(e),he(e)},onPrevious:()=>{const e=J$2(ye).subtract(10*me,"year").toDate();null==ee||ee(e),he(e)},numberOfColumns:p,nextLabel:null==f?void 0:f.nextDecade,nextIcon:T,previousLabel:null==f?void 0:f.previousDecade,previousIcon:I,decadeLabelFormat:H,__onControlMouseEnter:g,__onControlClick:(e,t)=>{v&&he(t),de(clampLevel("year",i,o)),null==A||A(t)},__preventFocus:J,__stopPropagation:Z,withCellSpacing:D,...fe})]})});function pickCalendarProps(e){const{maxLevel:t,minLevel:n,defaultLevel:r,level:o,onLevelChange:i,nextIcon:a,previousIcon:s,date:l,defaultDate:c,onDateChange:u,numberOfColumns:d,columnsToScroll:p,ariaLabels:h,onYearSelect:f,onMonthSelect:A,onYearMouseEnter:m,onMonthMouseEnter:g,onNextMonth:y,onPreviousMonth:v,onNextYear:b,onPreviousYear:x,onNextDecade:w,onPreviousDecade:C,withCellSpacing:$,highlightToday:_,__updateDateOnYearSelect:S,__updateDateOnMonthSelect:E,firstDayOfWeek:k,weekdayFormat:B,weekendDays:P,getDayProps:T,excludeDate:I,renderDay:L,hideOutsideDates:M,hideWeekdays:D,getDayAriaLabel:N,monthLabelFormat:F,monthsListFormat:O,getMonthControlProps:R,yearLabelFormat:U,yearsListFormat:j,getYearControlProps:H,decadeLabelFormat:Q,allowSingleDateInRange:z,allowDeselect:V,minDate:W,maxDate:Y,locale:G,...K}=e;return{calendarProps:{maxLevel:t,minLevel:n,defaultLevel:r,level:o,onLevelChange:i,nextIcon:a,previousIcon:s,date:l,defaultDate:c,onDateChange:u,numberOfColumns:d,columnsToScroll:p,ariaLabels:h,onYearSelect:f,onMonthSelect:A,onYearMouseEnter:m,onMonthMouseEnter:g,onNextMonth:y,onPreviousMonth:v,onNextYear:b,onPreviousYear:x,onNextDecade:w,onPreviousDecade:C,withCellSpacing:$,highlightToday:_,__updateDateOnYearSelect:S,__updateDateOnMonthSelect:E,firstDayOfWeek:k,weekdayFormat:B,weekendDays:P,getDayProps:T,excludeDate:I,renderDay:L,hideOutsideDates:M,hideWeekdays:D,getDayAriaLabel:N,monthLabelFormat:F,monthsListFormat:O,getMonthControlProps:R,yearLabelFormat:U,yearsListFormat:j,getYearControlProps:H,decadeLabelFormat:Q,allowSingleDateInRange:z,allowDeselect:V,minDate:W,maxDate:Y,locale:G},others:K}}function dateStringParser(e,t){if(null===e)return null;const n=shiftTimezone("add",new Date(e),t);return Number.isNaN(n.getTime())||!e?null:n}function isDateValid({date:e,maxDate:t,minDate:n}){return null!=e&&(!Number.isNaN(e.getTime())&&((!t||!J$2(e).isAfter(t,"date"))&&(!n||!J$2(e).isBefore(n,"date"))))}Calendar.classes={...DecadeLevelGroup.classes,...YearLevelGroup.classes,...MonthLevelGroup.classes},Calendar.displayName="@mantine/dates/Calendar";const defaultProps={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,preserveTime:!0},DateInput=factory((e,t)=>{const n=useInputProps("DateInput",defaultProps,e),{inputProps:r,wrapperProps:o,value:i,defaultValue:a,onChange:s,clearable:l,clearButtonProps:c,popoverProps:u,getDayProps:d,locale:p,valueFormat:h,dateParser:f,minDate:A,maxDate:m,fixOnBlur:g,onFocus:y,onBlur:v,onClick:b,readOnly:x,name:w,form:C,rightSection:$,unstyled:_,classNames:S,styles:E,allowDeselect:k,preserveTime:B,date:P,defaultDate:T,onDateChange:I,...L}=n,[M,D]=reactExports.useState(!1),{calendarProps:N,others:F}=pickCalendarProps(L),O=useDatesContext(),R=f||(e=>{const t=J$2(e,h,O.getLocale(p)).toDate();return Number.isNaN(t.getTime())?dateStringParser(e,O.getTimezone()):t}),U=void 0!==k?k:l,j=e=>e?J$2(e).locale(O.getLocale(p)).format(h):"",[H,Q,z]=useUncontrolledDates({type:"default",value:i,defaultValue:a,onChange:s}),[V,W]=useUncontrolledDates({type:"default",value:P,defaultValue:a||T,onChange:I});reactExports.useEffect(()=>{z&&W(i)},[z,i]);const[Y,G]=reactExports.useState(j(H));reactExports.useEffect(()=>{G(j(H))},[O.getLocale(p)]);const K=$||(l&&H&&!x?factory$1(CloseButton,{variant:"transparent",onMouseDown:e=>e.preventDefault(),tabIndex:-1,onClick:()=>{Q(null),!z&&G(""),D(!1)},unstyled:_,size:r.size||"sm",...c}):null);return useDidUpdate(()=>{void 0!==H&&!M&&G(j(H))},[H]),factory$1(Fragment,{children:[factory$1(Input$5.Wrapper,{...o,__staticSelector:"DateInput",children:factory$1(Popover,{opened:M,trapFocus:!1,position:"bottom-start",disabled:x,withRoles:!1,unstyled:_,...u,children:[factory$1(Popover.Target,{children:factory$1(Input$5,{"data-dates-input":!0,"data-read-only":x||void 0,autoComplete:"off",ref:t,value:Y,onChange:e=>{const t=e.currentTarget.value;if(G(t),D(!0),""===t.trim()&&l)Q(null);else{const e=R(t);isDateValid({date:e,minDate:A,maxDate:m})&&(Q(e),W(e))}},onBlur:e=>{null==v||v(e),D(!1),g&&G(j(H))},onFocus:e=>{null==y||y(e),D(!0)},onClick:e=>{null==b||b(e),D(!0)},readOnly:x,rightSection:K,...r,...F,__staticSelector:"DateInput"})}),factory$1(Popover.Dropdown,{onMouseDown:e=>e.preventDefault(),"data-dates-dropdown":!0,children:factory$1(Calendar,{__staticSelector:"DateInput",__timezoneApplied:!0,...N,classNames:S,styles:E,unstyled:_,__preventFocus:!0,minDate:A,maxDate:m,locale:p,getDayProps:e=>({...null==d?void 0:d(e),selected:J$2(H).isSame(e,"day"),onClick:()=>{const t=B?assignTime(H,e):e,n=l&&U&&J$2(H).isSame(e,"day")?null:t;Q(n),!z&&G(j(n)),D(!1)}}),size:r.size,date:V,onDateChange:W})})]})}),factory$1(HiddenDatesInput,{name:w,form:C,value:H,type:"default"})]})});DateInput.classes={...Input$5.classes,...Calendar.classes},DateInput.displayName="@mantine/dates/DateInput";
|
|
1540
1540
|
/*! *****************************************************************************
|
|
1541
1541
|
Copyright (c) Microsoft Corporation.
|
|
1542
1542
|
|