@backtest-kit/ui 3.3.0 → 3.4.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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bj6x7FsS.js","assets/IconPhoto-BImfiU3f.js","assets/index-Cs9revcK.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D8ltdovC.js","assets/IconPhoto-CHjzSKw5.js","assets/index-Bl1jm8QD.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$4=Symbol.for("react.element"),n$4=Symbol.for("react.portal"),p$4=Symbol.for("react.fragment"),q$3=Symbol.for("react.strict_mode"),r$5=Symbol.for("react.profiler"),t$4=Symbol.for("react.provider"),u$2=Symbol.for("react.context"),v$4=Symbol.for("react.forward_ref"),w$3=Symbol.for("react.suspense"),x$3=Symbol.for("react.memo"),y$3=Symbol.for("react.lazy"),z$3=Symbol.iterator;function A$3(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=z$3&&e[z$3]||e["@@iterator"])?e:null}var B$3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$5=Object.assign,D$2={};function E$2(e,t,n){this.props=e,this.context=t,this.refs=D$2,this.updater=n||B$3}function F$1(){}function G$2(e,t,n){this.props=e,this.context=t,this.refs=D$2,this.updater=n||B$3}E$2.prototype.isReactComponent={},E$2.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$2.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},F$1.prototype=E$2.prototype;var H$2=G$2.prototype=new F$1;H$2.constructor=G$2,C$5(H$2,E$2.prototype),H$2.isPureReactComponent=!0;var I$3=Array.isArray,J$2=Object.prototype.hasOwnProperty,K$2={current:null},L$2={key:!0,ref:!0,__self:!0,__source:!0};function M$3(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$2.call(t,r)&&!L$2.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$4,type:e,key:i,ref:a,props:o,_owner:K$2.current}}function N$2(e,t){return{$$typeof:l$4,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function O$3(e){return"object"==typeof e&&null!==e&&e.$$typeof===l$4}function escape(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}var P$2=/\/+/g;function Q$2(e,t){return"object"==typeof e&&null!==e&&null!=e.key?escape(""+e.key):t.toString(36)}function R$2(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$4:case n$4:a=!0}}if(a)return o=o(a=e),e=""===r?"."+Q$2(a,0):r,I$3(o)?(n="",null!=e&&(n=e.replace(P$2,"$&/")+"/"),R$2(o,t,n,"",function(e){return e})):null!=o&&(O$3(o)&&(o=N$2(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(P$2,"$&/")+"/")+e)),t.push(o)),1;if(a=0,r=""===r?".":r+":",I$3(e))for(var s=0;s<e.length;s++){var l=r+Q$2(i=e[s],s);a+=R$2(i,t,n,l,o)}else if("function"==typeof(l=A$3(e)))for(e=l.call(e),s=0;!(i=e.next()).done;)a+=R$2(i=i.value,t,n,l=r+Q$2(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$2(e,t,n){if(null==e)return e;var r=[],o=0;return R$2(e,r,"","",function(e){return t.call(n,e,o++)}),r}function T$2(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$2={current:null},V$2={transition:null},W$2={ReactCurrentDispatcher:U$2,ReactCurrentBatchConfig:V$2,ReactCurrentOwner:K$2};function X$2(){throw Error("act(...) is not supported in production builds of React.")}react_production_min.Children={map:S$2,forEach:function(e,t,n){S$2(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return S$2(e,function(){t++}),t},toArray:function(e){return S$2(e,function(e){return e})||[]},only:function(e){if(!O$3(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},react_production_min.Component=E$2,react_production_min.Fragment=p$4,react_production_min.Profiler=r$5,react_production_min.PureComponent=G$2,react_production_min.StrictMode=q$3,react_production_min.Suspense=w$3,react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W$2,react_production_min.act=X$2,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$5({},e.props),o=e.key,i=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,a=K$2.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)J$2.call(t,l)&&!L$2.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$4,type:e.type,key:o,ref:i,props:r,_owner:a}},react_production_min.createContext=function(e){return(e={$$typeof:u$2,_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$3,react_production_min.createFactory=function(e){var t=M$3.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$4,render:e}},react_production_min.isValidElement=O$3,react_production_min.lazy=function(e){return{$$typeof:y$3,_payload:{_status:-1,_result:e},_init:T$2}},react_production_min.memo=function(e,t){return{$$typeof:x$3,type:e,compare:void 0===t?null:t}},react_production_min.startTransition=function(e){var t=V$2.transition;V$2.transition={};try{e()}finally{V$2.transition=t}},react_production_min.unstable_act=X$2,react_production_min.useCallback=function(e,t){return U$2.current.useCallback(e,t)},react_production_min.useContext=function(e){return U$2.current.useContext(e)},react_production_min.useDebugValue=function(){},react_production_min.useDeferredValue=function(e){return U$2.current.useDeferredValue(e)},react_production_min.useEffect=function(e,t){return U$2.current.useEffect(e,t)},react_production_min.useId=function(){return U$2.current.useId()},react_production_min.useImperativeHandle=function(e,t,n){return U$2.current.useImperativeHandle(e,t,n)},react_production_min.useInsertionEffect=function(e,t){return U$2.current.useInsertionEffect(e,t)},react_production_min.useLayoutEffect=function(e,t){return U$2.current.useLayoutEffect(e,t)},react_production_min.useMemo=function(e,t){return U$2.current.useMemo(e,t)},react_production_min.useReducer=function(e,t,n){return U$2.current.useReducer(e,t,n)},react_production_min.useRef=function(e){return U$2.current.useRef(e)},react_production_min.useState=function(e){return U$2.current.useState(e)},react_production_min.useSyncExternalStore=function(e,t,n){return U$2.current.useSyncExternalStore(e,t,n)},react_production_min.useTransition=function(){return U$2.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(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=function(){return __assign=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.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});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="comm",RULESET="rule",DECLARATION="decl",IMPORT="@import",KEYFRAMES="@keyframes",LAYER="@layer",abs=Math.abs,from$1=String.fromCharCode,assign=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(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(e,t){return t.push(e),e}function combine(e,t){return e.map(t).join("")}var line=1,column=1,length=0,position=0,character=0,characters="";function node(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(node("",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(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(e){for(;next();)switch(character){case e:return position;case 34:case 39:34!==e&&39!==e&&delimiter(character);break;case 40:41===e&&delimiter(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(e){return dealloc(parse$4("",null,null,null,[""],e=alloc(e),0,[0],e))}function parse$4(e,t,n,r,o,i,a,s,l){for(var c=0,u=0,d=a,p=0,f=0,h=0,m=1,g=1,v=1,y=0,b="",x=o,$=i,_=r,C=b;g;)switch(h=y,y=next()){case 40:if(108!=h&&58==charat(C,d-1)){-1!=indexof(C+=replace(delimit(y),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:C+=delimit(y);break;case 9:case 10:case 13:case 32:C+=whitespace(h);break;case 92:C+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:append(comment(commenter(next(),caret()),t,n),l);break;default:C+="/"}break;case 123*m:s[c++]=strlen(C)*v;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+u:-1==v&&(C=replace(C,/\f/g,"")),f>0&&strlen(C)-d&&append(f>32?declaration(C+";",r,n,d-1):declaration(replace(C," ","")+";",r,n,d-2),l);break;case 59:C+=";";default:if(append(_=ruleset(C,t,n,c,u,o,s,b,x=[],$=[],d),i),123===y)if(0===u)parse$4(C,t,_,_,x,i,d,s,$);else switch(99===p&&110===charat(C,3)?100:p){case 100:case 108:case 109:case 115:parse$4(e,_,_,r&&append(ruleset(e,_,_,0,0,o,s,b,o,x=[],d),$),o,$,d,s,r?x:$);break;default:parse$4(C,_,_,_,[""],$,0,s,$)}}c=u=f=0,m=v=1,b=C="",d=a;break;case 58:d=1+strlen(C),f=h;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==prev())continue;switch(C+=from$1(y),y*m){case 38:v=u>0?1:(C+="\f",-1);break;case 44:s[c++]=(strlen(C)-1)*v,v=1;break;case 64:45===peek()&&(C+=delimit(next())),p=peek(),u=d=strlen(b=C+=identifier(caret())),y++;break;case 45:45===h&&2==strlen(C)&&(m=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:[""],f=sizeof(p),h=0,m=0,g=0;h<r;++h)for(var v=0,y=substr(e,d+1,d=abs(m=a[h])),b=e;v<f;++v)(b=trim(m>0?p[v]+" "+y:replace(y,/&\f/g,p[v])))&&(l[g++]=b);return node(e,t,n,0===o?RULESET:s,l,c,u)}function comment(e,t,n){return node(e,t,n,COMMENT,from$1(char()),substr(e,2,-2),0)}function declaration(e,t,n,r){return node(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(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return WEBKIT+e+MS+replace(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return WEBKIT+e+MS+replace(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(e,/(\w+).+(:[^]+)/,WEBKIT+"box-$1$2"+MS+"flex-$1$2")+e;case 5443:return WEBKIT+e+MS+"flex-item-"+replace(e,/flex-|-self/g,"")+(match$1(e,/flex-|baseline/)?"":MS+"grid-row-"+replace(e,/flex-|-self/g,""))+e;case 4675:return WEBKIT+e+MS+"flex-line-pack"+replace(e,/align-content|flex-|-self/g,"")+e;case 5548:return WEBKIT+e+MS+replace(e,"shrink","negative")+e;case 5292:return WEBKIT+e+MS+replace(e,"basis","preferred-size")+e;case 6060:return WEBKIT+"box-"+replace(e,"-grow","")+WEBKIT+e+MS+replace(e,"grow","positive")+e;case 4554:return WEBKIT+replace(e,/([^-])(transform)/g,"$1"+WEBKIT+"$2")+e;case 6187:return replace(replace(replace(e,/(zoom-|grab)/,WEBKIT+"$1"),/(image-set)/,WEBKIT+"$1"),e,"")+e;case 5495:case 3959:return replace(e,/(image-set\([^]*)/,WEBKIT+"$1$`$1");case 4968:return replace(replace(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(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(e,"-start","")+e+MS+"grid-row-span:"+(~indexof(n,"span")?match$1(n,/\d+/):+match$1(n,/\d+/)-+match$1(e,/\d+/))+";":MS+replace(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(e){return match$1(e.props,/grid-\w+-start/)})?e:MS+replace(replace(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return replace(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(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(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return replace(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(e,":",":"+WEBKIT)+e;break;case 6444:switch(charat(e,45===charat(e,14)?18:11)){case 120:return replace(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(e,":",":"+MS)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return replace(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(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: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(e.value,"@","@"+WEBKIT)})],r);case RULESET:if(e.length)return combine(e.props,function(t){switch(match$1(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize([copy(e,{props:[replace(t,/:(read-\w+)/,":"+MOZ+"$1")]})],r);case"::placeholder":return serialize([copy(e,{props:[replace(t,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy(e,{props:[replace(t,/:(plac\w+)/,":"+MOZ+"$1")]}),copy(e,{props:[replace(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(e,/(\w+).+(:[^]+)/,WEBKIT+"box-$1$2"+MS+"flex-$1$2")+e;case 5443:return WEBKIT+e+MS+"flex-item-"+replace(e,/flex-|-self/,"")+e;case 4675:return WEBKIT+e+MS+"flex-line-pack"+replace(e,/align-content|flex-|-self/,"")+e;case 5548:return WEBKIT+e+MS+replace(e,"shrink","negative")+e;case 5292:return WEBKIT+e+MS+replace(e,"basis","preferred-size")+e;case 6060:return WEBKIT+"box-"+replace(e,"-grow","")+WEBKIT+e+MS+replace(e,"grow","positive")+e;case 4554:return WEBKIT+replace(e,/([^-])(transform)/g,"$1"+WEBKIT+"$2")+e;case 6187:return replace(replace(replace(e,/(zoom-|grab)/,WEBKIT+"$1"),/(image-set)/,WEBKIT+"$1"),e,"")+e;case 5495:case 3959:return replace(e,/(image-set\([^]*)/,WEBKIT+"$1$`$1");case 4968:return replace(replace(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(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(e,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(108==charat(e,t+3)?"$3":"$2-$3"))+e;case 115:return~indexof(e,"stretch")?prefix(replace(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(e,":",":"+WEBKIT)+e;case 101:return replace(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(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return WEBKIT+e+MS+replace(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return WEBKIT+e+MS+replace(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(e.value,"@","@"+WEBKIT)})],r);case RULESET:if(e.length)return combine(e.props,function(t){switch(match$1(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize([copy(e,{props:[replace(t,/:(read-\w+)/,":"+MOZ+"$1")]})],r);case"::placeholder":return serialize([copy(e,{props:[replace(t,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy(e,{props:[replace(t,/:(plac\w+)/,":"+MOZ+"$1")]}),copy(e,{props:[replace(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,rulesheet(function(e){l.insert(e)})],d=middleware(c.concat(i,u));o=function(e,t,n,r){l=n,serialize(compile(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$4="function"==typeof Symbol&&Symbol.for,c$3=b$4?Symbol.for("react.element"):60103,d$3=b$4?Symbol.for("react.portal"):60106,e$3=b$4?Symbol.for("react.fragment"):60107,f$3=b$4?Symbol.for("react.strict_mode"):60108,g$3=b$4?Symbol.for("react.profiler"):60114,h$2=b$4?Symbol.for("react.provider"):60109,k$4=b$4?Symbol.for("react.context"):60110,l$3=b$4?Symbol.for("react.async_mode"):60111,m$3=b$4?Symbol.for("react.concurrent_mode"):60111,n$3=b$4?Symbol.for("react.forward_ref"):60112,p$3=b$4?Symbol.for("react.suspense"):60113,q$2=b$4?Symbol.for("react.suspense_list"):60120,r$4=b$4?Symbol.for("react.memo"):60115,t$3=b$4?Symbol.for("react.lazy"):60116,v$3=b$4?Symbol.for("react.block"):60121,w$2=b$4?Symbol.for("react.fundamental"):60117,x$2=b$4?Symbol.for("react.responder"):60118,y$2=b$4?Symbol.for("react.scope"):60119;function z$2(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case c$3:switch(e=e.type){case l$3:case m$3:case e$3:case g$3:case f$3:case p$3:return e;default:switch(e=e&&e.$$typeof){case k$4:case n$3:case t$3:case r$4:case h$2:return e;default:return t}}case d$3:return t}}}function A$2(e){return z$2(e)===m$3}reactIs_production_min$1.AsyncMode=l$3,reactIs_production_min$1.ConcurrentMode=m$3,reactIs_production_min$1.ContextConsumer=k$4,reactIs_production_min$1.ContextProvider=h$2,reactIs_production_min$1.Element=c$3,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$3,reactIs_production_min$1.Profiler=g$3,reactIs_production_min$1.StrictMode=f$3,reactIs_production_min$1.Suspense=p$3,reactIs_production_min$1.isAsyncMode=function(e){return A$2(e)||z$2(e)===l$3},reactIs_production_min$1.isConcurrentMode=A$2,reactIs_production_min$1.isContextConsumer=function(e){return z$2(e)===k$4},reactIs_production_min$1.isContextProvider=function(e){return z$2(e)===h$2},reactIs_production_min$1.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===c$3},reactIs_production_min$1.isForwardRef=function(e){return z$2(e)===n$3},reactIs_production_min$1.isFragment=function(e){return z$2(e)===e$3},reactIs_production_min$1.isLazy=function(e){return z$2(e)===t$3},reactIs_production_min$1.isMemo=function(e){return z$2(e)===r$4},reactIs_production_min$1.isPortal=function(e){return z$2(e)===d$3},reactIs_production_min$1.isProfiler=function(e){return z$2(e)===g$3},reactIs_production_min$1.isStrictMode=function(e){return z$2(e)===f$3},reactIs_production_min$1.isSuspense=function(e){return z$2(e)===p$3},reactIs_production_min$1.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===e$3||e===m$3||e===g$3||e===f$3||e===p$3||e===q$2||"object"==typeof e&&null!==e&&(e.$$typeof===t$3||e.$$typeof===r$4||e.$$typeof===h$2||e.$$typeof===k$4||e.$$typeof===n$3||e.$$typeof===w$2||e.$$typeof===x$2||e.$$typeof===y$2||e.$$typeof===v$3)},reactIs_production_min$1.typeOf=z$2,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,f=1;f<p;f++)d.push(u[f],u[0][f])}var h=withEmotionCache(function(e,t,n){var r=c&&e.as||a,i="",u=[],p=e;if(null==e.theme){for(var f in p={},e)p[f]=e[f];p.theme=reactExports.useContext(ThemeContext$1)}"string"==typeof e.className?i=getRegisteredStyles(t.registered,u,e.className):null!=e.className&&(i=e.className+" ");var h=serializeStyles(d.concat(u),t.registered,p);i+=t.key+"-"+h.name,void 0!==o&&(i+=" "+o);var m=c&&void 0===s?getDefaultShouldForwardProp(r):l,g={};for(var v in e)c&&"as"===v||m(v)&&(g[v]=e[v]);return g.className=i,g.ref=n,reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(Insertion,{cache:t,serialized:h,isStringTag:"string"==typeof r}),reactExports.createElement(r,g))});return h.displayName=void 0!==r?r:"Styled("+("string"==typeof a?a:a.displayName||a.name||"Component")+")",h.defaultProps=t.defaultProps,h.__emotion_real=h,h.__emotion_base=a,h.__emotion_styles=d,h.__emotion_forwardProp=s,Object.defineProperty(h,"toString",{value:function(){return"."+o}}),h.withComponent=function(t,r){return e(t,_extends({},n,r,{shouldForwardProp:composeShouldForwardProps(h,r,!0)})).apply(void 0,d)},h}},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(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(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=deepClone(e[n])}),t}function deepmerge(e,t,n={clone:!0}){const r=n.clone?_extends({},e):e;return isPlainObject(e)&&isPlainObject(t)&&Object.keys(t).forEach(o=>{reactExports.isValidElement(t[o])?r[o]=t[o]:isPlainObject(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&isPlainObject(e[o])?r[o]=deepmerge(e[o],t[o],n):n.clone?r[o]=isPlainObject(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$1(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$1(e,t){return t?deepmerge(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(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$1(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$1(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$1,{})}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$1(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$1(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$1(l,e)}else l=merge$1(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(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({breakpoints:s,direction:"ltr",components:{},palette:_extends({mode:"light"},r),spacing:l,shape:_extends({},shape,i)},a);return c=t.reduce((e,t)=>deepmerge(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$1(e[t]):`${isEmpty$3(r)?t:capitalize$1(t)}${capitalize$1(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,f=c||!1;let h=shouldForwardProp;"Root"===s?h=n:s?h=r:isStringTag(e)&&(h=void 0);const m=styled$1(e,_extends({shouldForwardProp:h,label:void 0},d)),g=(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)}),f||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 m(i,...r)};return m.withConfig&&(g.withConfig=m.withConfig),g}}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={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.white,default:common.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.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.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},f={dark:dark,light:light};return deepmerge(_extends({common:_extends({},common),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},f[t]),o)}const _excluded$1z=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function round$4(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),f=o/14,h=d||(e=>e/c*f+"rem"),m=(e,t,n,o,i)=>_extends({fontFamily:r,fontWeight:e,fontSize:h(t),lineHeight:n},r===defaultFontFamily?{letterSpacing:`${round$4(o/t)}em`}:{},i,u),g={h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(s,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(s,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(s,14,1.75,.4,caseAllCaps),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,caseAllCaps)};return deepmerge(_extends({htmlFontSize:c,pxToRem:h,fontFamily:r,fontSize:o,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:l},g),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(l,{mixins:createMixins(l.breakpoints,n),palette:s,shadows:shadows.slice(),typography:createTypography(s,i),transitions:createTransitions(o),zIndex:_extends({},zIndex)});return c=deepmerge(c,a),c=t.reduce((e,t)=>deepmerge(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(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(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(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:f,...h}=null!=c?c:{},m=t(),{css:g,cx:v}=r(),y=n(),b=runGetClassesOrUseCache({cache:y,cssObjectByRuleNameOrGetCssObjectByRuleName:e,classesOverridesRef:getDependencyArrayRef(f),paramsAndPluginParamsRef:getDependencyArrayRef(h),idOfUseStyles:s,context:m,getClasses:()=>{const e={},t=l({...c,...m,...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,`${g(r)}${typeGuard(n,n in e)?` ${e[n]}`:""}`]}));return objectKeys(e).forEach(t=>{t in n||(n[t]=e[t])}),n=mergeClasses(n,f,v),n}}),x=o({classes:b,css:g,cx:v,idOfUseStyles:s,name:i,...m,...h});return{classes:null!==(u=x.classes)&&void 0!==u?u:b,css:null!==(d=x.css)&&void 0!==d?d:g,cx:null!==(p=x.cx)&&void 0!==p?p:v,...m}}}}}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:f,disabledItemsFocusable:h=!1,disableListWrap:m=!1,filterOptions:g=defaultFilterOptions,filterSelectedOptions:v=!1,freeSolo:y=!1,getOptionDisabled:b,getOptionLabel:x=e=>{var t;return null!=(t=e.label)?t:e},groupBy:$,handleHomeEndKeys:_=!e.freeSolo,id:C,includeInputInList:w=!1,inputValue:S,isOptionEqualToValue:E=(e,t)=>e===t,multiple:k=!1,onChange:T,onClose:P,onHighlightChange:M,onInputChange:L,onOpen:I,open:R,openOnFocus:O=!1,options:A,readOnly:D=!1,selectOnFocus:N=!e.freeSolo,value:F}=e,z=useId$2(C);let B=x;B=e=>{const t=x(e);return"string"!=typeof t?String(t):t};const j=reactExports.useRef(!1),H=reactExports.useRef(!0),V=reactExports.useRef(null),U=reactExports.useRef(null),[W,Y]=reactExports.useState(null),[q,G]=reactExports.useState(-1),K=o?0:-1,X=reactExports.useRef(K),[Z,J]=useControlled({controlled:F,default:u,name:c}),[Q,ee]=useControlled({controlled:S,default:"",name:c,state:"inputValue"}),[te,ne]=reactExports.useState(!1),re=reactExports.useCallback((e,t)=>{if(!(k?Z.length<t.length:null!==t)&&!s)return;let n;if(k)n="";else if(null==t)n="";else{const e=B(t);n="string"==typeof e?e:""}Q!==n&&(ee(n),L&&L(e,n,"reset"))},[B,Q,k,L,ee,s,Z]),oe=reactExports.useRef();reactExports.useEffect(()=>{const e=Z!==oe.current;oe.current=Z,te&&!e||y&&!e||re(null,Z)},[Z,re,te,oe,y]);const[ie,ae]=useControlled({controlled:R,default:!1,name:c,state:"open"}),[se,le]=reactExports.useState(!0),ce=!k&&null!=Z&&Q===B(Z),ue=ie&&!D,de=ue?g(A.filter(e=>!v||!(k?Z:[Z]).some(t=>null!==t&&E(e,t))),{inputValue:ce&&se?"":Q,getOptionLabel:B}):[],pe=ie&&de.length>0&&!D,fe=useEventCallback(e=>{-1===e?V.current.focus():W.querySelector(`[data-tag-index="${e}"]`).focus()});reactExports.useEffect(()=>{k&&q>Z.length-1&&(G(-1),fe(-1))},[Z,k,q,fe]);const he=useEventCallback(({event:e,index:t,reason:r="auto"})=>{if(X.current=t,-1===t?V.current.removeAttribute("aria-activedescendant"):V.current.setAttribute("aria-activedescendant",`${z}-option-${t}`),M&&M(e,-1===t?null:de[t],r),!U.current)return;const o=U.current.querySelector(`[role="option"].${n}-focused`);o&&(o.classList.remove(`${n}-focused`),o.classList.remove(`${n}-focusVisible`));const i=U.current.parentElement.querySelector('[role="listbox"]');if(!i)return;if(-1===t)return void(i.scrollTop=0);const a=U.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*($?1.3:0)<i.scrollTop&&(i.scrollTop=e.offsetTop-e.offsetHeight*($?1.3:0))}}),me=useEventCallback(({event:e,diff:t,direction:n="next",reason:o="auto"})=>{if(!ue)return;const i=function(e,t){if(!U.current||-1===e)return-1;let n=e;for(;;){if("next"===t&&n===de.length||"previous"===t&&-1===n)return-1;const e=U.current.querySelector(`[data-option-index="${n}"]`),r=!h&&(!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=X.current+t;return n<0?-1===n&&w?-1:m&&-1!==X.current||Math.abs(t)>1?0:e:n>e?n===e+1&&w?-1:m||Math.abs(t)>1?e:0:n})(),n);if(he({index:i,reason:o,event:e}),r&&"reset"!==t)if(-1===i)V.current.value=Q;else{const e=B(de[i]);V.current.value=e;0===e.toLowerCase().indexOf(Q.toLowerCase())&&Q.length>0&&V.current.setSelectionRange(Q.length,e.length)}}),ge=reactExports.useCallback(()=>{if(!ue)return;const e=k?Z[0]:Z;if(0!==de.length&&null!=e){if(U.current){if(null!=e){const t=de[X.current];if(k&&t&&-1!==findIndex(Z,e=>E(t,e)))return;const n=findIndex(de,t=>E(t,e));return void(-1===n?me({diff:"reset"}):he({index:n}))}X.current>=de.length-1?he({index:de.length-1}):he({index:X.current})}}else me({diff:"reset"})},[de.length,!k&&Z,v,me,he,ue,Q,k]),ve=useEventCallback(e=>{setRef(U,e),e&&ge()});reactExports.useEffect(()=>{ge()},[ge]);const ye=e=>{ie||(ae(!0),le(!0),I&&I(e))},be=(e,t)=>{ie&&(ae(!1),P&&P(e,t))},xe=(e,t,n,r)=>{if(k){if(Z.length===t.length&&Z.every((e,n)=>e===t[n]))return}else if(Z===t)return;T&&T(e,t,n,r),J(t)},$e=reactExports.useRef(!1),_e=(e,t,n="selectOption",r="options")=>{let o=n,i=t;if(k){i=Array.isArray(Z)?Z.slice():[];const e=findIndex(i,e=>E(t,e));-1===e?i.push(t):"freeSolo"!==r&&(i.splice(e,1),o="removeOption")}re(e,i),xe(e,i,o,{option:t}),p||e&&(e.ctrlKey||e.metaKey)||be(e,o),(!0===a||"touch"===a&&$e.current||"mouse"===a&&!$e.current)&&V.current.blur()};const Ce=(e,t)=>{if(!k)return;""===Q&&be(e,"toggleInput");let n=q;-1===q?""===Q&&"previous"===t&&(n=Z.length-1):(n+="next"===t?1:-1,n<0&&(n=0),n===Z.length&&(n=-1)),n=function(e,t){if(-1===e)return-1;let n=e;for(;;){if("next"===t&&n===Z.length||"previous"===t&&-1===n)return-1;const e=W.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),fe(n)},we=e=>{j.current=!0,ee(""),L&&L(e,"","clear"),xe(e,k?[]:null,"clear")},Se=e=>t=>{if(e.onKeyDown&&e.onKeyDown(t),!t.defaultMuiPrevented&&(-1!==q&&-1===["ArrowLeft","ArrowRight"].indexOf(t.key)&&(G(-1),fe(-1)),229!==t.which))switch(t.key){case"Home":ue&&_&&(t.preventDefault(),me({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":ue&&_&&(t.preventDefault(),me({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),me({diff:-pageSize,direction:"previous",reason:"keyboard",event:t}),ye(t);break;case"PageDown":t.preventDefault(),me({diff:pageSize,direction:"next",reason:"keyboard",event:t}),ye(t);break;case"ArrowDown":t.preventDefault(),me({diff:1,direction:"next",reason:"keyboard",event:t}),ye(t);break;case"ArrowUp":t.preventDefault(),me({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!==X.current&&ue){const e=de[X.current],n=!!b&&b(e);if(t.preventDefault(),n)return;_e(t,e,"selectOption"),r&&V.current.setSelectionRange(V.current.value.length,V.current.value.length)}else y&&""!==Q&&!1===ce&&(k&&t.preventDefault(),_e(t,Q,"createOption","freeSolo"));break;case"Escape":ue?(t.preventDefault(),t.stopPropagation(),be(t,"escape")):l&&(""!==Q||k&&Z.length>0)&&(t.preventDefault(),t.stopPropagation(),we(t));break;case"Backspace":if(k&&!D&&""===Q&&Z.length>0){const e=-1===q?Z.length-1:q,n=Z.slice();n.splice(e,1),xe(t,n,"removeOption",{option:Z[e]})}break;case"Delete":if(k&&!D&&""===Q&&Z.length>0&&-1!==q){const e=q,n=Z.slice();n.splice(e,1),xe(t,n,"removeOption",{option:Z[e]})}}},Ee=e=>{ne(!0),O&&!j.current&&ye(e)},ke=e=>{t(U)?V.current.focus():(ne(!1),H.current=!0,j.current=!1,i&&-1!==X.current&&ue?_e(e,de[X.current],"blur"):i&&y&&""!==Q?_e(e,Q,"blur","freeSolo"):s&&re(e,Z),be(e,"blur"))},Te=e=>{const t=e.target.value;Q!==t&&(ee(t),le(!1),L&&L(e,t,"input")),""===t?d||k||xe(e,null,"clear"):ye(e)},Pe=e=>{he({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"mouse"})},Me=()=>{$e.current=!0},Le=e=>{const t=Number(e.currentTarget.getAttribute("data-option-index"));_e(e,de[t],"selectOption"),$e.current=!1},Ie=e=>t=>{const n=Z.slice();n.splice(e,1),xe(t,n,"removeOption",{option:Z[e]})},Re=e=>{ie?be(e,"toggleInput"):ye(e)},Oe=e=>{e.target.getAttribute("id")!==z&&e.preventDefault()},Ae=()=>{V.current.focus(),N&&H.current&&V.current.selectionEnd-V.current.selectionStart===0&&V.current.select(),H.current=!1},De=e=>{""!==Q&&ie||Re(e)};let Ne=y&&Q.length>0;Ne=Ne||(k?Z.length>0:null!==Z);let Fe=de;return $&&(Fe=de.reduce((e,t,n)=>{const r=$(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},[])),f&&te&&ke(),{getRootProps:(e={})=>_extends({"aria-owns":pe?`${z}-listbox`:null},e,{onKeyDown:Se(e),onMouseDown:Oe,onClick:Ae}),getInputLabelProps:()=>({id:`${z}-label`,htmlFor:z}),getInputProps:()=>({id:z,value:Q,onBlur:ke,onFocus:Ee,onChange:Te,onMouseDown:De,"aria-activedescendant":ue?"":null,"aria-autocomplete":r?"both":"list","aria-controls":pe?`${z}-listbox`:void 0,"aria-expanded":pe,autoComplete:"off",ref:V,autoCapitalize:"none",spellCheck:"false",role:"combobox"}),getClearProps:()=>({tabIndex:-1,onClick:we}),getPopupIndicatorProps:()=>({tabIndex:-1,onClick:Re}),getTagProps:({index:e})=>_extends({key:e,"data-tag-index":e,tabIndex:-1},!D&&{onDelete:Ie(e)}),getListboxProps:()=>({role:"listbox",id:`${z}-listbox`,"aria-labelledby":`${z}-label`,ref:ve,onMouseDown:e=>{e.preventDefault()}}),getOptionProps:({index:e,option:t})=>{const n=(k?Z:[Z]).some(e=>null!=e&&E(t,e)),r=!!b&&b(t);return{key:B(t),tabIndex:-1,role:"option",id:`${z}-option-${e}`,onMouseOver:Pe,onClick:Le,onTouchStart:Me,"data-option-index":e,"aria-disabled":r,"aria-selected":n}},id:z,inputValue:Q,value:Z,dirty:Ne,popupOpen:ue,focused:te||-1!==q,anchorEl:W,setAnchorEl:Y,focusedTag:q,groupedOptions:Fe}}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})),f=_extends({},e,{badgeContent:c,invisible:p,max:u,showZero:s}),h=useUtilityClasses$1f(f),m=n||a.root||"span",g=useSlotProps({elementType:m,externalSlotProps:i.root,externalForwardedProps:l,additionalProps:{ref:t},ownerState:f,className:h.root}),v=a.badge||"span",y=useSlotProps({elementType:v,externalSlotProps:i.badge,ownerState:f,className:h.badge});return factory$1(m,_extends({},g,{children:[r,factory$1(v,_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)},f={ref:u};return!1!==i&&(f[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&&(f[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,f)})}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),f=reactExports.useRef(!1),h=reactExports.useRef(null),m=useForkRef(t.ref,h),g=reactExports.useRef(null);reactExports.useEffect(()=>{s&&h.current&&(f.current=!n)},[n,s]),reactExports.useEffect(()=>{if(!s||!h.current)return;const e=ownerDocument(h.current);return h.current.contains(e.activeElement)||(h.current.hasAttribute("tabIndex")||h.current.setAttribute("tabIndex",-1),f.current&&h.current.focus()),()=>{o||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[s]),reactExports.useEffect(()=>{if(!s||!h.current)return;const e=ownerDocument(h.current),t=t=>{const{current:n}=h;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(!f.current)return;let r=[];if(e.activeElement!==c.current&&e.activeElement!==u.current||(r=i(h.current)),r.length>0){var o,s;const e=Boolean((null==(o=g.current)?void 0:o.shiftKey)&&"Tab"===(null==(s=g.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=>{g.current=t,!r&&a()&&"Tab"===t.key&&e.activeElement===h.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 v=e=>{null===d.current&&(d.current=e.relatedTarget),f.current=!0};return factory$1(reactExports.Fragment,{children:[factory$1("div",{tabIndex:s?0:-1,onFocus:v,ref:c,"data-testid":"sentinelStart"}),reactExports.cloneElement(t,{ref:m,onFocus:e=>{null===d.current&&(d.current=e.relatedTarget),f.current=!0,p.current=e.target;const n=t.props.onFocus;n&&n(e)}}),factory$1("div",{tabIndex:s?0:-1,onFocus:v,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="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$2(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$1=Math.max,min$1=Math.min,round$3=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$3(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&round$3(r.height)/e.offsetHeight||1);var a=(isElement$2(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$2(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$1(e,min$1(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,f="y"===l?bottom:right,h=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],m=a[l]-n.rects.reference[l],g=getOffsetParent$1(i),v=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,y=h/2-m/2,b=u[p],x=v-d[c]-u[f],$=v/2-d[c]/2+y,_=within(b,$,x),C=l;n.modifiersData[r]=((t={})[C]=_,t.centerOffset=_-$,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$3(n*o)/o||0,y:round$3(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,f=void 0===p?0:p,h=a.y,m=void 0===h?0:h,g="function"==typeof u?u({x:f,y:m}):{x:f,y:m};f=g.x,m=g.y;var v=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),b=left,x=top,$=window;if(c){var _=getOffsetParent$1(n),C="clientHeight",w="clientWidth";if(_===getWindow$1(n)&&"static"!==getComputedStyle$3(_=getDocumentElement$1(n)).position&&"absolute"===s&&(C="scrollHeight",w="scrollWidth"),o===top||(o===left||o===right)&&i===end)x=bottom,m-=(d&&_===$&&$.visualViewport?$.visualViewport.height:_[C])-r.height,m*=l?1:-1;if(o===left||(o===top||o===bottom)&&i===end)b=right,f-=(d&&_===$&&$.visualViewport?$.visualViewport.width:_[w])-r.width,f*=l?1:-1}var S,E=Object.assign({position:s},c&&unsetSides),k=!0===u?roundOffsetsByDPR({x:f,y:m},getWindow$1(n)):{x:f,y:m};return f=k.x,m=k.y,l?Object.assign({},E,((S={})[x]=y?"0":"",S[b]=v?"0":"",S.transform=($.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",S)):Object.assign({},E,((t={})[x]=y?m+"px":"",t[b]=v?f+"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$1(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=max$1(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$1(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$2(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$2(n)?t.filter(function(e){return isElement$2(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$1(o.top,t.top),t.right=min$1(o.right,t.right),t.bottom=min$1(o.bottom,t.bottom),t.left=max$1(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,f=n.altBoundary,h=void 0!==f&&f,m=n.padding,g=void 0===m?0:m,v=mergePaddingObject("number"!=typeof g?g:expandToHashMap(g,basePlacements)),y=p===popper?reference:popper,b=e.rects.popper,x=e.elements[h?y:p],$=getClippingRect$1(isElement$2(x)?x:x.contextElement||getDocumentElement$1(e.elements.popper),l,u,a),_=getBoundingClientRect$1(e.elements.reference),C=computeOffsets({reference:_,element:b,placement:o}),w=rectToClientRect$1(Object.assign({},b,C)),S=p===popper?w:_,E={top:$.top-S.top+v.top,bottom:S.bottom-$.bottom+v.bottom,left:$.left-S.left+v.left,right:S.right-$.right+v.right},k=e.modifiersData.offset;if(p===popper&&k){var T=k[o];Object.keys(E).forEach(function(e){var t=[right,bottom].indexOf(e)>=0?1:-1,n=[top,bottom].indexOf(e)>=0?"y":"x";E[e]+=T[n]*t})}return E}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 f=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(f).sort(function(e,t){return f[e]-f[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,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,g=t.options.placement,v=getBasePlacement(g),y=l||(v===g||!h?[getOppositePlacement$1(g)]:getExpandedFallbackPlacements(g)),b=[g].concat(y).reduce(function(e,n){return e.concat(getBasePlacement(n)===auto?computeAutoPlacement(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)},[]),x=t.rects.reference,$=t.rects.popper,_=new Map,C=!0,w=b[0],S=0;S<b.length;S++){var E=b[S],k=getBasePlacement(E),T=getVariation(E)===start,P=[top,bottom].indexOf(k)>=0,M=P?"width":"height",L=detectOverflow$1(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),I=P?T?right:left:T?bottom:top;x[M]>$[M]&&(I=getOppositePlacement$1(I));var R=getOppositePlacement$1(I),O=[];if(i&&O.push(L[k]<=0),s&&O.push(L[I]<=0,L[R]<=0),O.every(function(e){return e})){w=E,C=!1;break}_.set(E,O)}if(C)for(var A=function(e){var t=b.find(function(t){var n=_.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,"break"},D=h?3:1;D>0;D--){if("break"===A(D))break}t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,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,f=void 0===p||p,h=n.tetherOffset,m=void 0===h?0:h,g=detectOverflow$1(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=getBasePlacement(t.placement),y=getVariation(t.placement),b=!y,x=getMainAxisFromPlacement(v),$=getAltAxis(x),_=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,S="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,E="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),k=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,T={x:0,y:0};if(_){if(i){var P,M="y"===x?top:left,L="y"===x?bottom:right,I="y"===x?"height":"width",R=_[x],O=R+g[M],A=R-g[L],D=f?-w[I]/2:0,N=y===start?C[I]:w[I],F=y===start?-w[I]:-C[I],z=t.elements.arrow,B=f&&z?getLayoutRect(z):{width:0,height:0},j=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:getFreshSideObject(),H=j[M],V=j[L],U=within(0,C[I],B[I]),W=b?C[I]/2-D-U-H-E.mainAxis:N-U-H-E.mainAxis,Y=b?-C[I]/2+D+U+V+E.mainAxis:F+U+V+E.mainAxis,q=t.elements.arrow&&getOffsetParent$1(t.elements.arrow),G=q?"y"===x?q.clientTop||0:q.clientLeft||0:0,K=null!=(P=null==k?void 0:k[x])?P:0,X=R+Y-K,Z=within(f?min$1(O,R+W-K-G):O,R,f?max$1(A,X):A);_[x]=Z,T[x]=Z-R}if(s){var J,Q="x"===x?top:left,ee="x"===x?bottom:right,te=_[$],ne="y"===$?"height":"width",re=te+g[Q],oe=te-g[ee],ie=-1!==[top,left].indexOf(v),ae=null!=(J=null==k?void 0:k[$])?J:0,se=ie?re:te-C[ne]-w[ne]-ae+E.altAxis,le=ie?te+C[ne]+w[ne]-ae-E.altAxis:oe,ce=f&&ie?withinMaxClamp(se,te,le):within(f?se:re,te,f?le:oe);_[$]=ce,T[$]=ce-te}t.modifiersData[r]=T}}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$3(t.width)/e.offsetWidth||1,r=round$3(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$2(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
@@ -188,7 +188,7 @@ function _mergeNamespaces(e,t){for(var n=0;n<t.length;n++){const r=t[n];if("stri
188
188
  * Released under MIT license <https://lodash.com/license>
189
189
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
190
190
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
191
- */lodash.exports,function(e,t){(function(){var n,r="Expected a function",o="__lodash_hash_undefined__",i="__lodash_placeholder__",a=32,s=128,l=256,c=1/0,u=9007199254740991,d=NaN,p=4294967295,f=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",l]],h="[object Arguments]",m="[object Array]",g="[object Boolean]",v="[object Date]",y="[object Error]",b="[object Function]",x="[object GeneratorFunction]",$="[object Map]",_="[object Number]",C="[object Object]",w="[object Promise]",S="[object RegExp]",E="[object Set]",k="[object String]",T="[object Symbol]",P="[object WeakMap]",M="[object ArrayBuffer]",L="[object DataView]",I="[object Float32Array]",R="[object Float64Array]",O="[object Int8Array]",A="[object Int16Array]",D="[object Int32Array]",N="[object Uint8Array]",F="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",j=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,Y=RegExp(U.source),q=RegExp(W.source),G=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),ne=/^\s+/,re=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,pe=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,he=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ye=/($^)/,be=/['\n\r\u2028\u2029\\]/g,xe="\\ud800-\\udfff",$e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",we="A-Z\\xc0-\\xd6\\xd8-\\xde",Se="\\ufe0e\\ufe0f",Ee="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ke="['’]",Te="["+xe+"]",Pe="["+Ee+"]",Me="["+$e+"]",Le="\\d+",Ie="["+_e+"]",Re="["+Ce+"]",Oe="[^"+xe+Ee+Le+_e+Ce+we+"]",Ae="\\ud83c[\\udffb-\\udfff]",De="[^"+xe+"]",Ne="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",ze="["+we+"]",Be="\\u200d",je="(?:"+Re+"|"+Oe+")",He="(?:"+ze+"|"+Oe+")",Ve="(?:['’](?:d|ll|m|re|s|t|ve))?",Ue="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Me+"|"+Ae+")"+"?",Ye="["+Se+"]?",qe=Ye+We+("(?:"+Be+"(?:"+[De,Ne,Fe].join("|")+")"+Ye+We+")*"),Ge="(?:"+[Ie,Ne,Fe].join("|")+")"+qe,Ke="(?:"+[De+Me+"?",Me,Ne,Fe,Te].join("|")+")",Xe=RegExp(ke,"g"),Ze=RegExp(Me,"g"),Je=RegExp(Ae+"(?="+Ae+")|"+Ke+qe,"g"),Qe=RegExp([ze+"?"+Re+"+"+Ve+"(?="+[Pe,ze,"$"].join("|")+")",He+"+"+Ue+"(?="+[Pe,ze+je,"$"].join("|")+")",ze+"?"+je+"+"+Ve,ze+"+"+Ue,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Le,Ge].join("|"),"g"),et=RegExp("["+Be+xe+$e+Se+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,ot={};ot[I]=ot[R]=ot[O]=ot[A]=ot[D]=ot[N]=ot[F]=ot[z]=ot[B]=!0,ot[h]=ot[m]=ot[M]=ot[g]=ot[L]=ot[v]=ot[y]=ot[b]=ot[$]=ot[_]=ot[C]=ot[S]=ot[E]=ot[k]=ot[P]=!1;var it={};it[h]=it[m]=it[M]=it[L]=it[g]=it[v]=it[I]=it[R]=it[O]=it[A]=it[D]=it[$]=it[_]=it[C]=it[S]=it[E]=it[k]=it[T]=it[N]=it[F]=it[z]=it[B]=!0,it[y]=it[b]=it[P]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ct="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,ut="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||ut||Function("return this")(),pt=t&&!t.nodeType&&t,ft=pt&&e&&!e.nodeType&&e,ht=ft&&ft.exports===pt,mt=ht&&ct.process,gt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||mt&&mt.binding&&mt.binding("util")}catch(e2){}}(),vt=gt&&gt.isArrayBuffer,yt=gt&&gt.isDate,bt=gt&&gt.isMap,xt=gt&&gt.isRegExp,$t=gt&&gt.isSet,_t=gt&&gt.isTypedArray;function Ct(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function wt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function St(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Et(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function kt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Tt(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function Pt(e,t){return!!(null==e?0:e.length)&&zt(e,t,0)>-1}function Mt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function Lt(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function It(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function Rt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function Ot(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function At(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Dt=Vt("length");function Nt(e,t,n){var r;return n(e,function(e,n,o){if(t(e,n,o))return r=n,!1}),r}function Ft(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function zt(e,t,n){return t==t?function(e,t,n){var r=n-1,o=e.length;for(;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):Ft(e,jt,n)}function Bt(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function jt(e){return e!=e}function Ht(e,t){var n=null==e?0:e.length;return n?Yt(e,t)/n:d}function Vt(e){return function(t){return null==t?n:t[e]}}function Ut(e){return function(t){return null==e?n:e[t]}}function Wt(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}function Yt(e,t){for(var r,o=-1,i=e.length;++o<i;){var a=t(e[o]);a!==n&&(r=r===n?a:r+a)}return r}function qt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Gt(e){return e?e.slice(0,dn(e)+1).replace(ne,""):e}function Kt(e){return function(t){return e(t)}}function Xt(e,t){return Lt(t,function(t){return e[t]})}function Zt(e,t){return e.has(t)}function Jt(e,t){for(var n=-1,r=e.length;++n<r&&zt(t,e[n],0)>-1;);return n}function Qt(e,t){for(var n=e.length;n--&&zt(t,e[n],0)>-1;);return n}var en=Ut({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),tn=Ut({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(e){return"\\"+at[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function an(e,t){return function(n){return e(t(n))}}function sn(e,t){for(var n=-1,r=e.length,o=0,a=[];++n<r;){var s=e[n];s!==t&&s!==i||(e[n]=i,a[o++]=n)}return a}function ln(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function cn(e){return rn(e)?function(e){var t=Je.lastIndex=0;for(;Je.test(e);)++t;return t}(e):Dt(e)}function un(e){return rn(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function dn(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}var pn=Ut({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var fn=function e(t){var re,xe=(t=null==t?dt:fn.defaults(dt.Object(),t,fn.pick(dt,nt))).Array,$e=t.Date,_e=t.Error,Ce=t.Function,we=t.Math,Se=t.Object,Ee=t.RegExp,ke=t.String,Te=t.TypeError,Pe=xe.prototype,Me=Ce.prototype,Le=Se.prototype,Ie=t["__core-js_shared__"],Re=Me.toString,Oe=Le.hasOwnProperty,Ae=0,De=(re=/[^.]+$/.exec(Ie&&Ie.keys&&Ie.keys.IE_PROTO||""))?"Symbol(src)_1."+re:"",Ne=Le.toString,Fe=Re.call(Se),ze=dt._,Be=Ee("^"+Re.call(Oe).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),je=ht?t.Buffer:n,He=t.Symbol,Ve=t.Uint8Array,Ue=je?je.allocUnsafe:n,We=an(Se.getPrototypeOf,Se),Ye=Se.create,qe=Le.propertyIsEnumerable,Ge=Pe.splice,Ke=He?He.isConcatSpreadable:n,Je=He?He.iterator:n,et=He?He.toStringTag:n,at=function(){try{var e=ui(Se,"defineProperty");return e({},"",{}),e}catch(e2){}}(),ct=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ut=$e&&$e.now!==dt.Date.now&&$e.now,pt=t.setTimeout!==dt.setTimeout&&t.setTimeout,ft=we.ceil,mt=we.floor,gt=Se.getOwnPropertySymbols,Dt=je?je.isBuffer:n,Ut=t.isFinite,hn=Pe.join,mn=an(Se.keys,Se),gn=we.max,vn=we.min,yn=$e.now,bn=t.parseInt,xn=we.random,$n=Pe.reverse,_n=ui(t,"DataView"),Cn=ui(t,"Map"),wn=ui(t,"Promise"),Sn=ui(t,"Set"),En=ui(t,"WeakMap"),kn=ui(Se,"create"),Tn=En&&new En,Pn={},Mn=zi(_n),Ln=zi(Cn),In=zi(wn),Rn=zi(Sn),On=zi(En),An=He?He.prototype:n,Dn=An?An.valueOf:n,Nn=An?An.toString:n;function Fn(e){if(ns(e)&&!Wa(e)&&!(e instanceof Hn)){if(e instanceof jn)return e;if(Oe.call(e,"__wrapped__"))return Bi(e)}return new jn(e)}var zn=function(){function e(){}return function(t){if(!ts(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Bn(){}function jn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Hn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Un(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Wn;++t<n;)this.add(e[t])}function qn(e){var t=this.__data__=new Un(e);this.size=t.size}function Gn(e,t){var n=Wa(e),r=!n&&Ua(e),o=!n&&!r&&Ka(e),i=!n&&!r&&!o&&us(e),a=n||r||o||i,s=a?qt(e.length,ke):[],l=s.length;for(var c in e)!t&&!Oe.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||vi(c,l))||s.push(c);return s}function Kn(e){var t=e.length;return t?e[Yr(0,t-1)]:n}function Xn(e,t){return Ri(To(e),ir(t,0,e.length))}function Zn(e){return Ri(To(e))}function Jn(e,t,r){(r!==n&&!ja(e[t],r)||r===n&&!(t in e))&&rr(e,t,r)}function Qn(e,t,r){var o=e[t];Oe.call(e,t)&&ja(o,r)&&(r!==n||t in e)||rr(e,t,r)}function er(e,t){for(var n=e.length;n--;)if(ja(e[n][0],t))return n;return-1}function tr(e,t,n,r){return ur(e,function(e,o,i){t(r,e,n(e),i)}),r}function nr(e,t){return e&&Po(t,Is(t),e)}function rr(e,t,n){"__proto__"==t&&at?at(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function or(e,t){for(var r=-1,o=t.length,i=xe(o),a=null==e;++r<o;)i[r]=a?n:ks(e,t[r]);return i}function ir(e,t,r){return e==e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function ar(e,t,r,o,i,a){var s,l=1&t,c=2&t,u=4&t;if(r&&(s=i?r(e,o,i,a):r(e)),s!==n)return s;if(!ts(e))return e;var d=Wa(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Oe.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return To(e,s)}else{var p=fi(e),f=p==b||p==x;if(Ka(e))return _o(e,l);if(p==C||p==h||f&&!i){if(s=c||f?{}:mi(e),!l)return c?function(e,t){return Po(e,pi(e),t)}(e,function(e,t){return e&&Po(t,Rs(t),e)}(s,e)):function(e,t){return Po(e,di(e),t)}(e,nr(s,e))}else{if(!it[p])return i?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case M:return Co(e);case g:case v:return new r(+e);case L:return function(e,t){var n=t?Co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case I:case R:case O:case A:case D:case N:case F:case z:case B:return wo(e,n);case $:return new r;case _:case k:return new r(e);case S:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new r;case T:return o=e,Dn?Se(Dn.call(o)):{}}var o}(e,p,l)}}a||(a=new qn);var m=a.get(e);if(m)return m;a.set(e,s),ss(e)?e.forEach(function(n){s.add(ar(n,t,r,n,e,a))}):rs(e)&&e.forEach(function(n,o){s.set(o,ar(n,t,r,o,e,a))});var y=d?n:(u?c?ri:ni:c?Rs:Is)(e);return St(y||e,function(n,o){y&&(n=e[o=n]),Qn(s,o,ar(n,t,r,o,e,a))}),s}function sr(e,t,r){var o=r.length;if(null==e)return!o;for(e=Se(e);o--;){var i=r[o],a=t[i],s=e[i];if(s===n&&!(i in e)||!a(s))return!1}return!0}function lr(e,t,o){if("function"!=typeof e)throw new Te(r);return Pi(function(){e.apply(n,o)},t)}function cr(e,t,n,r){var o=-1,i=Pt,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=Lt(t,Kt(n))),r?(i=Mt,a=!1):t.length>=200&&(i=Zt,a=!1,t=new Yn(t));e:for(;++o<s;){var u=e[o],d=null==n?u:n(u);if(u=r||0!==u?u:0,a&&d==d){for(var p=c;p--;)if(t[p]===d)continue e;l.push(u)}else i(t,d,r)||l.push(u)}return l}Fn.templateSettings={escape:G,evaluate:K,interpolate:X,variable:"",imports:{_:Fn}},Fn.prototype=Bn.prototype,Fn.prototype.constructor=Fn,jn.prototype=zn(Bn.prototype),jn.prototype.constructor=jn,Hn.prototype=zn(Bn.prototype),Hn.prototype.constructor=Hn,Vn.prototype.clear=function(){this.__data__=kn?kn(null):{},this.size=0},Vn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Vn.prototype.get=function(e){var t=this.__data__;if(kn){var r=t[e];return r===o?n:r}return Oe.call(t,e)?t[e]:n},Vn.prototype.has=function(e){var t=this.__data__;return kn?t[e]!==n:Oe.call(t,e)},Vn.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=kn&&t===n?o:t,this},Un.prototype.clear=function(){this.__data__=[],this.size=0},Un.prototype.delete=function(e){var t=this.__data__,n=er(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ge.call(t,n,1),--this.size,!0)},Un.prototype.get=function(e){var t=this.__data__,r=er(t,e);return r<0?n:t[r][1]},Un.prototype.has=function(e){return er(this.__data__,e)>-1},Un.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(Cn||Un),string:new Vn}},Wn.prototype.delete=function(e){var t=li(this,e).delete(e);return this.size-=t?1:0,t},Wn.prototype.get=function(e){return li(this,e).get(e)},Wn.prototype.has=function(e){return li(this,e).has(e)},Wn.prototype.set=function(e,t){var n=li(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Yn.prototype.add=Yn.prototype.push=function(e){return this.__data__.set(e,o),this},Yn.prototype.has=function(e){return this.__data__.has(e)},qn.prototype.clear=function(){this.__data__=new Un,this.size=0},qn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},qn.prototype.get=function(e){return this.__data__.get(e)},qn.prototype.has=function(e){return this.__data__.has(e)},qn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Un){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(e,t),this.size=n.size,this};var ur=Io(yr),dr=Io(br,!0);function pr(e,t){var n=!0;return ur(e,function(e,r,o){return n=!!t(e,r,o)}),n}function fr(e,t,r){for(var o=-1,i=e.length;++o<i;){var a=e[o],s=t(a);if(null!=s&&(l===n?s==s&&!cs(s):r(s,l)))var l=s,c=a}return c}function hr(e,t){var n=[];return ur(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}function mr(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=gi),o||(o=[]);++i<a;){var s=e[i];t>0&&n(s)?t>1?mr(s,t-1,n,r,o):It(o,s):r||(o[o.length]=s)}return o}var gr=Ro(),vr=Ro(!0);function yr(e,t){return e&&gr(e,t,Is)}function br(e,t){return e&&vr(e,t,Is)}function xr(e,t){return Tt(t,function(t){return Ja(e[t])})}function $r(e,t){for(var r=0,o=(t=yo(t,e)).length;null!=e&&r<o;)e=e[Fi(t[r++])];return r&&r==o?e:n}function _r(e,t,n){var r=t(e);return Wa(e)?r:It(r,n(e))}function Cr(e){return null==e?e===n?"[object Undefined]":"[object Null]":et&&et in Se(e)?function(e){var t=Oe.call(e,et),r=e[et];try{e[et]=n;var o=!0}catch(e2){}var i=Ne.call(e);o&&(t?e[et]=r:delete e[et]);return i}(e):function(e){return Ne.call(e)}(e)}function wr(e,t){return e>t}function Sr(e,t){return null!=e&&Oe.call(e,t)}function Er(e,t){return null!=e&&t in Se(e)}function kr(e,t,r){for(var o=r?Mt:Pt,i=e[0].length,a=e.length,s=a,l=xe(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Lt(d,Kt(t))),c=vn(d.length,c),l[s]=!r&&(t||i>=120&&d.length>=120)?new Yn(s&&d):n}d=e[0];var p=-1,f=l[0];e:for(;++p<i&&u.length<c;){var h=d[p],m=t?t(h):h;if(h=r||0!==h?h:0,!(f?Zt(f,m):o(u,m,r))){for(s=a;--s;){var g=l[s];if(!(g?Zt(g,m):o(e[s],m,r)))continue e}f&&f.push(m),u.push(h)}}return u}function Tr(e,t,r){var o=null==(e=Ei(e,t=yo(t,e)))?e:e[Fi(Zi(t))];return null==o?n:Ct(o,e,r)}function Pr(e){return ns(e)&&Cr(e)==h}function Mr(e,t,r,o,i){return e===t||(null==e||null==t||!ns(e)&&!ns(t)?e!=e&&t!=t:function(e,t,r,o,i,a){var s=Wa(e),l=Wa(t),c=s?m:fi(e),u=l?m:fi(t),d=(c=c==h?C:c)==C,p=(u=u==h?C:u)==C,f=c==u;if(f&&Ka(e)){if(!Ka(t))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new qn),s||us(e)?ei(e,t,r,o,i,a):function(e,t,n,r,o,i,a){switch(n){case L:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case M:return!(e.byteLength!=t.byteLength||!i(new Ve(e),new Ve(t)));case g:case v:case _:return ja(+e,+t);case y:return e.name==t.name&&e.message==t.message;case S:case k:return e==t+"";case $:var s=on;case E:var l=1&r;if(s||(s=ln),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=ei(s(e),s(t),r,o,i,a);return a.delete(e),u;case T:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,c,r,o,i,a);if(!(1&r)){var b=d&&Oe.call(e,"__wrapped__"),x=p&&Oe.call(t,"__wrapped__");if(b||x){var w=b?e.value():e,P=x?t.value():t;return a||(a=new qn),i(w,P,r,o,a)}}if(!f)return!1;return a||(a=new qn),function(e,t,r,o,i,a){var s=1&r,l=ni(e),c=l.length,u=ni(t),d=u.length;if(c!=d&&!s)return!1;var p=c;for(;p--;){var f=l[p];if(!(s?f in t:Oe.call(t,f)))return!1}var h=a.get(e),m=a.get(t);if(h&&m)return h==t&&m==e;var g=!0;a.set(e,t),a.set(t,e);var v=s;for(;++p<c;){var y=e[f=l[p]],b=t[f];if(o)var x=s?o(b,y,f,t,e,a):o(y,b,f,e,t,a);if(!(x===n?y===b||i(y,b,r,o,a):x)){g=!1;break}v||(v="constructor"==f)}if(g&&!v){var $=e.constructor,_=t.constructor;$==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof $&&$ instanceof $&&"function"==typeof _&&_ instanceof _||(g=!1)}return a.delete(e),a.delete(t),g}(e,t,r,o,i,a)}(e,t,r,o,Mr,i))}function Lr(e,t,r,o){var i=r.length,a=i,s=!o;if(null==e)return!a;for(e=Se(e);i--;){var l=r[i];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<a;){var c=(l=r[i])[0],u=e[c],d=l[1];if(s&&l[2]){if(u===n&&!(c in e))return!1}else{var p=new qn;if(o)var f=o(u,d,c,e,t,p);if(!(f===n?Mr(d,u,3,o,p):f))return!1}}return!0}function Ir(e){return!(!ts(e)||(t=e,De&&De in t))&&(Ja(e)?Be:he).test(zi(e));var t}function Rr(e){return"function"==typeof e?e:null==e?ol:"object"==typeof e?Wa(e)?zr(e[0],e[1]):Fr(e):fl(e)}function Or(e){if(!_i(e))return mn(e);var t=[];for(var n in Se(e))Oe.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Ar(e){if(!ts(e))return function(e){var t=[];if(null!=e)for(var n in Se(e))t.push(n);return t}(e);var t=_i(e),n=[];for(var r in e)("constructor"!=r||!t&&Oe.call(e,r))&&n.push(r);return n}function Dr(e,t){return e<t}function Nr(e,t){var n=-1,r=qa(e)?xe(e.length):[];return ur(e,function(e,o,i){r[++n]=t(e,o,i)}),r}function Fr(e){var t=ci(e);return 1==t.length&&t[0][2]?wi(t[0][0],t[0][1]):function(n){return n===e||Lr(n,e,t)}}function zr(e,t){return bi(e)&&Ci(t)?wi(Fi(e),t):function(r){var o=ks(r,e);return o===n&&o===t?Ts(r,e):Mr(t,o,3)}}function Br(e,t,r,o,i){e!==t&&gr(t,function(a,s){if(i||(i=new qn),ts(a))!function(e,t,r,o,i,a,s){var l=ki(e,r),c=ki(t,r),u=s.get(c);if(u)return void Jn(e,r,u);var d=a?a(l,c,r+"",e,t,s):n,p=d===n;if(p){var f=Wa(c),h=!f&&Ka(c),m=!f&&!h&&us(c);d=c,f||h||m?Wa(l)?d=l:Ga(l)?d=To(l):h?(p=!1,d=_o(c,!0)):m?(p=!1,d=wo(c,!0)):d=[]:is(c)||Ua(c)?(d=l,Ua(l)?d=ys(l):ts(l)&&!Ja(l)||(d=mi(c))):p=!1}p&&(s.set(c,d),i(d,c,o,a,s),s.delete(c));Jn(e,r,d)}(e,t,s,r,Br,o,i);else{var l=o?o(ki(e,s),a,s+"",e,t,i):n;l===n&&(l=a),Jn(e,s,l)}},Rs)}function jr(e,t){var r=e.length;if(r)return vi(t+=t<0?r:0,r)?e[t]:n}function Hr(e,t,n){t=t.length?Lt(t,function(e){return Wa(e)?function(t){return $r(t,1===e.length?e[0]:e)}:e}):[ol];var r=-1;return t=Lt(t,Kt(si())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(Nr(e,function(e,n,o){return{criteria:Lt(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return function(e,t,n){var r=-1,o=e.criteria,i=t.criteria,a=o.length,s=n.length;for(;++r<a;){var l=So(o[r],i[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)})}function Vr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],s=$r(e,a);n(s,a)&&Zr(i,yo(a,e),s)}return i}function Ur(e,t,n,r){var o=r?Bt:zt,i=-1,a=t.length,s=e;for(e===t&&(t=To(t)),n&&(s=Lt(e,Kt(n)));++i<a;)for(var l=0,c=t[i],u=n?n(c):c;(l=o(s,u,l,r))>-1;)s!==e&&Ge.call(s,l,1),Ge.call(e,l,1);return e}function Wr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;vi(o)?Ge.call(e,o,1):co(e,o)}}return e}function Yr(e,t){return e+mt(xn()*(t-e+1))}function qr(e,t){var n="";if(!e||t<1||t>u)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Gr(e,t){return Mi(Si(e,t,ol),e+"")}function Kr(e){return Kn(js(e))}function Xr(e,t){var n=js(e);return Ri(n,ir(t,0,n.length))}function Zr(e,t,r,o){if(!ts(e))return e;for(var i=-1,a=(t=yo(t,e)).length,s=a-1,l=e;null!=l&&++i<a;){var c=Fi(t[i]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=s){var d=l[c];(u=o?o(d,c,l):n)===n&&(u=ts(d)?d:vi(t[i+1])?[]:{})}Qn(l,c,u),l=l[c]}return e}var Jr=Tn?function(e,t){return Tn.set(e,t),e}:ol,Qr=at?function(e,t){return at(e,"toString",{configurable:!0,enumerable:!1,value:tl(t),writable:!0})}:ol;function eo(e){return Ri(js(e))}function to(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=xe(o);++r<o;)i[r]=e[r+t];return i}function no(e,t){var n;return ur(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}function ro(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!cs(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return oo(e,t,ol,n)}function oo(e,t,r,o){var i=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=r(t))!=t,l=null===t,c=cs(t),u=t===n;i<a;){var d=mt((i+a)/2),p=r(e[d]),f=p!==n,h=null===p,m=p==p,g=cs(p);if(s)var v=o||m;else v=u?m&&(o||f):l?m&&f&&(o||!h):c?m&&f&&!h&&(o||!g):!h&&!g&&(o?p<=t:p<t);v?i=d+1:a=d}return vn(a,4294967294)}function io(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!ja(s,l)){var l=s;i[o++]=0===a?0:a}}return i}function ao(e){return"number"==typeof e?e:cs(e)?d:+e}function so(e){if("string"==typeof e)return e;if(Wa(e))return Lt(e,so)+"";if(cs(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function lo(e,t,n){var r=-1,o=Pt,i=e.length,a=!0,s=[],l=s;if(n)a=!1,o=Mt;else if(i>=200){var c=t?null:Go(e);if(c)return ln(c);a=!1,o=Zt,l=new Yn}else l=t?[]:s;e:for(;++r<i;){var u=e[r],d=t?t(u):u;if(u=n||0!==u?u:0,a&&d==d){for(var p=l.length;p--;)if(l[p]===d)continue e;t&&l.push(d),s.push(u)}else o(l,d,n)||(l!==s&&l.push(d),s.push(u))}return s}function co(e,t){var n=-1,r=(t=yo(t,e)).length;if(!r)return!0;for(var o=null==e||"object"!=typeof e&&"function"!=typeof e;++n<r;){var i=t[n];if("string"==typeof i){if("__proto__"===i&&!Oe.call(e,"__proto__"))return!1;if("constructor"===i&&n+1<r&&"string"==typeof t[n+1]&&"prototype"===t[n+1]){if(o&&0===n)continue;return!1}}}var a=Ei(e,t);return null==a||delete a[Fi(Zi(t))]}function uo(e,t,n,r){return Zr(e,t,n($r(e,t)),r)}function po(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?to(e,r?0:i,r?i+1:o):to(e,r?i+1:0,r?o:i)}function fo(e,t){var n=e;return n instanceof Hn&&(n=n.value()),Rt(t,function(e,t){return t.func.apply(t.thisArg,It([e],t.args))},n)}function ho(e,t,n){var r=e.length;if(r<2)return r?lo(e[0]):[];for(var o=-1,i=xe(r);++o<r;)for(var a=e[o],s=-1;++s<r;)s!=o&&(i[o]=cr(i[o]||a,e[s],t,n));return lo(mr(i,1),t,n)}function mo(e,t,r){for(var o=-1,i=e.length,a=t.length,s={};++o<i;){var l=o<a?t[o]:n;r(s,e[o],l)}return s}function go(e){return Ga(e)?e:[]}function vo(e){return"function"==typeof e?e:ol}function yo(e,t){return Wa(e)?e:bi(e,t)?[e]:Ni(bs(e))}var bo=Gr;function xo(e,t,r){var o=e.length;return r=r===n?o:r,!t&&r>=o?e:to(e,t,r)}var $o=ct||function(e){return dt.clearTimeout(e)};function _o(e,t){if(t)return e.slice();var n=e.length,r=Ue?Ue(n):new e.constructor(n);return e.copy(r),r}function Co(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function wo(e,t){var n=t?Co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function So(e,t){if(e!==t){var r=e!==n,o=null===e,i=e==e,a=cs(e),s=t!==n,l=null===t,c=t==t,u=cs(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||o&&s&&c||!r&&c||!i)return 1;if(!o&&!a&&!u&&e<t||u&&r&&i&&!o&&!a||l&&r&&i||!s&&i||!c)return-1}return 0}function Eo(e,t,n,r){for(var o=-1,i=e.length,a=n.length,s=-1,l=t.length,c=gn(i-a,0),u=xe(l+c),d=!r;++s<l;)u[s]=t[s];for(;++o<a;)(d||o<i)&&(u[n[o]]=e[o]);for(;c--;)u[s++]=e[o++];return u}function ko(e,t,n,r){for(var o=-1,i=e.length,a=-1,s=n.length,l=-1,c=t.length,u=gn(i-s,0),d=xe(u+c),p=!r;++o<u;)d[o]=e[o];for(var f=o;++l<c;)d[f+l]=t[l];for(;++a<s;)(p||o<i)&&(d[f+n[a]]=e[o++]);return d}function To(e,t){var n=-1,r=e.length;for(t||(t=xe(r));++n<r;)t[n]=e[n];return t}function Po(e,t,r,o){var i=!r;r||(r={});for(var a=-1,s=t.length;++a<s;){var l=t[a],c=o?o(r[l],e[l],l,r,e):n;c===n&&(c=e[l]),i?rr(r,l,c):Qn(r,l,c)}return r}function Mo(e,t){return function(n,r){var o=Wa(n)?wt:tr,i=t?t():{};return o(n,e,si(r,2),i)}}function Lo(e){return Gr(function(t,r){var o=-1,i=r.length,a=i>1?r[i-1]:n,s=i>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(i--,a):n,s&&yi(r[0],r[1],s)&&(a=i<3?n:a,i=1),t=Se(t);++o<i;){var l=r[o];l&&e(t,l,o,a)}return t})}function Io(e,t){return function(n,r){if(null==n)return n;if(!qa(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=Se(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function Ro(e){return function(t,n,r){for(var o=-1,i=Se(t),a=r(t),s=a.length;s--;){var l=a[e?s:++o];if(!1===n(i[l],l,i))break}return t}}function Oo(e){return function(t){var r=rn(t=bs(t))?un(t):n,o=r?r[0]:t.charAt(0),i=r?xo(r,1).join(""):t.slice(1);return o[e]()+i}}function Ao(e){return function(t){return Rt(Js(Us(t).replace(Xe,"")),e,"")}}function Do(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=zn(e.prototype),r=e.apply(n,t);return ts(r)?r:n}}function No(e){return function(t,r,o){var i=Se(t);if(!qa(t)){var a=si(r,3);t=Is(t),r=function(e){return a(i[e],e,i)}}var s=e(t,r,o);return s>-1?i[a?t[s]:s]:n}}function Fo(e){return ti(function(t){var o=t.length,i=o,a=jn.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if("function"!=typeof s)throw new Te(r);if(a&&!l&&"wrapper"==ii(s))var l=new jn([],!0)}for(i=l?i:o;++i<o;){var c=ii(s=t[i]),u="wrapper"==c?oi(s):n;l=u&&xi(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[ii(u[0])].apply(l,u[3]):1==s.length&&xi(s)?l[c]():l.thru(s)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Wa(n))return l.plant(n).value();for(var r=0,i=o?t[r].apply(this,e):n;++r<o;)i=t[r].call(this,i);return i}})}function zo(e,t,r,o,i,a,l,c,u,d){var p=t&s,f=1&t,h=2&t,m=24&t,g=512&t,v=h?n:Do(e);return function s(){for(var y=arguments.length,b=xe(y),x=y;x--;)b[x]=arguments[x];if(m)var $=ai(s),_=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(b,$);if(o&&(b=Eo(b,o,i,m)),a&&(b=ko(b,a,l,m)),y-=_,m&&y<d){var C=sn(b,$);return Yo(e,t,zo,s.placeholder,r,b,C,c,u,d-y)}var w=f?r:this,S=h?w[e]:e;return y=b.length,c?b=function(e,t){var r=e.length,o=vn(t.length,r),i=To(e);for(;o--;){var a=t[o];e[o]=vi(a,r)?i[a]:n}return e}(b,c):g&&y>1&&b.reverse(),p&&u<y&&(b.length=u),this&&this!==dt&&this instanceof s&&(S=v||Do(S)),S.apply(w,b)}}function Bo(e,t){return function(n,r){return function(e,t,n,r){return yr(e,function(e,o,i){t(r,n(e),o,i)}),r}(n,e,t(r),{})}}function jo(e,t){return function(r,o){var i;if(r===n&&o===n)return t;if(r!==n&&(i=r),o!==n){if(i===n)return o;"string"==typeof r||"string"==typeof o?(r=so(r),o=so(o)):(r=ao(r),o=ao(o)),i=e(r,o)}return i}}function Ho(e){return ti(function(t){return t=Lt(t,Kt(si())),Gr(function(n){var r=this;return e(t,function(e){return Ct(e,r,n)})})})}function Vo(e,t){var r=(t=t===n?" ":so(t)).length;if(r<2)return r?qr(t,e):t;var o=qr(t,ft(e/cn(t)));return rn(t)?xo(un(o),0,e).join(""):o.slice(0,e)}function Uo(e){return function(t,r,o){return o&&"number"!=typeof o&&yi(t,r,o)&&(r=o=n),t=hs(t),r===n?(r=t,t=0):r=hs(r),function(e,t,n,r){for(var o=-1,i=gn(ft((t-e)/(n||1)),0),a=xe(i);i--;)a[r?i:++o]=e,e+=n;return a}(t,r,o=o===n?t<r?1:-1:hs(o),e)}}function Wo(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=vs(t),n=vs(n)),e(t,n)}}function Yo(e,t,r,o,i,s,l,c,u,d){var p=8&t;t|=p?a:64,4&(t&=~(p?64:a))||(t&=-4);var f=[e,t,i,p?s:n,p?l:n,p?n:s,p?n:l,c,u,d],h=r.apply(n,f);return xi(e)&&Ti(h,f),h.placeholder=o,Li(h,e,t)}function qo(e){var t=we[e];return function(e,n){if(e=vs(e),(n=null==n?0:vn(ms(n),292))&&Ut(e)){var r=(bs(e)+"e").split("e");return+((r=(bs(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Go=Sn&&1/ln(new Sn([,-0]))[1]==c?function(e){return new Sn(e)}:cl;function Ko(e){return function(t){var n=fi(t);return n==$?on(t):n==E?function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}(t):function(e,t){return Lt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Xo(e,t,o,c,u,d,p,f){var h=2&t;if(!h&&"function"!=typeof e)throw new Te(r);var m=c?c.length:0;if(m||(t&=-97,c=u=n),p=p===n?p:gn(ms(p),0),f=f===n?f:ms(f),m-=u?u.length:0,64&t){var g=c,v=u;c=u=n}var y=h?n:oi(e),b=[e,t,o,c,u,g,v,d,p,f];if(y&&function(e,t){var n=e[1],r=t[1],o=n|r,a=o<131,c=r==s&&8==n||r==s&&n==l&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!a&&!c)return e;1&r&&(e[2]=t[2],o|=1&n?0:4);var u=t[3];if(u){var d=e[3];e[3]=d?Eo(d,u,t[4]):u,e[4]=d?sn(e[3],i):t[4]}(u=t[5])&&(d=e[5],e[5]=d?ko(d,u,t[6]):u,e[6]=d?sn(e[5],i):t[6]);(u=t[7])&&(e[7]=u);r&s&&(e[8]=null==e[8]?t[8]:vn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=o}(b,y),e=b[0],t=b[1],o=b[2],c=b[3],u=b[4],!(f=b[9]=b[9]===n?h?0:e.length:gn(b[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)x=8==t||16==t?function(e,t,r){var o=Do(e);return function i(){for(var a=arguments.length,s=xe(a),l=a,c=ai(i);l--;)s[l]=arguments[l];var u=a<3&&s[0]!==c&&s[a-1]!==c?[]:sn(s,c);return(a-=u.length)<r?Yo(e,t,zo,i.placeholder,n,s,u,n,n,r-a):Ct(this&&this!==dt&&this instanceof i?o:e,this,s)}}(e,t,f):t!=a&&33!=t||u.length?zo.apply(n,b):function(e,t,n,r){var o=1&t,i=Do(e);return function t(){for(var a=-1,s=arguments.length,l=-1,c=r.length,u=xe(c+s),d=this&&this!==dt&&this instanceof t?i:e;++l<c;)u[l]=r[l];for(;s--;)u[l++]=arguments[++a];return Ct(d,o?n:this,u)}}(e,t,o,c);else var x=function(e,t,n){var r=1&t,o=Do(e);return function t(){return(this&&this!==dt&&this instanceof t?o:e).apply(r?n:this,arguments)}}(e,t,o);return Li((y?Jr:Ti)(x,b),e,t)}function Zo(e,t,r,o){return e===n||ja(e,Le[r])&&!Oe.call(o,r)?t:e}function Jo(e,t,r,o,i,a){return ts(e)&&ts(t)&&(a.set(t,e),Br(e,t,n,Jo,a),a.delete(t)),e}function Qo(e){return is(e)?n:e}function ei(e,t,r,o,i,a){var s=1&r,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var p=-1,f=!0,h=2&r?new Yn:n;for(a.set(e,t),a.set(t,e);++p<l;){var m=e[p],g=t[p];if(o)var v=s?o(g,m,p,t,e,a):o(m,g,p,e,t,a);if(v!==n){if(v)continue;f=!1;break}if(h){if(!At(t,function(e,t){if(!Zt(h,t)&&(m===e||i(m,e,r,o,a)))return h.push(t)})){f=!1;break}}else if(m!==g&&!i(m,g,r,o,a)){f=!1;break}}return a.delete(e),a.delete(t),f}function ti(e){return Mi(Si(e,n,Yi),e+"")}function ni(e){return _r(e,Is,di)}function ri(e){return _r(e,Rs,pi)}var oi=Tn?function(e){return Tn.get(e)}:cl;function ii(e){for(var t=e.name+"",n=Pn[t],r=Oe.call(Pn,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function ai(e){return(Oe.call(Fn,"placeholder")?Fn:e).placeholder}function si(){var e=Fn.iteratee||il;return e=e===il?Rr:e,arguments.length?e(arguments[0],arguments[1]):e}function li(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ci(e){for(var t=Is(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Ci(o)]}return t}function ui(e,t){var r=function(e,t){return null==e?n:e[t]}(e,t);return Ir(r)?r:n}var di=gt?function(e){return null==e?[]:(e=Se(e),Tt(gt(e),function(t){return qe.call(e,t)}))}:gl,pi=gt?function(e){for(var t=[];e;)It(t,di(e)),e=We(e);return t}:gl,fi=Cr;function hi(e,t,n){for(var r=-1,o=(t=yo(t,e)).length,i=!1;++r<o;){var a=Fi(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&es(o)&&vi(a,o)&&(Wa(e)||Ua(e))}function mi(e){return"function"!=typeof e.constructor||_i(e)?{}:zn(We(e))}function gi(e){return Wa(e)||Ua(e)||!!(Ke&&e&&e[Ke])}function vi(e,t){var n=typeof e;return!!(t=null==t?u:t)&&("number"==n||"symbol"!=n&&ge.test(e))&&e>-1&&e%1==0&&e<t}function yi(e,t,n){if(!ts(n))return!1;var r=typeof t;return!!("number"==r?qa(n)&&vi(t,n.length):"string"==r&&t in n)&&ja(n[t],e)}function bi(e,t){if(Wa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!cs(e))||(J.test(e)||!Z.test(e)||null!=t&&e in Se(t))}function xi(e){var t=ii(e),n=Fn[t];if("function"!=typeof n||!(t in Hn.prototype))return!1;if(e===n)return!0;var r=oi(n);return!!r&&e===r[0]}(_n&&fi(new _n(new ArrayBuffer(1)))!=L||Cn&&fi(new Cn)!=$||wn&&fi(wn.resolve())!=w||Sn&&fi(new Sn)!=E||En&&fi(new En)!=P)&&(fi=function(e){var t=Cr(e),r=t==C?e.constructor:n,o=r?zi(r):"";if(o)switch(o){case Mn:return L;case Ln:return $;case In:return w;case Rn:return E;case On:return P}return t});var $i=Ie?Ja:vl;function _i(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Le)}function Ci(e){return e==e&&!ts(e)}function wi(e,t){return function(r){return null!=r&&(r[e]===t&&(t!==n||e in Se(r)))}}function Si(e,t,r){return t=gn(t===n?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=gn(n.length-t,0),a=xe(i);++o<i;)a[o]=n[t+o];o=-1;for(var s=xe(t+1);++o<t;)s[o]=n[o];return s[t]=r(a),Ct(e,this,s)}}function Ei(e,t){return t.length<2?e:$r(e,to(t,0,-1))}function ki(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ti=Ii(Jr),Pi=pt||function(e,t){return dt.setTimeout(e,t)},Mi=Ii(Qr);function Li(e,t,n){var r=t+"";return Mi(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return St(f,function(n){var r="_."+n[0];t&n[1]&&!Pt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(ae):[]}(r),n)))}function Ii(e){var t=0,r=0;return function(){var o=yn(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Ri(e,t){var r=-1,o=e.length,i=o-1;for(t=t===n?o:t;++r<t;){var a=Yr(r,i),s=e[a];e[a]=e[r],e[r]=s}return e.length=t,e}var Oi,Ai,Di,Ni=(Oi=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Q,function(e,n,r,o){t.push(r?o.replace(ce,"$1"):n||e)}),t},Ai=Aa(Oi,function(e){return 500===Di.size&&Di.clear(),e}),Di=Ai.cache,Ai);function Fi(e){if("string"==typeof e||cs(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function zi(e){if(null!=e){try{return Re.call(e)}catch(e2){}try{return e+""}catch(e2){}}return""}function Bi(e){if(e instanceof Hn)return e.clone();var t=new jn(e.__wrapped__,e.__chain__);return t.__actions__=To(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var ji=Gr(function(e,t){return Ga(e)?cr(e,mr(t,1,Ga,!0)):[]}),Hi=Gr(function(e,t){var r=Zi(t);return Ga(r)&&(r=n),Ga(e)?cr(e,mr(t,1,Ga,!0),si(r,2)):[]}),Vi=Gr(function(e,t){var r=Zi(t);return Ga(r)&&(r=n),Ga(e)?cr(e,mr(t,1,Ga,!0),n,r):[]});function Ui(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ms(n);return o<0&&(o=gn(r+o,0)),Ft(e,si(t,3),o)}function Wi(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var i=o-1;return r!==n&&(i=ms(r),i=r<0?gn(o+i,0):vn(i,o-1)),Ft(e,si(t,3),i,!0)}function Yi(e){return(null==e?0:e.length)?mr(e,1):[]}function qi(e){return e&&e.length?e[0]:n}var Gi=Gr(function(e){var t=Lt(e,go);return t.length&&t[0]===e[0]?kr(t):[]}),Ki=Gr(function(e){var t=Zi(e),r=Lt(e,go);return t===Zi(r)?t=n:r.pop(),r.length&&r[0]===e[0]?kr(r,si(t,2)):[]}),Xi=Gr(function(e){var t=Zi(e),r=Lt(e,go);return(t="function"==typeof t?t:n)&&r.pop(),r.length&&r[0]===e[0]?kr(r,n,t):[]});function Zi(e){var t=null==e?0:e.length;return t?e[t-1]:n}var Ji=Gr(Qi);function Qi(e,t){return e&&e.length&&t&&t.length?Ur(e,t):e}var ea=ti(function(e,t){var n=null==e?0:e.length,r=or(e,t);return Wr(e,Lt(t,function(e){return vi(e,n)?+e:e}).sort(So)),r});function ta(e){return null==e?e:$n.call(e)}var na=Gr(function(e){return lo(mr(e,1,Ga,!0))}),ra=Gr(function(e){var t=Zi(e);return Ga(t)&&(t=n),lo(mr(e,1,Ga,!0),si(t,2))}),oa=Gr(function(e){var t=Zi(e);return t="function"==typeof t?t:n,lo(mr(e,1,Ga,!0),n,t)});function ia(e){if(!e||!e.length)return[];var t=0;return e=Tt(e,function(e){if(Ga(e))return t=gn(e.length,t),!0}),qt(t,function(t){return Lt(e,Vt(t))})}function aa(e,t){if(!e||!e.length)return[];var r=ia(e);return null==t?r:Lt(r,function(e){return Ct(t,n,e)})}var sa=Gr(function(e,t){return Ga(e)?cr(e,t):[]}),la=Gr(function(e){return ho(Tt(e,Ga))}),ca=Gr(function(e){var t=Zi(e);return Ga(t)&&(t=n),ho(Tt(e,Ga),si(t,2))}),ua=Gr(function(e){var t=Zi(e);return t="function"==typeof t?t:n,ho(Tt(e,Ga),n,t)}),da=Gr(ia);var pa=Gr(function(e){var t=e.length,r=t>1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,aa(e,r)});function fa(e){var t=Fn(e);return t.__chain__=!0,t}function ha(e,t){return t(e)}var ma=ti(function(e){var t=e.length,r=t?e[0]:0,o=this.__wrapped__,i=function(t){return or(t,e)};return!(t>1||this.__actions__.length)&&o instanceof Hn&&vi(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:ha,args:[i],thisArg:n}),new jn(o,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(i)});var ga=Mo(function(e,t,n){Oe.call(e,n)?++e[n]:rr(e,n,1)});var va=No(Ui),ya=No(Wi);function ba(e,t){return(Wa(e)?St:ur)(e,si(t,3))}function xa(e,t){return(Wa(e)?Et:dr)(e,si(t,3))}var $a=Mo(function(e,t,n){Oe.call(e,n)?e[n].push(t):rr(e,n,[t])});var _a=Gr(function(e,t,n){var r=-1,o="function"==typeof t,i=qa(e)?xe(e.length):[];return ur(e,function(e){i[++r]=o?Ct(t,e,n):Tr(e,t,n)}),i}),Ca=Mo(function(e,t,n){rr(e,n,t)});function wa(e,t){return(Wa(e)?Lt:Nr)(e,si(t,3))}var Sa=Mo(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});var Ea=Gr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&yi(e,t[0],t[1])?t=[]:n>2&&yi(t[0],t[1],t[2])&&(t=[t[0]]),Hr(e,mr(t,1),[])}),ka=ut||function(){return dt.Date.now()};function Ta(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Xo(e,s,n,n,n,n,t)}function Pa(e,t){var o;if("function"!=typeof t)throw new Te(r);return e=ms(e),function(){return--e>0&&(o=t.apply(this,arguments)),e<=1&&(t=n),o}}var Ma=Gr(function(e,t,n){var r=1;if(n.length){var o=sn(n,ai(Ma));r|=a}return Xo(e,r,t,n,o)}),La=Gr(function(e,t,n){var r=3;if(n.length){var o=sn(n,ai(La));r|=a}return Xo(t,r,e,n,o)});function Ia(e,t,o){var i,a,s,l,c,u,d=0,p=!1,f=!1,h=!0;if("function"!=typeof e)throw new Te(r);function m(t){var r=i,o=a;return i=a=n,d=t,l=e.apply(o,r)}function g(e){var r=e-u;return u===n||r>=t||r<0||f&&e-d>=s}function v(){var e=ka();if(g(e))return y(e);c=Pi(v,function(e){var n=t-(e-u);return f?vn(n,s-(e-d)):n}(e))}function y(e){return c=n,h&&i?m(e):(i=a=n,l)}function b(){var e=ka(),r=g(e);if(i=arguments,a=this,u=e,r){if(c===n)return function(e){return d=e,c=Pi(v,t),p?m(e):l}(u);if(f)return $o(c),c=Pi(v,t),m(u)}return c===n&&(c=Pi(v,t)),l}return t=vs(t)||0,ts(o)&&(p=!!o.leading,s=(f="maxWait"in o)?gn(vs(o.maxWait)||0,t):s,h="trailing"in o?!!o.trailing:h),b.cancel=function(){c!==n&&$o(c),d=0,i=u=a=c=n},b.flush=function(){return c===n?l:y(ka())},b}var Ra=Gr(function(e,t){return lr(e,1,t)}),Oa=Gr(function(e,t,n){return lr(e,vs(t)||0,n)});function Aa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Te(r);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Aa.Cache||Wn),n}function Da(e){if("function"!=typeof e)throw new Te(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Aa.Cache=Wn;var Na=bo(function(e,t){var n=(t=1==t.length&&Wa(t[0])?Lt(t[0],Kt(si())):Lt(mr(t,1),Kt(si()))).length;return Gr(function(r){for(var o=-1,i=vn(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return Ct(e,this,r)})}),Fa=Gr(function(e,t){var r=sn(t,ai(Fa));return Xo(e,a,n,t,r)}),za=Gr(function(e,t){var r=sn(t,ai(za));return Xo(e,64,n,t,r)}),Ba=ti(function(e,t){return Xo(e,l,n,n,n,t)});function ja(e,t){return e===t||e!=e&&t!=t}var Ha=Wo(wr),Va=Wo(function(e,t){return e>=t}),Ua=Pr(function(){return arguments}())?Pr:function(e){return ns(e)&&Oe.call(e,"callee")&&!qe.call(e,"callee")},Wa=xe.isArray,Ya=vt?Kt(vt):function(e){return ns(e)&&Cr(e)==M};function qa(e){return null!=e&&es(e.length)&&!Ja(e)}function Ga(e){return ns(e)&&qa(e)}var Ka=Dt||vl,Xa=yt?Kt(yt):function(e){return ns(e)&&Cr(e)==v};function Za(e){if(!ns(e))return!1;var t=Cr(e);return t==y||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!is(e)}function Ja(e){if(!ts(e))return!1;var t=Cr(e);return t==b||t==x||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qa(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ns(e){return null!=e&&"object"==typeof e}var rs=bt?Kt(bt):function(e){return ns(e)&&fi(e)==$};function os(e){return"number"==typeof e||ns(e)&&Cr(e)==_}function is(e){if(!ns(e)||Cr(e)!=C)return!1;var t=We(e);if(null===t)return!0;var n=Oe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Re.call(n)==Fe}var as=xt?Kt(xt):function(e){return ns(e)&&Cr(e)==S};var ss=$t?Kt($t):function(e){return ns(e)&&fi(e)==E};function ls(e){return"string"==typeof e||!Wa(e)&&ns(e)&&Cr(e)==k}function cs(e){return"symbol"==typeof e||ns(e)&&Cr(e)==T}var us=_t?Kt(_t):function(e){return ns(e)&&es(e.length)&&!!ot[Cr(e)]};var ds=Wo(Dr),ps=Wo(function(e,t){return e<=t});function fs(e){if(!e)return[];if(qa(e))return ls(e)?un(e):To(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=fi(e);return(t==$?on:t==E?ln:js)(e)}function hs(e){return e?(e=vs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=hs(e),n=t%1;return t==t?n?t-n:t:0}function gs(e){return e?ir(ms(e),0,p):0}function vs(e){if("number"==typeof e)return e;if(cs(e))return d;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Gt(e);var n=fe.test(e);return n||me.test(e)?lt(e.slice(2),n?2:8):pe.test(e)?d:+e}function ys(e){return Po(e,Rs(e))}function bs(e){return null==e?"":so(e)}var xs=Lo(function(e,t){if(_i(t)||qa(t))Po(t,Is(t),e);else for(var n in t)Oe.call(t,n)&&Qn(e,n,t[n])}),$s=Lo(function(e,t){Po(t,Rs(t),e)}),_s=Lo(function(e,t,n,r){Po(t,Rs(t),e,r)}),Cs=Lo(function(e,t,n,r){Po(t,Is(t),e,r)}),ws=ti(or);var Ss=Gr(function(e,t){e=Se(e);var r=-1,o=t.length,i=o>2?t[2]:n;for(i&&yi(t[0],t[1],i)&&(o=1);++r<o;)for(var a=t[r],s=Rs(a),l=-1,c=s.length;++l<c;){var u=s[l],d=e[u];(d===n||ja(d,Le[u])&&!Oe.call(e,u))&&(e[u]=a[u])}return e}),Es=Gr(function(e){return e.push(n,Jo),Ct(As,n,e)});function ks(e,t,r){var o=null==e?n:$r(e,t);return o===n?r:o}function Ts(e,t){return null!=e&&hi(e,t,Er)}var Ps=Bo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=n},tl(ol)),Ms=Bo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),Oe.call(e,t)?e[t].push(n):e[t]=[n]},si),Ls=Gr(Tr);function Is(e){return qa(e)?Gn(e):Or(e)}function Rs(e){return qa(e)?Gn(e,!0):Ar(e)}var Os=Lo(function(e,t,n){Br(e,t,n)}),As=Lo(function(e,t,n,r){Br(e,t,n,r)}),Ds=ti(function(e,t){var n={};if(null==e)return n;var r=!1;t=Lt(t,function(t){return t=yo(t,e),r||(r=t.length>1),t}),Po(e,ri(e),n),r&&(n=ar(n,7,Qo));for(var o=t.length;o--;)co(n,t[o]);return n});var Ns=ti(function(e,t){return null==e?{}:function(e,t){return Vr(e,t,function(t,n){return Ts(e,n)})}(e,t)});function Fs(e,t){if(null==e)return{};var n=Lt(ri(e),function(e){return[e]});return t=si(t),Vr(e,n,function(e,n){return t(e,n[0])})}var zs=Ko(Is),Bs=Ko(Rs);function js(e){return null==e?[]:Xt(e,Is(e))}var Hs=Ao(function(e,t,n){return t=t.toLowerCase(),e+(n?Vs(t):t)});function Vs(e){return Zs(bs(e).toLowerCase())}function Us(e){return(e=bs(e))&&e.replace(ve,en).replace(Ze,"")}var Ws=Ao(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ys=Ao(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),qs=Oo("toLowerCase");var Gs=Ao(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});var Ks=Ao(function(e,t,n){return e+(n?" ":"")+Zs(t)});var Xs=Ao(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Zs=Oo("toUpperCase");function Js(e,t,r){return e=bs(e),(t=r?n:t)===n?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Qs=Gr(function(e,t){try{return Ct(e,n,t)}catch(e2){return Za(e2)?e2:new _e(e2)}}),el=ti(function(e,t){return St(t,function(t){t=Fi(t),rr(e,t,Ma(e[t],e))}),e});function tl(e){return function(){return e}}var nl=Fo(),rl=Fo(!0);function ol(e){return e}function il(e){return Rr("function"==typeof e?e:ar(e,1))}var al=Gr(function(e,t){return function(n){return Tr(n,e,t)}}),sl=Gr(function(e,t){return function(n){return Tr(e,n,t)}});function ll(e,t,n){var r=Is(t),o=xr(t,r);null!=n||ts(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=xr(t,Is(t)));var i=!(ts(n)&&"chain"in n&&!n.chain),a=Ja(e);return St(o,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__);return(n.__actions__=To(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,It([this.value()],arguments))})}),e}function cl(){}var ul=Ho(Lt),dl=Ho(kt),pl=Ho(At);function fl(e){return bi(e)?Vt(Fi(e)):function(e){return function(t){return $r(t,e)}}(e)}var hl=Uo(),ml=Uo(!0);function gl(){return[]}function vl(){return!1}var yl=jo(function(e,t){return e+t},0),bl=qo("ceil"),xl=jo(function(e,t){return e/t},1),$l=qo("floor");var _l,Cl=jo(function(e,t){return e*t},1),wl=qo("round"),Sl=jo(function(e,t){return e-t},0);return Fn.after=function(e,t){if("function"!=typeof t)throw new Te(r);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},Fn.ary=Ta,Fn.assign=xs,Fn.assignIn=$s,Fn.assignInWith=_s,Fn.assignWith=Cs,Fn.at=ws,Fn.before=Pa,Fn.bind=Ma,Fn.bindAll=el,Fn.bindKey=La,Fn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Wa(e)?e:[e]},Fn.chain=fa,Fn.chunk=function(e,t,r){t=(r?yi(e,t,r):t===n)?1:gn(ms(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,s=xe(ft(o/t));i<o;)s[a++]=to(e,i,i+=t);return s},Fn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Fn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=xe(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return It(Wa(n)?To(n):[n],mr(t,1))},Fn.cond=function(e){var t=null==e?0:e.length,n=si();return e=t?Lt(e,function(e){if("function"!=typeof e[1])throw new Te(r);return[n(e[0]),e[1]]}):[],Gr(function(n){for(var r=-1;++r<t;){var o=e[r];if(Ct(o[0],this,n))return Ct(o[1],this,n)}})},Fn.conforms=function(e){return function(e){var t=Is(e);return function(n){return sr(n,e,t)}}(ar(e,1))},Fn.constant=tl,Fn.countBy=ga,Fn.create=function(e,t){var n=zn(e);return null==t?n:nr(n,t)},Fn.curry=function e(t,r,o){var i=Xo(t,8,n,n,n,n,n,r=o?n:r);return i.placeholder=e.placeholder,i},Fn.curryRight=function e(t,r,o){var i=Xo(t,16,n,n,n,n,n,r=o?n:r);return i.placeholder=e.placeholder,i},Fn.debounce=Ia,Fn.defaults=Ss,Fn.defaultsDeep=Es,Fn.defer=Ra,Fn.delay=Oa,Fn.difference=ji,Fn.differenceBy=Hi,Fn.differenceWith=Vi,Fn.drop=function(e,t,r){var o=null==e?0:e.length;return o?to(e,(t=r||t===n?1:ms(t))<0?0:t,o):[]},Fn.dropRight=function(e,t,r){var o=null==e?0:e.length;return o?to(e,0,(t=o-(t=r||t===n?1:ms(t)))<0?0:t):[]},Fn.dropRightWhile=function(e,t){return e&&e.length?po(e,si(t,3),!0,!0):[]},Fn.dropWhile=function(e,t){return e&&e.length?po(e,si(t,3),!0):[]},Fn.fill=function(e,t,r,o){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&yi(e,t,r)&&(r=0,o=i),function(e,t,r,o){var i=e.length;for((r=ms(r))<0&&(r=-r>i?0:i+r),(o=o===n||o>i?i:ms(o))<0&&(o+=i),o=r>o?0:gs(o);r<o;)e[r++]=t;return e}(e,t,r,o)):[]},Fn.filter=function(e,t){return(Wa(e)?Tt:hr)(e,si(t,3))},Fn.flatMap=function(e,t){return mr(wa(e,t),1)},Fn.flatMapDeep=function(e,t){return mr(wa(e,t),c)},Fn.flatMapDepth=function(e,t,r){return r=r===n?1:ms(r),mr(wa(e,t),r)},Fn.flatten=Yi,Fn.flattenDeep=function(e){return(null==e?0:e.length)?mr(e,c):[]},Fn.flattenDepth=function(e,t){return(null==e?0:e.length)?mr(e,t=t===n?1:ms(t)):[]},Fn.flip=function(e){return Xo(e,512)},Fn.flow=nl,Fn.flowRight=rl,Fn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r},Fn.functions=function(e){return null==e?[]:xr(e,Is(e))},Fn.functionsIn=function(e){return null==e?[]:xr(e,Rs(e))},Fn.groupBy=$a,Fn.initial=function(e){return(null==e?0:e.length)?to(e,0,-1):[]},Fn.intersection=Gi,Fn.intersectionBy=Ki,Fn.intersectionWith=Xi,Fn.invert=Ps,Fn.invertBy=Ms,Fn.invokeMap=_a,Fn.iteratee=il,Fn.keyBy=Ca,Fn.keys=Is,Fn.keysIn=Rs,Fn.map=wa,Fn.mapKeys=function(e,t){var n={};return t=si(t,3),yr(e,function(e,r,o){rr(n,t(e,r,o),e)}),n},Fn.mapValues=function(e,t){var n={};return t=si(t,3),yr(e,function(e,r,o){rr(n,r,t(e,r,o))}),n},Fn.matches=function(e){return Fr(ar(e,1))},Fn.matchesProperty=function(e,t){return zr(e,ar(t,1))},Fn.memoize=Aa,Fn.merge=Os,Fn.mergeWith=As,Fn.method=al,Fn.methodOf=sl,Fn.mixin=ll,Fn.negate=Da,Fn.nthArg=function(e){return e=ms(e),Gr(function(t){return jr(t,e)})},Fn.omit=Ds,Fn.omitBy=function(e,t){return Fs(e,Da(si(t)))},Fn.once=function(e){return Pa(2,e)},Fn.orderBy=function(e,t,r,o){return null==e?[]:(Wa(t)||(t=null==t?[]:[t]),Wa(r=o?n:r)||(r=null==r?[]:[r]),Hr(e,t,r))},Fn.over=ul,Fn.overArgs=Na,Fn.overEvery=dl,Fn.overSome=pl,Fn.partial=Fa,Fn.partialRight=za,Fn.partition=Sa,Fn.pick=Ns,Fn.pickBy=Fs,Fn.property=fl,Fn.propertyOf=function(e){return function(t){return null==e?n:$r(e,t)}},Fn.pull=Ji,Fn.pullAll=Qi,Fn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ur(e,t,si(n,2)):e},Fn.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Ur(e,t,n,r):e},Fn.pullAt=ea,Fn.range=hl,Fn.rangeRight=ml,Fn.rearg=Ba,Fn.reject=function(e,t){return(Wa(e)?Tt:hr)(e,Da(si(t,3)))},Fn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=si(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return Wr(e,o),n},Fn.rest=function(e,t){if("function"!=typeof e)throw new Te(r);return Gr(e,t=t===n?t:ms(t))},Fn.reverse=ta,Fn.sampleSize=function(e,t,r){return t=(r?yi(e,t,r):t===n)?1:ms(t),(Wa(e)?Xn:Xr)(e,t)},Fn.set=function(e,t,n){return null==e?e:Zr(e,t,n)},Fn.setWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:Zr(e,t,r,o)},Fn.shuffle=function(e){return(Wa(e)?Zn:eo)(e)},Fn.slice=function(e,t,r){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&yi(e,t,r)?(t=0,r=o):(t=null==t?0:ms(t),r=r===n?o:ms(r)),to(e,t,r)):[]},Fn.sortBy=Ea,Fn.sortedUniq=function(e){return e&&e.length?io(e):[]},Fn.sortedUniqBy=function(e,t){return e&&e.length?io(e,si(t,2)):[]},Fn.split=function(e,t,r){return r&&"number"!=typeof r&&yi(e,t,r)&&(t=r=n),(r=r===n?p:r>>>0)?(e=bs(e))&&("string"==typeof t||null!=t&&!as(t))&&!(t=so(t))&&rn(e)?xo(un(e),0,r):e.split(t,r):[]},Fn.spread=function(e,t){if("function"!=typeof e)throw new Te(r);return t=null==t?0:gn(ms(t),0),Gr(function(n){var r=n[t],o=xo(n,0,t);return r&&It(o,r),Ct(e,this,o)})},Fn.tail=function(e){var t=null==e?0:e.length;return t?to(e,1,t):[]},Fn.take=function(e,t,r){return e&&e.length?to(e,0,(t=r||t===n?1:ms(t))<0?0:t):[]},Fn.takeRight=function(e,t,r){var o=null==e?0:e.length;return o?to(e,(t=o-(t=r||t===n?1:ms(t)))<0?0:t,o):[]},Fn.takeRightWhile=function(e,t){return e&&e.length?po(e,si(t,3),!1,!0):[]},Fn.takeWhile=function(e,t){return e&&e.length?po(e,si(t,3)):[]},Fn.tap=function(e,t){return t(e),e},Fn.throttle=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new Te(r);return ts(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),Ia(e,t,{leading:o,maxWait:t,trailing:i})},Fn.thru=ha,Fn.toArray=fs,Fn.toPairs=zs,Fn.toPairsIn=Bs,Fn.toPath=function(e){return Wa(e)?Lt(e,Fi):cs(e)?[e]:To(Ni(bs(e)))},Fn.toPlainObject=ys,Fn.transform=function(e,t,n){var r=Wa(e),o=r||Ka(e)||us(e);if(t=si(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:ts(e)&&Ja(i)?zn(We(e)):{}}return(o?St:yr)(e,function(e,r,o){return t(n,e,r,o)}),n},Fn.unary=function(e){return Ta(e,1)},Fn.union=na,Fn.unionBy=ra,Fn.unionWith=oa,Fn.uniq=function(e){return e&&e.length?lo(e):[]},Fn.uniqBy=function(e,t){return e&&e.length?lo(e,si(t,2)):[]},Fn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?lo(e,n,t):[]},Fn.unset=function(e,t){return null==e||co(e,t)},Fn.unzip=ia,Fn.unzipWith=aa,Fn.update=function(e,t,n){return null==e?e:uo(e,t,vo(n))},Fn.updateWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:uo(e,t,vo(r),o)},Fn.values=js,Fn.valuesIn=function(e){return null==e?[]:Xt(e,Rs(e))},Fn.without=sa,Fn.words=Js,Fn.wrap=function(e,t){return Fa(vo(t),e)},Fn.xor=la,Fn.xorBy=ca,Fn.xorWith=ua,Fn.zip=da,Fn.zipObject=function(e,t){return mo(e||[],t||[],Qn)},Fn.zipObjectDeep=function(e,t){return mo(e||[],t||[],Zr)},Fn.zipWith=pa,Fn.entries=zs,Fn.entriesIn=Bs,Fn.extend=$s,Fn.extendWith=_s,ll(Fn,Fn),Fn.add=yl,Fn.attempt=Qs,Fn.camelCase=Hs,Fn.capitalize=Vs,Fn.ceil=bl,Fn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=vs(r))==r?r:0),t!==n&&(t=(t=vs(t))==t?t:0),ir(vs(e),t,r)},Fn.clone=function(e){return ar(e,4)},Fn.cloneDeep=function(e){return ar(e,5)},Fn.cloneDeepWith=function(e,t){return ar(e,5,t="function"==typeof t?t:n)},Fn.cloneWith=function(e,t){return ar(e,4,t="function"==typeof t?t:n)},Fn.conformsTo=function(e,t){return null==t||sr(e,t,Is(t))},Fn.deburr=Us,Fn.defaultTo=function(e,t){return null==e||e!=e?t:e},Fn.divide=xl,Fn.endsWith=function(e,t,r){e=bs(e),t=so(t);var o=e.length,i=r=r===n?o:ir(ms(r),0,o);return(r-=t.length)>=0&&e.slice(r,i)==t},Fn.eq=ja,Fn.escape=function(e){return(e=bs(e))&&q.test(e)?e.replace(W,tn):e},Fn.escapeRegExp=function(e){return(e=bs(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Fn.every=function(e,t,r){var o=Wa(e)?kt:pr;return r&&yi(e,t,r)&&(t=n),o(e,si(t,3))},Fn.find=va,Fn.findIndex=Ui,Fn.findKey=function(e,t){return Nt(e,si(t,3),yr)},Fn.findLast=ya,Fn.findLastIndex=Wi,Fn.findLastKey=function(e,t){return Nt(e,si(t,3),br)},Fn.floor=$l,Fn.forEach=ba,Fn.forEachRight=xa,Fn.forIn=function(e,t){return null==e?e:gr(e,si(t,3),Rs)},Fn.forInRight=function(e,t){return null==e?e:vr(e,si(t,3),Rs)},Fn.forOwn=function(e,t){return e&&yr(e,si(t,3))},Fn.forOwnRight=function(e,t){return e&&br(e,si(t,3))},Fn.get=ks,Fn.gt=Ha,Fn.gte=Va,Fn.has=function(e,t){return null!=e&&hi(e,t,Sr)},Fn.hasIn=Ts,Fn.head=qi,Fn.identity=ol,Fn.includes=function(e,t,n,r){e=qa(e)?e:js(e),n=n&&!r?ms(n):0;var o=e.length;return n<0&&(n=gn(o+n,0)),ls(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&zt(e,t,n)>-1},Fn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ms(n);return o<0&&(o=gn(r+o,0)),zt(e,t,o)},Fn.inRange=function(e,t,r){return t=hs(t),r===n?(r=t,t=0):r=hs(r),function(e,t,n){return e>=vn(t,n)&&e<gn(t,n)}(e=vs(e),t,r)},Fn.invoke=Ls,Fn.isArguments=Ua,Fn.isArray=Wa,Fn.isArrayBuffer=Ya,Fn.isArrayLike=qa,Fn.isArrayLikeObject=Ga,Fn.isBoolean=function(e){return!0===e||!1===e||ns(e)&&Cr(e)==g},Fn.isBuffer=Ka,Fn.isDate=Xa,Fn.isElement=function(e){return ns(e)&&1===e.nodeType&&!is(e)},Fn.isEmpty=function(e){if(null==e)return!0;if(qa(e)&&(Wa(e)||"string"==typeof e||"function"==typeof e.splice||Ka(e)||us(e)||Ua(e)))return!e.length;var t=fi(e);if(t==$||t==E)return!e.size;if(_i(e))return!Or(e).length;for(var n in e)if(Oe.call(e,n))return!1;return!0},Fn.isEqual=function(e,t){return Mr(e,t)},Fn.isEqualWith=function(e,t,r){var o=(r="function"==typeof r?r:n)?r(e,t):n;return o===n?Mr(e,t,n,r):!!o},Fn.isError=Za,Fn.isFinite=function(e){return"number"==typeof e&&Ut(e)},Fn.isFunction=Ja,Fn.isInteger=Qa,Fn.isLength=es,Fn.isMap=rs,Fn.isMatch=function(e,t){return e===t||Lr(e,t,ci(t))},Fn.isMatchWith=function(e,t,r){return r="function"==typeof r?r:n,Lr(e,t,ci(t),r)},Fn.isNaN=function(e){return os(e)&&e!=+e},Fn.isNative=function(e){if($i(e))throw new _e("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ir(e)},Fn.isNil=function(e){return null==e},Fn.isNull=function(e){return null===e},Fn.isNumber=os,Fn.isObject=ts,Fn.isObjectLike=ns,Fn.isPlainObject=is,Fn.isRegExp=as,Fn.isSafeInteger=function(e){return Qa(e)&&e>=-9007199254740991&&e<=u},Fn.isSet=ss,Fn.isString=ls,Fn.isSymbol=cs,Fn.isTypedArray=us,Fn.isUndefined=function(e){return e===n},Fn.isWeakMap=function(e){return ns(e)&&fi(e)==P},Fn.isWeakSet=function(e){return ns(e)&&"[object WeakSet]"==Cr(e)},Fn.join=function(e,t){return null==e?"":hn.call(e,t)},Fn.kebabCase=Ws,Fn.last=Zi,Fn.lastIndexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var i=o;return r!==n&&(i=(i=ms(r))<0?gn(o+i,0):vn(i,o-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Ft(e,jt,i,!0)},Fn.lowerCase=Ys,Fn.lowerFirst=qs,Fn.lt=ds,Fn.lte=ps,Fn.max=function(e){return e&&e.length?fr(e,ol,wr):n},Fn.maxBy=function(e,t){return e&&e.length?fr(e,si(t,2),wr):n},Fn.mean=function(e){return Ht(e,ol)},Fn.meanBy=function(e,t){return Ht(e,si(t,2))},Fn.min=function(e){return e&&e.length?fr(e,ol,Dr):n},Fn.minBy=function(e,t){return e&&e.length?fr(e,si(t,2),Dr):n},Fn.stubArray=gl,Fn.stubFalse=vl,Fn.stubObject=function(){return{}},Fn.stubString=function(){return""},Fn.stubTrue=function(){return!0},Fn.multiply=Cl,Fn.nth=function(e,t){return e&&e.length?jr(e,ms(t)):n},Fn.noConflict=function(){return dt._===this&&(dt._=ze),this},Fn.noop=cl,Fn.now=ka,Fn.pad=function(e,t,n){e=bs(e);var r=(t=ms(t))?cn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Vo(mt(o),n)+e+Vo(ft(o),n)},Fn.padEnd=function(e,t,n){e=bs(e);var r=(t=ms(t))?cn(e):0;return t&&r<t?e+Vo(t-r,n):e},Fn.padStart=function(e,t,n){e=bs(e);var r=(t=ms(t))?cn(e):0;return t&&r<t?Vo(t-r,n)+e:e},Fn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),bn(bs(e).replace(ne,""),t||0)},Fn.random=function(e,t,r){if(r&&"boolean"!=typeof r&&yi(e,t,r)&&(t=r=n),r===n&&("boolean"==typeof t?(r=t,t=n):"boolean"==typeof e&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=hs(e),t===n?(t=e,e=0):t=hs(t)),e>t){var o=e;e=t,t=o}if(r||e%1||t%1){var i=xn();return vn(e+i*(t-e+st("1e-"+((i+"").length-1))),t)}return Yr(e,t)},Fn.reduce=function(e,t,n){var r=Wa(e)?Rt:Wt,o=arguments.length<3;return r(e,si(t,4),n,o,ur)},Fn.reduceRight=function(e,t,n){var r=Wa(e)?Ot:Wt,o=arguments.length<3;return r(e,si(t,4),n,o,dr)},Fn.repeat=function(e,t,r){return t=(r?yi(e,t,r):t===n)?1:ms(t),qr(bs(e),t)},Fn.replace=function(){var e=arguments,t=bs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Fn.result=function(e,t,r){var o=-1,i=(t=yo(t,e)).length;for(i||(i=1,e=n);++o<i;){var a=null==e?n:e[Fi(t[o])];a===n&&(o=i,a=r),e=Ja(a)?a.call(e):a}return e},Fn.round=wl,Fn.runInContext=e,Fn.sample=function(e){return(Wa(e)?Kn:Kr)(e)},Fn.size=function(e){if(null==e)return 0;if(qa(e))return ls(e)?cn(e):e.length;var t=fi(e);return t==$||t==E?e.size:Or(e).length},Fn.snakeCase=Gs,Fn.some=function(e,t,r){var o=Wa(e)?At:no;return r&&yi(e,t,r)&&(t=n),o(e,si(t,3))},Fn.sortedIndex=function(e,t){return ro(e,t)},Fn.sortedIndexBy=function(e,t,n){return oo(e,t,si(n,2))},Fn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ro(e,t);if(r<n&&ja(e[r],t))return r}return-1},Fn.sortedLastIndex=function(e,t){return ro(e,t,!0)},Fn.sortedLastIndexBy=function(e,t,n){return oo(e,t,si(n,2),!0)},Fn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=ro(e,t,!0)-1;if(ja(e[n],t))return n}return-1},Fn.startCase=Ks,Fn.startsWith=function(e,t,n){return e=bs(e),n=null==n?0:ir(ms(n),0,e.length),t=so(t),e.slice(n,n+t.length)==t},Fn.subtract=Sl,Fn.sum=function(e){return e&&e.length?Yt(e,ol):0},Fn.sumBy=function(e,t){return e&&e.length?Yt(e,si(t,2)):0},Fn.template=function(e,t,r){var o=Fn.templateSettings;r&&yi(e,t,r)&&(t=n),e=bs(e),t=_s({},t,o,Zo);var i,a,s=_s({},t.imports,o.imports,Zo),l=Is(s),c=Xt(s,l),u=0,d=t.interpolate||ye,p="__p += '",f=Ee((t.escape||ye).source+"|"+d.source+"|"+(d===X?ue:ye).source+"|"+(t.evaluate||ye).source+"|$","g"),h="//# sourceURL="+(Oe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";e.replace(f,function(t,n,r,o,s,l){return r||(r=o),p+=e.slice(u,l).replace(be,nn),n&&(i=!0,p+="' +\n__e("+n+") +\n'"),s&&(a=!0,p+="';\n"+s+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t}),p+="';\n";var m=Oe.call(t,"variable")&&t.variable;if(m){if(le.test(m))throw new _e("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(a?p.replace(j,""):p).replace(H,"$1").replace(V,"$1;"),p="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=Qs(function(){return Ce(l,h+"return "+p).apply(n,c)});if(g.source=p,Za(g))throw g;return g},Fn.times=function(e,t){if((e=ms(e))<1||e>u)return[];var n=p,r=vn(e,p);t=si(t),e-=p;for(var o=qt(r,t);++n<e;)t(n);return o},Fn.toFinite=hs,Fn.toInteger=ms,Fn.toLength=gs,Fn.toLower=function(e){return bs(e).toLowerCase()},Fn.toNumber=vs,Fn.toSafeInteger=function(e){return e?ir(ms(e),-9007199254740991,u):0===e?e:0},Fn.toString=bs,Fn.toUpper=function(e){return bs(e).toUpperCase()},Fn.trim=function(e,t,r){if((e=bs(e))&&(r||t===n))return Gt(e);if(!e||!(t=so(t)))return e;var o=un(e),i=un(t);return xo(o,Jt(o,i),Qt(o,i)+1).join("")},Fn.trimEnd=function(e,t,r){if((e=bs(e))&&(r||t===n))return e.slice(0,dn(e)+1);if(!e||!(t=so(t)))return e;var o=un(e);return xo(o,0,Qt(o,un(t))+1).join("")},Fn.trimStart=function(e,t,r){if((e=bs(e))&&(r||t===n))return e.replace(ne,"");if(!e||!(t=so(t)))return e;var o=un(e);return xo(o,Jt(o,un(t))).join("")},Fn.truncate=function(e,t){var r=30,o="...";if(ts(t)){var i="separator"in t?t.separator:i;r="length"in t?ms(t.length):r,o="omission"in t?so(t.omission):o}var a=(e=bs(e)).length;if(rn(e)){var s=un(e);a=s.length}if(r>=a)return e;var l=r-cn(o);if(l<1)return o;var c=s?xo(s,0,l).join(""):e.slice(0,l);if(i===n)return c+o;if(s&&(l+=c.length-l),as(i)){if(e.slice(l).search(i)){var u,d=c;for(i.global||(i=Ee(i.source,bs(de.exec(i))+"g")),i.lastIndex=0;u=i.exec(d);)var p=u.index;c=c.slice(0,p===n?l:p)}}else if(e.indexOf(so(i),l)!=l){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+o},Fn.unescape=function(e){return(e=bs(e))&&Y.test(e)?e.replace(U,pn):e},Fn.uniqueId=function(e){var t=++Ae;return bs(e)+t},Fn.upperCase=Xs,Fn.upperFirst=Zs,Fn.each=ba,Fn.eachRight=xa,Fn.first=qi,ll(Fn,(_l={},yr(Fn,function(e,t){Oe.call(Fn.prototype,t)||(_l[t]=e)}),_l),{chain:!1}),Fn.VERSION="4.17.23",St(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Fn[e].placeholder=Fn}),St(["drop","take"],function(e,t){Hn.prototype[e]=function(r){r=r===n?1:gn(ms(r),0);var o=this.__filtered__&&!t?new Hn(this):this.clone();return o.__filtered__?o.__takeCount__=vn(r,o.__takeCount__):o.__views__.push({size:vn(r,p),type:e+(o.__dir__<0?"Right":"")}),o},Hn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),St(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Hn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:si(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),St(["head","last"],function(e,t){var n="take"+(t?"Right":"");Hn.prototype[e]=function(){return this[n](1).value()[0]}}),St(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Hn.prototype[e]=function(){return this.__filtered__?new Hn(this):this[n](1)}}),Hn.prototype.compact=function(){return this.filter(ol)},Hn.prototype.find=function(e){return this.filter(e).head()},Hn.prototype.findLast=function(e){return this.reverse().find(e)},Hn.prototype.invokeMap=Gr(function(e,t){return"function"==typeof e?new Hn(this):this.map(function(n){return Tr(n,e,t)})}),Hn.prototype.reject=function(e){return this.filter(Da(si(e)))},Hn.prototype.slice=function(e,t){e=ms(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Hn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ms(t))<0?r.dropRight(-t):r.take(t-e)),r)},Hn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hn.prototype.toArray=function(){return this.take(p)},yr(Hn.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),i=Fn[o?"take"+("last"==t?"Right":""):t],a=o||/^find/.test(t);i&&(Fn.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,l=t instanceof Hn,c=s[0],u=l||Wa(t),d=function(e){var t=i.apply(Fn,It([e],s));return o&&p?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var p=this.__chain__,f=!!this.__actions__.length,h=a&&!p,m=l&&!f;if(!a&&u){t=m?t:new Hn(this);var g=e.apply(t,s);return g.__actions__.push({func:ha,args:[d],thisArg:n}),new jn(g,p)}return h&&m?e.apply(this,s):(g=this.thru(d),h?o?g.value()[0]:g.value():g)})}),St(["pop","push","shift","sort","splice","unshift"],function(e){var t=Pe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Fn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Wa(o)?o:[],e)}return this[n](function(n){return t.apply(Wa(n)?n:[],e)})}}),yr(Hn.prototype,function(e,t){var n=Fn[t];if(n){var r=n.name+"";Oe.call(Pn,r)||(Pn[r]=[]),Pn[r].push({name:t,func:n})}}),Pn[zo(n,2).name]=[{name:"wrapper",func:n}],Hn.prototype.clone=function(){var e=new Hn(this.__wrapped__);return e.__actions__=To(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=To(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=To(this.__views__),e},Hn.prototype.reverse=function(){if(this.__filtered__){var e=new Hn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Wa(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=vn(t,e+a);break;case"takeRight":e=gn(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,s=i.end,l=s-a,c=r?s:a-1,u=this.__iteratees__,d=u.length,p=0,f=vn(l,this.__takeCount__);if(!n||!r&&o==l&&f==l)return fo(e,this.__actions__);var h=[];e:for(;l--&&p<f;){for(var m=-1,g=e[c+=t];++m<d;){var v=u[m],y=v.iteratee,b=v.type,x=y(g);if(2==b)g=x;else if(!x){if(1==b)continue e;break e}}h[p++]=g}return h},Fn.prototype.at=ma,Fn.prototype.chain=function(){return fa(this)},Fn.prototype.commit=function(){return new jn(this.value(),this.__chain__)},Fn.prototype.next=function(){this.__values__===n&&(this.__values__=fs(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Fn.prototype.plant=function(e){for(var t,r=this;r instanceof Bn;){var o=Bi(r);o.__index__=0,o.__values__=n,t?i.__wrapped__=o:t=o;var i=o;r=r.__wrapped__}return i.__wrapped__=e,t},Fn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hn){var t=e;return this.__actions__.length&&(t=new Hn(this)),(t=t.reverse()).__actions__.push({func:ha,args:[ta],thisArg:n}),new jn(t,this.__chain__)}return this.thru(ta)},Fn.prototype.toJSON=Fn.prototype.valueOf=Fn.prototype.value=function(){return fo(this.__wrapped__,this.__actions__)},Fn.prototype.first=Fn.prototype.head,Je&&(Fn.prototype[Je]=function(){return this}),Fn}();ft?((ft.exports=fn)._=fn,pt._=fn):dt._=fn}).call(commonjsGlobal)}(lodash,lodash.exports);var lodashExports=lodash.exports;const LOCALE$1={Notifications:"Notifications",All:"All",Signals:"Signals",Opened:"Opened",Closed:"Closed",Scheduled:"Scheduled",Cancelled:"Cancelled","Partial profit":"Partial profit","Profit fixed":"Profit fixed","Partial loss":"Partial loss","Loss fixed":"Loss fixed","Breakeven available":"Breakeven available","Breakeven set":"Breakeven set","Trailing stop":"Trailing stop","Trailing take":"Trailing take",Rejected:"Rejected",Error:"Error",Validation:"Validation",Critical:"Critical",Unknown:"Unknown","Copied!":"Copied successfully!","Saved!":"Saved!",Empty:"",Copy:"Copy",Paste:"Paste",Prompt:"Prompt","Refresh manually":"Refresh","Create new row":"Create new row","Change sort order":"Change sort order","Drop filters":"Drop filters",Filters:"Filters",Search:"Search","Loading data":"Loading data","Nothing found":" ","Point not choosen":"Point not chosen","No data":" ","Not found":"Not found","No options":"No options","Drag and drop a file here or click":"Drag and drop a file here or click",Next:"Next",Prev:"Prev",Choose:"Choose",Deselect:"Deselect",Green:"Green",Skyblue:"Skyblue",Yellow:"Yellow",Red:"Red",Submit:"Submit",Date:"Date",Time:"Time",Loading:"Loading",Required:"Required","The form contains unsaved changes. Continue?":"The form contains unsaved changes. Continue?","The form contains invalid data. Continue?":"The form contains invalid data. Continue?","Are you sure you want to delete this file?":"Are you sure you want to delete this file?",Confirmation:"Confirmation",Forbidden:"Forbidden",Ok:"Ok",Cancel:"Cancel",Remove:"Remove",Send:"Send",Actions:"Actions",Save:"Save","Not chosen":"Not chosen","Continue?":"Continue?",Unset:"Unset","Select all":"Select all","No tips":"No tips","Column configuration":"Column configuration","Loading...":"Loading...","Pick item":"Pick item","Sign in":"Sign in","Document preview":"Document preview",Download:"Download","Show details":"Show details",Symbol:"Symbol",Position:"Position","Buy price":"Buy price","Profit/Loss":"Profit/Loss",Details:"Details",Info:"Info",Back:"Back","N/A":"N/A",Dashboard:"Dashboard","31 days":"31 days","Profit for 31 days":"Profit for 31 days","7 days":"7 days","Profit for 7 days":"Profit for 7 days",Yesterday:"Yesterday","Yesterday's profit":"Yesterday's profit",Today:"Today","Today's profit":"Today's profit",Failed:"Failed",Successful:"Successful",Total:"Total",Resolved:"Resolved","No signals":"No signals","Signals will be displayed here after they appear":"Signals will be displayed here after they appear","Successful signal":"Successful signal","Successful signals":"Successful signals","Data is outdated. Please refresh the page":"Data is outdated. Please refresh the page","Disconnected from server":"Disconnected from server","Reload page":"Reload page",Reconnect:"Reconnect"},LOCALE={Notifications:"Уведомления",All:"Все",Signals:"Сигналы",Opened:"Открыт",Closed:"Закрыт",Scheduled:"Запланирован",Cancelled:"Отменён","Partial profit":"Частичный профит","Profit fixed":"Зафиксирован профит","Partial loss":"Частичный убыток","Loss fixed":"Зафиксирован убыток","Breakeven available":"Безубыток доступен","Breakeven set":"Безубыток установлен","Trailing stop":"Трейлинг стоп","Trailing take":"Трейлинг тейк",Rejected:"Отклонён",Error:"Ошибка",Validation:"Валидация",Critical:"Критическая",Unknown:"Неизвестно","Copied!":"Скопировано успешно!","Saved!":"Сохранено!",Empty:"",Copy:"Копировать",Paste:"Вставить",Prompt:"Ввод","Refresh manually":"Обновить","Create new row":"Создать новую строку","Change sort order":"Изменить порядок сортировки","Drop filters":"Сбросить фильтры",Filters:"Фильтры",Search:"Поиск","Loading data":"Загрузка данных","Nothing found":" ","Point not choosen":"Точка не указана","No data":" ","Not found":"Нет данных","No options":"Нет данных","Drag and drop a file here or click":"Выберите файл",Next:"Далее",Prev:"Назад",Choose:"Выбрать",Deselect:"Убрать",Green:"Зеленый",Skyblue:"Синий",Yellow:"Желтый",Red:"Красный",Submit:"Применить",Date:"Дата",Time:"Время",Loading:"Загрузка",Required:"Заполнить","The form contains unsaved changes. Continue?":"Форма содержит несохраненные изменения. Продолжить?","The form contains invalid data. Continue?":"Форма содержит неправильно указанные данные. Продолжить?","Are you sure you want to delete this file?":"Вы уверены, что хотите удалить файл?",Confirmation:"Подтверждение",Forbidden:"Нет доступа",Ok:"Ок",Cancel:"Отмена",Remove:"Удалить",Send:"Отправить",Actions:"Действие",Save:"Сохранить","Not chosen":"Не указано","Continue?":"Продолжить",Unset:"Нет данных","Select all":"Выбрать","No tips":"Нет данных","Column configuration":"Отображение колонок","Loading...":"Загрузка","Pick item":"Выберите","Sign in":"Далее","Document preview":"Предпросмотр",Download:"Скачать","Show details":"Показать / Скрыть",Symbol:"Символ",Position:"Позиция","Buy price":"Цена покупки","Profit/Loss":"Прибыль/Убыток",Details:"Детали",Info:"Информация",Back:"Назад","N/A":"Не указано",Dashboard:"Дэшборд","31 days":"31 день","Profit for 31 days":"Прибыль за 31 день","7 days":"7 дней","Profit for 7 days":"Прибыль за 7 дней",Yesterday:"Вчера","Yesterday's profit":"Прибыль за вчера",Today:"Сегодня","Today's profit":"Прибыль за сегодня",Failed:"Неудачно",Successful:"Удачно",Total:"Всего",Resolved:"Выполнено","No signals":"Нет сигналов","Signals will be displayed here after they appear":"Сигналы будут отображены здесь после появления","Successful signal":"Удачный сигнал","Successful signals":"Удачных сигналов","Data is outdated. Please refresh the page":"Данные устарели. Обновите страницу","Disconnected from server":"Отключен от сервера","Reload page":"Перезагрузить страницу",Reconnect:"Переподключиться"},getLocale=so(()=>new URL(location.href,window.location.origin).searchParams.get("locale")||"en"),localeChangedSubject=new ar,localeMap={en:LOCALE$1,ru:LOCALE};function t$1(e){const t=getLocale(),n=localeMap[t];return n&&n[e]||e}const MUTATION_DEBOUNCE=1,mutations=[()=>{document.querySelectorAll("input").forEach(e=>{e.placeholder&&(e.dataset.originalPlaceholder||(e.dataset.originalPlaceholder=e.placeholder),e.placeholder=window.Translate.translateText(e.dataset.originalPlaceholder))})},()=>{document.querySelectorAll("textarea").forEach(e=>{e.placeholder&&(e.dataset.originalPlaceholder||(e.dataset.originalPlaceholder=e.placeholder),e.placeholder=window.Translate.translateText(e.dataset.originalPlaceholder))})}],dom_patch=()=>{const e=lodashExports.throttle(Un$1(...mutations.map(e=>()=>{e()})),MUTATION_DEBOUNCE,{trailing:!0}),t=new MutationObserver(e);localeChangedSubject.subscribe(e),t.observe(document.body,{childList:!0,subtree:!0})};document.addEventListener("DOMContentLoaded",dom_patch);const createElementRef=React.createElement,TRANSLATE_MARK=Symbol("translated"),createElementFactory=e=>(t,n,...r)=>{for(let o=0;o!==r.length;o++)"string"==typeof r[o]&&(r[o]=e(r[o]));return createElementRef(t,n,...r)};class Translate{constructor(e={},t,n={}){this.transform=t,this.config=n;const{rawSymbol:r="撝",useRawMark:o=!1,rawCondition:i=()=>!0}=n,a=e=>{const t=this.tr(e);return t===e&&i(t)?r:t};o?(this.createElement=createElementFactory(a),this.translateText=a):(this.createElement=createElementFactory(this.tr),this.translateText=this.tr),Object.entries(e).forEach(([e,t])=>this._map.set(e,this.applyMark(t)))}_skip=new Set;_map=new Map;_transformed=new Map;_middleware=[];get skipList(){return[...this._skip]}translateText;tryTransform=e=>{if(this.transform){if(this._transformed.has(e))return this._transformed.get(e);{let t="";if(this._middleware.some(n=>t=n(e))||(t=this.transform(e)),t!==e){const n=this.applyMark(t);return this._transformed.set(e,n),n}return null}}return null};applyMark=e=>{const t=new String(e);return t[TRANSLATE_MARK]=!0,t};tr=e=>{if(!e)return e;if(e[TRANSLATE_MARK])return e;if(this._skip.has(e))return e;if(this._map.has(e))return this._map.get(e)||"";const t=this.tryTransform(e);return null!==t?t:(this._skip.add(e),e)};use=e=>{this._middleware.push(e)};createElement;jss=(e,t)=>{const n=Array.isArray(null==t?void 0:t.children)?(null==t?void 0:t.children)||[]:[null==t?void 0:t.children];return this.createElement(e,t,...n)};static install=(...e)=>{const t=new Translate(...e);return window.Translate=t,Object.assign(React,{createElement:t.createElement}),t};clear=()=>{this._skip.clear(),this._transformed.clear()}}Translate.install({},t$1,{rawCondition:e=>/[ЁёА-я]/.test(e),useRawMark:!1});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",f="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|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,g={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])+"]"}},v=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:v,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+v(r,2,"0")+":"+v(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}},b="en",x={};x[b]=g;var $="$isDayjsObject",_=function(e){return e instanceof E||!(!e||!e[$])},C=function e(t,n,r){var o;if(!t)return b;if("string"==typeof t){var i=t.toLowerCase();x[i]&&(o=i),n&&(x[i]=n,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var s=t.name;x[s]=t,o=s}return!r&&o&&(b=o),o||!r&&b},w=function(e,t){if(_(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new E(n)},S=y;S.l=C,S.i=_,S.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[$]=!0}var v=g.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(S.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(h);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()},v.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()},v.$utils=function(){return S},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},v.isAfter=function(e,t){return w(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<w(e)},v.$g=function(e,t,n){return S.u(e)?this[t]:this.set(n,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var n=this,r=!!S.u(t)||t,u=S.p(e),f=function(e,t){var o=S.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?o:o.endOf(s)},h=function(e,t){return S.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},m=this.$W,g=this.$M,v=this.$D,y="set"+(this.$u?"UTC":"");switch(u){case d:return r?f(1,0):f(31,11);case c:return r?f(1,g):f(0,g+1);case l:var b=this.$locale().weekStart||0,x=(m<b?m+7:m)-b;return f(r?v-x:v+(6-x),g);case s:case p:return h(y+"Hours",0);case a:return h(y+"Minutes",1);case i:return h(y+"Seconds",2);case o:return h(y+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var n,l=S.p(e),u="set"+(this.$u?"UTC":""),f=(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],h=l===s?this.$D+(t-this.$W):t;if(l===c||l===d){var m=this.clone().set(p,1);m.$d[f](h),m.init(),this.$d=m.set(p,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](h);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[S.p(e)]()},v.add=function(r,u){var p,f=this;r=Number(r);var h=S.p(u),m=function(e){var t=w(f);return S.w(t.date(t.date()+Math.round(e*r)),f)};if(h===c)return this.set(c,this.$M+r);if(h===d)return this.set(d,this.$y+r);if(h===s)return m(1);if(h===l)return m(7);var g=(p={},p[i]=t,p[a]=n,p[o]=e,p)[h]||1,v=this.$d.getTime()+r*g;return S.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=e||"YYYY-MM-DDTHH:mm:ssZ",o=S.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.s(i%12||12,e,"0")},h=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(m,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return S.s(t.$y,4,"0");case"M":return s+1;case"MM":return S.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.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.s(i,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return h(i,a,!0);case"A":return h(i,a,!1);case"m":return String(a);case"mm":return S.s(a,2,"0");case"s":return String(t.$s);case"ss":return S.s(t.$s,2,"0");case"SSS":return S.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")})},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(r,p,f){var h,m=this,g=S.p(p),v=w(r),y=(v.utcOffset()-this.utcOffset())*t,b=this-v,x=function(){return S.m(m,v)};switch(g){case d:h=x()/12;break;case c:h=x();break;case u:h=x()/3;break;case l:h=(b-y)/6048e5;break;case s:h=(b-y)/864e5;break;case a:h=b/n;break;case i:h=b/t;break;case o:h=b/e;break;default:h=b}return f?h:S.a(h)},v.daysInMonth=function(){return this.endOf(c).$D},v.$locale=function(){return x[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},v.clone=function(){return S.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},g}(),k=E.prototype;return w.prototype=k,[["$ms",r],["$s",o],["$m",i],["$H",a],["$W",s],["$M",c],["$y",d],["$D",p]].forEach(function(e){k[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),w.extend=function(e,t){return e.$i||(e(t,E,w),e.$i=!0),w},w.locale=C,w.isDayjs=_,w.unix=function(e){return w(1e3*e)},w.en=x[b],w.Ls=x,w.p={},w}();var dayjs_minExports=dayjs_min.exports;const J$1=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);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$2={};const CC_ENABLE_MOCK=!!define_process_env_default$2.CC_ENABLE_MOCK||!1,CC_FORCE_BROWSER_HISTORY=!!define_process_env_default$2.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$2.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)}
191
+ */lodash.exports,function(e,t){(function(){var n,r="Expected a function",o="__lodash_hash_undefined__",i="__lodash_placeholder__",a=32,s=128,l=256,c=1/0,u=9007199254740991,d=NaN,p=4294967295,f=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",l]],h="[object Arguments]",m="[object Array]",g="[object Boolean]",v="[object Date]",y="[object Error]",b="[object Function]",x="[object GeneratorFunction]",$="[object Map]",_="[object Number]",C="[object Object]",w="[object Promise]",S="[object RegExp]",E="[object Set]",k="[object String]",T="[object Symbol]",P="[object WeakMap]",M="[object ArrayBuffer]",L="[object DataView]",I="[object Float32Array]",R="[object Float64Array]",O="[object Int8Array]",A="[object Int16Array]",D="[object Int32Array]",N="[object Uint8Array]",F="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",j=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,Y=RegExp(U.source),q=RegExp(W.source),G=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),ne=/^\s+/,re=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,pe=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,he=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ye=/($^)/,be=/['\n\r\u2028\u2029\\]/g,xe="\\ud800-\\udfff",$e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",we="A-Z\\xc0-\\xd6\\xd8-\\xde",Se="\\ufe0e\\ufe0f",Ee="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ke="['’]",Te="["+xe+"]",Pe="["+Ee+"]",Me="["+$e+"]",Le="\\d+",Ie="["+_e+"]",Re="["+Ce+"]",Oe="[^"+xe+Ee+Le+_e+Ce+we+"]",Ae="\\ud83c[\\udffb-\\udfff]",De="[^"+xe+"]",Ne="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",ze="["+we+"]",Be="\\u200d",je="(?:"+Re+"|"+Oe+")",He="(?:"+ze+"|"+Oe+")",Ve="(?:['’](?:d|ll|m|re|s|t|ve))?",Ue="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Me+"|"+Ae+")"+"?",Ye="["+Se+"]?",qe=Ye+We+("(?:"+Be+"(?:"+[De,Ne,Fe].join("|")+")"+Ye+We+")*"),Ge="(?:"+[Ie,Ne,Fe].join("|")+")"+qe,Ke="(?:"+[De+Me+"?",Me,Ne,Fe,Te].join("|")+")",Xe=RegExp(ke,"g"),Ze=RegExp(Me,"g"),Je=RegExp(Ae+"(?="+Ae+")|"+Ke+qe,"g"),Qe=RegExp([ze+"?"+Re+"+"+Ve+"(?="+[Pe,ze,"$"].join("|")+")",He+"+"+Ue+"(?="+[Pe,ze+je,"$"].join("|")+")",ze+"?"+je+"+"+Ve,ze+"+"+Ue,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Le,Ge].join("|"),"g"),et=RegExp("["+Be+xe+$e+Se+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,ot={};ot[I]=ot[R]=ot[O]=ot[A]=ot[D]=ot[N]=ot[F]=ot[z]=ot[B]=!0,ot[h]=ot[m]=ot[M]=ot[g]=ot[L]=ot[v]=ot[y]=ot[b]=ot[$]=ot[_]=ot[C]=ot[S]=ot[E]=ot[k]=ot[P]=!1;var it={};it[h]=it[m]=it[M]=it[L]=it[g]=it[v]=it[I]=it[R]=it[O]=it[A]=it[D]=it[$]=it[_]=it[C]=it[S]=it[E]=it[k]=it[T]=it[N]=it[F]=it[z]=it[B]=!0,it[y]=it[b]=it[P]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ct="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,ut="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||ut||Function("return this")(),pt=t&&!t.nodeType&&t,ft=pt&&e&&!e.nodeType&&e,ht=ft&&ft.exports===pt,mt=ht&&ct.process,gt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||mt&&mt.binding&&mt.binding("util")}catch(e2){}}(),vt=gt&&gt.isArrayBuffer,yt=gt&&gt.isDate,bt=gt&&gt.isMap,xt=gt&&gt.isRegExp,$t=gt&&gt.isSet,_t=gt&&gt.isTypedArray;function Ct(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function wt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function St(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Et(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function kt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Tt(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function Pt(e,t){return!!(null==e?0:e.length)&&zt(e,t,0)>-1}function Mt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function Lt(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function It(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function Rt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function Ot(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function At(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Dt=Vt("length");function Nt(e,t,n){var r;return n(e,function(e,n,o){if(t(e,n,o))return r=n,!1}),r}function Ft(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function zt(e,t,n){return t==t?function(e,t,n){var r=n-1,o=e.length;for(;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):Ft(e,jt,n)}function Bt(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function jt(e){return e!=e}function Ht(e,t){var n=null==e?0:e.length;return n?Yt(e,t)/n:d}function Vt(e){return function(t){return null==t?n:t[e]}}function Ut(e){return function(t){return null==e?n:e[t]}}function Wt(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}function Yt(e,t){for(var r,o=-1,i=e.length;++o<i;){var a=t(e[o]);a!==n&&(r=r===n?a:r+a)}return r}function qt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Gt(e){return e?e.slice(0,dn(e)+1).replace(ne,""):e}function Kt(e){return function(t){return e(t)}}function Xt(e,t){return Lt(t,function(t){return e[t]})}function Zt(e,t){return e.has(t)}function Jt(e,t){for(var n=-1,r=e.length;++n<r&&zt(t,e[n],0)>-1;);return n}function Qt(e,t){for(var n=e.length;n--&&zt(t,e[n],0)>-1;);return n}var en=Ut({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),tn=Ut({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(e){return"\\"+at[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function an(e,t){return function(n){return e(t(n))}}function sn(e,t){for(var n=-1,r=e.length,o=0,a=[];++n<r;){var s=e[n];s!==t&&s!==i||(e[n]=i,a[o++]=n)}return a}function ln(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function cn(e){return rn(e)?function(e){var t=Je.lastIndex=0;for(;Je.test(e);)++t;return t}(e):Dt(e)}function un(e){return rn(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function dn(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}var pn=Ut({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var fn=function e(t){var re,xe=(t=null==t?dt:fn.defaults(dt.Object(),t,fn.pick(dt,nt))).Array,$e=t.Date,_e=t.Error,Ce=t.Function,we=t.Math,Se=t.Object,Ee=t.RegExp,ke=t.String,Te=t.TypeError,Pe=xe.prototype,Me=Ce.prototype,Le=Se.prototype,Ie=t["__core-js_shared__"],Re=Me.toString,Oe=Le.hasOwnProperty,Ae=0,De=(re=/[^.]+$/.exec(Ie&&Ie.keys&&Ie.keys.IE_PROTO||""))?"Symbol(src)_1."+re:"",Ne=Le.toString,Fe=Re.call(Se),ze=dt._,Be=Ee("^"+Re.call(Oe).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),je=ht?t.Buffer:n,He=t.Symbol,Ve=t.Uint8Array,Ue=je?je.allocUnsafe:n,We=an(Se.getPrototypeOf,Se),Ye=Se.create,qe=Le.propertyIsEnumerable,Ge=Pe.splice,Ke=He?He.isConcatSpreadable:n,Je=He?He.iterator:n,et=He?He.toStringTag:n,at=function(){try{var e=ui(Se,"defineProperty");return e({},"",{}),e}catch(e2){}}(),ct=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ut=$e&&$e.now!==dt.Date.now&&$e.now,pt=t.setTimeout!==dt.setTimeout&&t.setTimeout,ft=we.ceil,mt=we.floor,gt=Se.getOwnPropertySymbols,Dt=je?je.isBuffer:n,Ut=t.isFinite,hn=Pe.join,mn=an(Se.keys,Se),gn=we.max,vn=we.min,yn=$e.now,bn=t.parseInt,xn=we.random,$n=Pe.reverse,_n=ui(t,"DataView"),Cn=ui(t,"Map"),wn=ui(t,"Promise"),Sn=ui(t,"Set"),En=ui(t,"WeakMap"),kn=ui(Se,"create"),Tn=En&&new En,Pn={},Mn=zi(_n),Ln=zi(Cn),In=zi(wn),Rn=zi(Sn),On=zi(En),An=He?He.prototype:n,Dn=An?An.valueOf:n,Nn=An?An.toString:n;function Fn(e){if(ns(e)&&!Wa(e)&&!(e instanceof Hn)){if(e instanceof jn)return e;if(Oe.call(e,"__wrapped__"))return Bi(e)}return new jn(e)}var zn=function(){function e(){}return function(t){if(!ts(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Bn(){}function jn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Hn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Un(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Wn;++t<n;)this.add(e[t])}function qn(e){var t=this.__data__=new Un(e);this.size=t.size}function Gn(e,t){var n=Wa(e),r=!n&&Ua(e),o=!n&&!r&&Ka(e),i=!n&&!r&&!o&&us(e),a=n||r||o||i,s=a?qt(e.length,ke):[],l=s.length;for(var c in e)!t&&!Oe.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||vi(c,l))||s.push(c);return s}function Kn(e){var t=e.length;return t?e[Yr(0,t-1)]:n}function Xn(e,t){return Ri(To(e),ir(t,0,e.length))}function Zn(e){return Ri(To(e))}function Jn(e,t,r){(r!==n&&!ja(e[t],r)||r===n&&!(t in e))&&rr(e,t,r)}function Qn(e,t,r){var o=e[t];Oe.call(e,t)&&ja(o,r)&&(r!==n||t in e)||rr(e,t,r)}function er(e,t){for(var n=e.length;n--;)if(ja(e[n][0],t))return n;return-1}function tr(e,t,n,r){return ur(e,function(e,o,i){t(r,e,n(e),i)}),r}function nr(e,t){return e&&Po(t,Is(t),e)}function rr(e,t,n){"__proto__"==t&&at?at(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function or(e,t){for(var r=-1,o=t.length,i=xe(o),a=null==e;++r<o;)i[r]=a?n:ks(e,t[r]);return i}function ir(e,t,r){return e==e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function ar(e,t,r,o,i,a){var s,l=1&t,c=2&t,u=4&t;if(r&&(s=i?r(e,o,i,a):r(e)),s!==n)return s;if(!ts(e))return e;var d=Wa(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Oe.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return To(e,s)}else{var p=fi(e),f=p==b||p==x;if(Ka(e))return _o(e,l);if(p==C||p==h||f&&!i){if(s=c||f?{}:mi(e),!l)return c?function(e,t){return Po(e,pi(e),t)}(e,function(e,t){return e&&Po(t,Rs(t),e)}(s,e)):function(e,t){return Po(e,di(e),t)}(e,nr(s,e))}else{if(!it[p])return i?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case M:return Co(e);case g:case v:return new r(+e);case L:return function(e,t){var n=t?Co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case I:case R:case O:case A:case D:case N:case F:case z:case B:return wo(e,n);case $:return new r;case _:case k:return new r(e);case S:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new r;case T:return o=e,Dn?Se(Dn.call(o)):{}}var o}(e,p,l)}}a||(a=new qn);var m=a.get(e);if(m)return m;a.set(e,s),ss(e)?e.forEach(function(n){s.add(ar(n,t,r,n,e,a))}):rs(e)&&e.forEach(function(n,o){s.set(o,ar(n,t,r,o,e,a))});var y=d?n:(u?c?ri:ni:c?Rs:Is)(e);return St(y||e,function(n,o){y&&(n=e[o=n]),Qn(s,o,ar(n,t,r,o,e,a))}),s}function sr(e,t,r){var o=r.length;if(null==e)return!o;for(e=Se(e);o--;){var i=r[o],a=t[i],s=e[i];if(s===n&&!(i in e)||!a(s))return!1}return!0}function lr(e,t,o){if("function"!=typeof e)throw new Te(r);return Pi(function(){e.apply(n,o)},t)}function cr(e,t,n,r){var o=-1,i=Pt,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=Lt(t,Kt(n))),r?(i=Mt,a=!1):t.length>=200&&(i=Zt,a=!1,t=new Yn(t));e:for(;++o<s;){var u=e[o],d=null==n?u:n(u);if(u=r||0!==u?u:0,a&&d==d){for(var p=c;p--;)if(t[p]===d)continue e;l.push(u)}else i(t,d,r)||l.push(u)}return l}Fn.templateSettings={escape:G,evaluate:K,interpolate:X,variable:"",imports:{_:Fn}},Fn.prototype=Bn.prototype,Fn.prototype.constructor=Fn,jn.prototype=zn(Bn.prototype),jn.prototype.constructor=jn,Hn.prototype=zn(Bn.prototype),Hn.prototype.constructor=Hn,Vn.prototype.clear=function(){this.__data__=kn?kn(null):{},this.size=0},Vn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Vn.prototype.get=function(e){var t=this.__data__;if(kn){var r=t[e];return r===o?n:r}return Oe.call(t,e)?t[e]:n},Vn.prototype.has=function(e){var t=this.__data__;return kn?t[e]!==n:Oe.call(t,e)},Vn.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=kn&&t===n?o:t,this},Un.prototype.clear=function(){this.__data__=[],this.size=0},Un.prototype.delete=function(e){var t=this.__data__,n=er(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ge.call(t,n,1),--this.size,!0)},Un.prototype.get=function(e){var t=this.__data__,r=er(t,e);return r<0?n:t[r][1]},Un.prototype.has=function(e){return er(this.__data__,e)>-1},Un.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(Cn||Un),string:new Vn}},Wn.prototype.delete=function(e){var t=li(this,e).delete(e);return this.size-=t?1:0,t},Wn.prototype.get=function(e){return li(this,e).get(e)},Wn.prototype.has=function(e){return li(this,e).has(e)},Wn.prototype.set=function(e,t){var n=li(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Yn.prototype.add=Yn.prototype.push=function(e){return this.__data__.set(e,o),this},Yn.prototype.has=function(e){return this.__data__.has(e)},qn.prototype.clear=function(){this.__data__=new Un,this.size=0},qn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},qn.prototype.get=function(e){return this.__data__.get(e)},qn.prototype.has=function(e){return this.__data__.has(e)},qn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Un){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(e,t),this.size=n.size,this};var ur=Io(yr),dr=Io(br,!0);function pr(e,t){var n=!0;return ur(e,function(e,r,o){return n=!!t(e,r,o)}),n}function fr(e,t,r){for(var o=-1,i=e.length;++o<i;){var a=e[o],s=t(a);if(null!=s&&(l===n?s==s&&!cs(s):r(s,l)))var l=s,c=a}return c}function hr(e,t){var n=[];return ur(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}function mr(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=gi),o||(o=[]);++i<a;){var s=e[i];t>0&&n(s)?t>1?mr(s,t-1,n,r,o):It(o,s):r||(o[o.length]=s)}return o}var gr=Ro(),vr=Ro(!0);function yr(e,t){return e&&gr(e,t,Is)}function br(e,t){return e&&vr(e,t,Is)}function xr(e,t){return Tt(t,function(t){return Ja(e[t])})}function $r(e,t){for(var r=0,o=(t=yo(t,e)).length;null!=e&&r<o;)e=e[Fi(t[r++])];return r&&r==o?e:n}function _r(e,t,n){var r=t(e);return Wa(e)?r:It(r,n(e))}function Cr(e){return null==e?e===n?"[object Undefined]":"[object Null]":et&&et in Se(e)?function(e){var t=Oe.call(e,et),r=e[et];try{e[et]=n;var o=!0}catch(e2){}var i=Ne.call(e);o&&(t?e[et]=r:delete e[et]);return i}(e):function(e){return Ne.call(e)}(e)}function wr(e,t){return e>t}function Sr(e,t){return null!=e&&Oe.call(e,t)}function Er(e,t){return null!=e&&t in Se(e)}function kr(e,t,r){for(var o=r?Mt:Pt,i=e[0].length,a=e.length,s=a,l=xe(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Lt(d,Kt(t))),c=vn(d.length,c),l[s]=!r&&(t||i>=120&&d.length>=120)?new Yn(s&&d):n}d=e[0];var p=-1,f=l[0];e:for(;++p<i&&u.length<c;){var h=d[p],m=t?t(h):h;if(h=r||0!==h?h:0,!(f?Zt(f,m):o(u,m,r))){for(s=a;--s;){var g=l[s];if(!(g?Zt(g,m):o(e[s],m,r)))continue e}f&&f.push(m),u.push(h)}}return u}function Tr(e,t,r){var o=null==(e=Ei(e,t=yo(t,e)))?e:e[Fi(Zi(t))];return null==o?n:Ct(o,e,r)}function Pr(e){return ns(e)&&Cr(e)==h}function Mr(e,t,r,o,i){return e===t||(null==e||null==t||!ns(e)&&!ns(t)?e!=e&&t!=t:function(e,t,r,o,i,a){var s=Wa(e),l=Wa(t),c=s?m:fi(e),u=l?m:fi(t),d=(c=c==h?C:c)==C,p=(u=u==h?C:u)==C,f=c==u;if(f&&Ka(e)){if(!Ka(t))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new qn),s||us(e)?ei(e,t,r,o,i,a):function(e,t,n,r,o,i,a){switch(n){case L:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case M:return!(e.byteLength!=t.byteLength||!i(new Ve(e),new Ve(t)));case g:case v:case _:return ja(+e,+t);case y:return e.name==t.name&&e.message==t.message;case S:case k:return e==t+"";case $:var s=on;case E:var l=1&r;if(s||(s=ln),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=ei(s(e),s(t),r,o,i,a);return a.delete(e),u;case T:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,c,r,o,i,a);if(!(1&r)){var b=d&&Oe.call(e,"__wrapped__"),x=p&&Oe.call(t,"__wrapped__");if(b||x){var w=b?e.value():e,P=x?t.value():t;return a||(a=new qn),i(w,P,r,o,a)}}if(!f)return!1;return a||(a=new qn),function(e,t,r,o,i,a){var s=1&r,l=ni(e),c=l.length,u=ni(t),d=u.length;if(c!=d&&!s)return!1;var p=c;for(;p--;){var f=l[p];if(!(s?f in t:Oe.call(t,f)))return!1}var h=a.get(e),m=a.get(t);if(h&&m)return h==t&&m==e;var g=!0;a.set(e,t),a.set(t,e);var v=s;for(;++p<c;){var y=e[f=l[p]],b=t[f];if(o)var x=s?o(b,y,f,t,e,a):o(y,b,f,e,t,a);if(!(x===n?y===b||i(y,b,r,o,a):x)){g=!1;break}v||(v="constructor"==f)}if(g&&!v){var $=e.constructor,_=t.constructor;$==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof $&&$ instanceof $&&"function"==typeof _&&_ instanceof _||(g=!1)}return a.delete(e),a.delete(t),g}(e,t,r,o,i,a)}(e,t,r,o,Mr,i))}function Lr(e,t,r,o){var i=r.length,a=i,s=!o;if(null==e)return!a;for(e=Se(e);i--;){var l=r[i];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<a;){var c=(l=r[i])[0],u=e[c],d=l[1];if(s&&l[2]){if(u===n&&!(c in e))return!1}else{var p=new qn;if(o)var f=o(u,d,c,e,t,p);if(!(f===n?Mr(d,u,3,o,p):f))return!1}}return!0}function Ir(e){return!(!ts(e)||(t=e,De&&De in t))&&(Ja(e)?Be:he).test(zi(e));var t}function Rr(e){return"function"==typeof e?e:null==e?ol:"object"==typeof e?Wa(e)?zr(e[0],e[1]):Fr(e):fl(e)}function Or(e){if(!_i(e))return mn(e);var t=[];for(var n in Se(e))Oe.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Ar(e){if(!ts(e))return function(e){var t=[];if(null!=e)for(var n in Se(e))t.push(n);return t}(e);var t=_i(e),n=[];for(var r in e)("constructor"!=r||!t&&Oe.call(e,r))&&n.push(r);return n}function Dr(e,t){return e<t}function Nr(e,t){var n=-1,r=qa(e)?xe(e.length):[];return ur(e,function(e,o,i){r[++n]=t(e,o,i)}),r}function Fr(e){var t=ci(e);return 1==t.length&&t[0][2]?wi(t[0][0],t[0][1]):function(n){return n===e||Lr(n,e,t)}}function zr(e,t){return bi(e)&&Ci(t)?wi(Fi(e),t):function(r){var o=ks(r,e);return o===n&&o===t?Ts(r,e):Mr(t,o,3)}}function Br(e,t,r,o,i){e!==t&&gr(t,function(a,s){if(i||(i=new qn),ts(a))!function(e,t,r,o,i,a,s){var l=ki(e,r),c=ki(t,r),u=s.get(c);if(u)return void Jn(e,r,u);var d=a?a(l,c,r+"",e,t,s):n,p=d===n;if(p){var f=Wa(c),h=!f&&Ka(c),m=!f&&!h&&us(c);d=c,f||h||m?Wa(l)?d=l:Ga(l)?d=To(l):h?(p=!1,d=_o(c,!0)):m?(p=!1,d=wo(c,!0)):d=[]:is(c)||Ua(c)?(d=l,Ua(l)?d=ys(l):ts(l)&&!Ja(l)||(d=mi(c))):p=!1}p&&(s.set(c,d),i(d,c,o,a,s),s.delete(c));Jn(e,r,d)}(e,t,s,r,Br,o,i);else{var l=o?o(ki(e,s),a,s+"",e,t,i):n;l===n&&(l=a),Jn(e,s,l)}},Rs)}function jr(e,t){var r=e.length;if(r)return vi(t+=t<0?r:0,r)?e[t]:n}function Hr(e,t,n){t=t.length?Lt(t,function(e){return Wa(e)?function(t){return $r(t,1===e.length?e[0]:e)}:e}):[ol];var r=-1;return t=Lt(t,Kt(si())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(Nr(e,function(e,n,o){return{criteria:Lt(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return function(e,t,n){var r=-1,o=e.criteria,i=t.criteria,a=o.length,s=n.length;for(;++r<a;){var l=So(o[r],i[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)})}function Vr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],s=$r(e,a);n(s,a)&&Zr(i,yo(a,e),s)}return i}function Ur(e,t,n,r){var o=r?Bt:zt,i=-1,a=t.length,s=e;for(e===t&&(t=To(t)),n&&(s=Lt(e,Kt(n)));++i<a;)for(var l=0,c=t[i],u=n?n(c):c;(l=o(s,u,l,r))>-1;)s!==e&&Ge.call(s,l,1),Ge.call(e,l,1);return e}function Wr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;vi(o)?Ge.call(e,o,1):co(e,o)}}return e}function Yr(e,t){return e+mt(xn()*(t-e+1))}function qr(e,t){var n="";if(!e||t<1||t>u)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Gr(e,t){return Mi(Si(e,t,ol),e+"")}function Kr(e){return Kn(js(e))}function Xr(e,t){var n=js(e);return Ri(n,ir(t,0,n.length))}function Zr(e,t,r,o){if(!ts(e))return e;for(var i=-1,a=(t=yo(t,e)).length,s=a-1,l=e;null!=l&&++i<a;){var c=Fi(t[i]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=s){var d=l[c];(u=o?o(d,c,l):n)===n&&(u=ts(d)?d:vi(t[i+1])?[]:{})}Qn(l,c,u),l=l[c]}return e}var Jr=Tn?function(e,t){return Tn.set(e,t),e}:ol,Qr=at?function(e,t){return at(e,"toString",{configurable:!0,enumerable:!1,value:tl(t),writable:!0})}:ol;function eo(e){return Ri(js(e))}function to(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=xe(o);++r<o;)i[r]=e[r+t];return i}function no(e,t){var n;return ur(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}function ro(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!cs(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return oo(e,t,ol,n)}function oo(e,t,r,o){var i=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=r(t))!=t,l=null===t,c=cs(t),u=t===n;i<a;){var d=mt((i+a)/2),p=r(e[d]),f=p!==n,h=null===p,m=p==p,g=cs(p);if(s)var v=o||m;else v=u?m&&(o||f):l?m&&f&&(o||!h):c?m&&f&&!h&&(o||!g):!h&&!g&&(o?p<=t:p<t);v?i=d+1:a=d}return vn(a,4294967294)}function io(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!ja(s,l)){var l=s;i[o++]=0===a?0:a}}return i}function ao(e){return"number"==typeof e?e:cs(e)?d:+e}function so(e){if("string"==typeof e)return e;if(Wa(e))return Lt(e,so)+"";if(cs(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function lo(e,t,n){var r=-1,o=Pt,i=e.length,a=!0,s=[],l=s;if(n)a=!1,o=Mt;else if(i>=200){var c=t?null:Go(e);if(c)return ln(c);a=!1,o=Zt,l=new Yn}else l=t?[]:s;e:for(;++r<i;){var u=e[r],d=t?t(u):u;if(u=n||0!==u?u:0,a&&d==d){for(var p=l.length;p--;)if(l[p]===d)continue e;t&&l.push(d),s.push(u)}else o(l,d,n)||(l!==s&&l.push(d),s.push(u))}return s}function co(e,t){var n=-1,r=(t=yo(t,e)).length;if(!r)return!0;for(var o=null==e||"object"!=typeof e&&"function"!=typeof e;++n<r;){var i=t[n];if("string"==typeof i){if("__proto__"===i&&!Oe.call(e,"__proto__"))return!1;if("constructor"===i&&n+1<r&&"string"==typeof t[n+1]&&"prototype"===t[n+1]){if(o&&0===n)continue;return!1}}}var a=Ei(e,t);return null==a||delete a[Fi(Zi(t))]}function uo(e,t,n,r){return Zr(e,t,n($r(e,t)),r)}function po(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?to(e,r?0:i,r?i+1:o):to(e,r?i+1:0,r?o:i)}function fo(e,t){var n=e;return n instanceof Hn&&(n=n.value()),Rt(t,function(e,t){return t.func.apply(t.thisArg,It([e],t.args))},n)}function ho(e,t,n){var r=e.length;if(r<2)return r?lo(e[0]):[];for(var o=-1,i=xe(r);++o<r;)for(var a=e[o],s=-1;++s<r;)s!=o&&(i[o]=cr(i[o]||a,e[s],t,n));return lo(mr(i,1),t,n)}function mo(e,t,r){for(var o=-1,i=e.length,a=t.length,s={};++o<i;){var l=o<a?t[o]:n;r(s,e[o],l)}return s}function go(e){return Ga(e)?e:[]}function vo(e){return"function"==typeof e?e:ol}function yo(e,t){return Wa(e)?e:bi(e,t)?[e]:Ni(bs(e))}var bo=Gr;function xo(e,t,r){var o=e.length;return r=r===n?o:r,!t&&r>=o?e:to(e,t,r)}var $o=ct||function(e){return dt.clearTimeout(e)};function _o(e,t){if(t)return e.slice();var n=e.length,r=Ue?Ue(n):new e.constructor(n);return e.copy(r),r}function Co(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function wo(e,t){var n=t?Co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function So(e,t){if(e!==t){var r=e!==n,o=null===e,i=e==e,a=cs(e),s=t!==n,l=null===t,c=t==t,u=cs(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||o&&s&&c||!r&&c||!i)return 1;if(!o&&!a&&!u&&e<t||u&&r&&i&&!o&&!a||l&&r&&i||!s&&i||!c)return-1}return 0}function Eo(e,t,n,r){for(var o=-1,i=e.length,a=n.length,s=-1,l=t.length,c=gn(i-a,0),u=xe(l+c),d=!r;++s<l;)u[s]=t[s];for(;++o<a;)(d||o<i)&&(u[n[o]]=e[o]);for(;c--;)u[s++]=e[o++];return u}function ko(e,t,n,r){for(var o=-1,i=e.length,a=-1,s=n.length,l=-1,c=t.length,u=gn(i-s,0),d=xe(u+c),p=!r;++o<u;)d[o]=e[o];for(var f=o;++l<c;)d[f+l]=t[l];for(;++a<s;)(p||o<i)&&(d[f+n[a]]=e[o++]);return d}function To(e,t){var n=-1,r=e.length;for(t||(t=xe(r));++n<r;)t[n]=e[n];return t}function Po(e,t,r,o){var i=!r;r||(r={});for(var a=-1,s=t.length;++a<s;){var l=t[a],c=o?o(r[l],e[l],l,r,e):n;c===n&&(c=e[l]),i?rr(r,l,c):Qn(r,l,c)}return r}function Mo(e,t){return function(n,r){var o=Wa(n)?wt:tr,i=t?t():{};return o(n,e,si(r,2),i)}}function Lo(e){return Gr(function(t,r){var o=-1,i=r.length,a=i>1?r[i-1]:n,s=i>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(i--,a):n,s&&yi(r[0],r[1],s)&&(a=i<3?n:a,i=1),t=Se(t);++o<i;){var l=r[o];l&&e(t,l,o,a)}return t})}function Io(e,t){return function(n,r){if(null==n)return n;if(!qa(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=Se(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function Ro(e){return function(t,n,r){for(var o=-1,i=Se(t),a=r(t),s=a.length;s--;){var l=a[e?s:++o];if(!1===n(i[l],l,i))break}return t}}function Oo(e){return function(t){var r=rn(t=bs(t))?un(t):n,o=r?r[0]:t.charAt(0),i=r?xo(r,1).join(""):t.slice(1);return o[e]()+i}}function Ao(e){return function(t){return Rt(Js(Us(t).replace(Xe,"")),e,"")}}function Do(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=zn(e.prototype),r=e.apply(n,t);return ts(r)?r:n}}function No(e){return function(t,r,o){var i=Se(t);if(!qa(t)){var a=si(r,3);t=Is(t),r=function(e){return a(i[e],e,i)}}var s=e(t,r,o);return s>-1?i[a?t[s]:s]:n}}function Fo(e){return ti(function(t){var o=t.length,i=o,a=jn.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if("function"!=typeof s)throw new Te(r);if(a&&!l&&"wrapper"==ii(s))var l=new jn([],!0)}for(i=l?i:o;++i<o;){var c=ii(s=t[i]),u="wrapper"==c?oi(s):n;l=u&&xi(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[ii(u[0])].apply(l,u[3]):1==s.length&&xi(s)?l[c]():l.thru(s)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Wa(n))return l.plant(n).value();for(var r=0,i=o?t[r].apply(this,e):n;++r<o;)i=t[r].call(this,i);return i}})}function zo(e,t,r,o,i,a,l,c,u,d){var p=t&s,f=1&t,h=2&t,m=24&t,g=512&t,v=h?n:Do(e);return function s(){for(var y=arguments.length,b=xe(y),x=y;x--;)b[x]=arguments[x];if(m)var $=ai(s),_=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(b,$);if(o&&(b=Eo(b,o,i,m)),a&&(b=ko(b,a,l,m)),y-=_,m&&y<d){var C=sn(b,$);return Yo(e,t,zo,s.placeholder,r,b,C,c,u,d-y)}var w=f?r:this,S=h?w[e]:e;return y=b.length,c?b=function(e,t){var r=e.length,o=vn(t.length,r),i=To(e);for(;o--;){var a=t[o];e[o]=vi(a,r)?i[a]:n}return e}(b,c):g&&y>1&&b.reverse(),p&&u<y&&(b.length=u),this&&this!==dt&&this instanceof s&&(S=v||Do(S)),S.apply(w,b)}}function Bo(e,t){return function(n,r){return function(e,t,n,r){return yr(e,function(e,o,i){t(r,n(e),o,i)}),r}(n,e,t(r),{})}}function jo(e,t){return function(r,o){var i;if(r===n&&o===n)return t;if(r!==n&&(i=r),o!==n){if(i===n)return o;"string"==typeof r||"string"==typeof o?(r=so(r),o=so(o)):(r=ao(r),o=ao(o)),i=e(r,o)}return i}}function Ho(e){return ti(function(t){return t=Lt(t,Kt(si())),Gr(function(n){var r=this;return e(t,function(e){return Ct(e,r,n)})})})}function Vo(e,t){var r=(t=t===n?" ":so(t)).length;if(r<2)return r?qr(t,e):t;var o=qr(t,ft(e/cn(t)));return rn(t)?xo(un(o),0,e).join(""):o.slice(0,e)}function Uo(e){return function(t,r,o){return o&&"number"!=typeof o&&yi(t,r,o)&&(r=o=n),t=hs(t),r===n?(r=t,t=0):r=hs(r),function(e,t,n,r){for(var o=-1,i=gn(ft((t-e)/(n||1)),0),a=xe(i);i--;)a[r?i:++o]=e,e+=n;return a}(t,r,o=o===n?t<r?1:-1:hs(o),e)}}function Wo(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=vs(t),n=vs(n)),e(t,n)}}function Yo(e,t,r,o,i,s,l,c,u,d){var p=8&t;t|=p?a:64,4&(t&=~(p?64:a))||(t&=-4);var f=[e,t,i,p?s:n,p?l:n,p?n:s,p?n:l,c,u,d],h=r.apply(n,f);return xi(e)&&Ti(h,f),h.placeholder=o,Li(h,e,t)}function qo(e){var t=we[e];return function(e,n){if(e=vs(e),(n=null==n?0:vn(ms(n),292))&&Ut(e)){var r=(bs(e)+"e").split("e");return+((r=(bs(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Go=Sn&&1/ln(new Sn([,-0]))[1]==c?function(e){return new Sn(e)}:cl;function Ko(e){return function(t){var n=fi(t);return n==$?on(t):n==E?function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}(t):function(e,t){return Lt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Xo(e,t,o,c,u,d,p,f){var h=2&t;if(!h&&"function"!=typeof e)throw new Te(r);var m=c?c.length:0;if(m||(t&=-97,c=u=n),p=p===n?p:gn(ms(p),0),f=f===n?f:ms(f),m-=u?u.length:0,64&t){var g=c,v=u;c=u=n}var y=h?n:oi(e),b=[e,t,o,c,u,g,v,d,p,f];if(y&&function(e,t){var n=e[1],r=t[1],o=n|r,a=o<131,c=r==s&&8==n||r==s&&n==l&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!a&&!c)return e;1&r&&(e[2]=t[2],o|=1&n?0:4);var u=t[3];if(u){var d=e[3];e[3]=d?Eo(d,u,t[4]):u,e[4]=d?sn(e[3],i):t[4]}(u=t[5])&&(d=e[5],e[5]=d?ko(d,u,t[6]):u,e[6]=d?sn(e[5],i):t[6]);(u=t[7])&&(e[7]=u);r&s&&(e[8]=null==e[8]?t[8]:vn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=o}(b,y),e=b[0],t=b[1],o=b[2],c=b[3],u=b[4],!(f=b[9]=b[9]===n?h?0:e.length:gn(b[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)x=8==t||16==t?function(e,t,r){var o=Do(e);return function i(){for(var a=arguments.length,s=xe(a),l=a,c=ai(i);l--;)s[l]=arguments[l];var u=a<3&&s[0]!==c&&s[a-1]!==c?[]:sn(s,c);return(a-=u.length)<r?Yo(e,t,zo,i.placeholder,n,s,u,n,n,r-a):Ct(this&&this!==dt&&this instanceof i?o:e,this,s)}}(e,t,f):t!=a&&33!=t||u.length?zo.apply(n,b):function(e,t,n,r){var o=1&t,i=Do(e);return function t(){for(var a=-1,s=arguments.length,l=-1,c=r.length,u=xe(c+s),d=this&&this!==dt&&this instanceof t?i:e;++l<c;)u[l]=r[l];for(;s--;)u[l++]=arguments[++a];return Ct(d,o?n:this,u)}}(e,t,o,c);else var x=function(e,t,n){var r=1&t,o=Do(e);return function t(){return(this&&this!==dt&&this instanceof t?o:e).apply(r?n:this,arguments)}}(e,t,o);return Li((y?Jr:Ti)(x,b),e,t)}function Zo(e,t,r,o){return e===n||ja(e,Le[r])&&!Oe.call(o,r)?t:e}function Jo(e,t,r,o,i,a){return ts(e)&&ts(t)&&(a.set(t,e),Br(e,t,n,Jo,a),a.delete(t)),e}function Qo(e){return is(e)?n:e}function ei(e,t,r,o,i,a){var s=1&r,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var p=-1,f=!0,h=2&r?new Yn:n;for(a.set(e,t),a.set(t,e);++p<l;){var m=e[p],g=t[p];if(o)var v=s?o(g,m,p,t,e,a):o(m,g,p,e,t,a);if(v!==n){if(v)continue;f=!1;break}if(h){if(!At(t,function(e,t){if(!Zt(h,t)&&(m===e||i(m,e,r,o,a)))return h.push(t)})){f=!1;break}}else if(m!==g&&!i(m,g,r,o,a)){f=!1;break}}return a.delete(e),a.delete(t),f}function ti(e){return Mi(Si(e,n,Yi),e+"")}function ni(e){return _r(e,Is,di)}function ri(e){return _r(e,Rs,pi)}var oi=Tn?function(e){return Tn.get(e)}:cl;function ii(e){for(var t=e.name+"",n=Pn[t],r=Oe.call(Pn,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function ai(e){return(Oe.call(Fn,"placeholder")?Fn:e).placeholder}function si(){var e=Fn.iteratee||il;return e=e===il?Rr:e,arguments.length?e(arguments[0],arguments[1]):e}function li(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ci(e){for(var t=Is(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Ci(o)]}return t}function ui(e,t){var r=function(e,t){return null==e?n:e[t]}(e,t);return Ir(r)?r:n}var di=gt?function(e){return null==e?[]:(e=Se(e),Tt(gt(e),function(t){return qe.call(e,t)}))}:gl,pi=gt?function(e){for(var t=[];e;)It(t,di(e)),e=We(e);return t}:gl,fi=Cr;function hi(e,t,n){for(var r=-1,o=(t=yo(t,e)).length,i=!1;++r<o;){var a=Fi(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&es(o)&&vi(a,o)&&(Wa(e)||Ua(e))}function mi(e){return"function"!=typeof e.constructor||_i(e)?{}:zn(We(e))}function gi(e){return Wa(e)||Ua(e)||!!(Ke&&e&&e[Ke])}function vi(e,t){var n=typeof e;return!!(t=null==t?u:t)&&("number"==n||"symbol"!=n&&ge.test(e))&&e>-1&&e%1==0&&e<t}function yi(e,t,n){if(!ts(n))return!1;var r=typeof t;return!!("number"==r?qa(n)&&vi(t,n.length):"string"==r&&t in n)&&ja(n[t],e)}function bi(e,t){if(Wa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!cs(e))||(J.test(e)||!Z.test(e)||null!=t&&e in Se(t))}function xi(e){var t=ii(e),n=Fn[t];if("function"!=typeof n||!(t in Hn.prototype))return!1;if(e===n)return!0;var r=oi(n);return!!r&&e===r[0]}(_n&&fi(new _n(new ArrayBuffer(1)))!=L||Cn&&fi(new Cn)!=$||wn&&fi(wn.resolve())!=w||Sn&&fi(new Sn)!=E||En&&fi(new En)!=P)&&(fi=function(e){var t=Cr(e),r=t==C?e.constructor:n,o=r?zi(r):"";if(o)switch(o){case Mn:return L;case Ln:return $;case In:return w;case Rn:return E;case On:return P}return t});var $i=Ie?Ja:vl;function _i(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Le)}function Ci(e){return e==e&&!ts(e)}function wi(e,t){return function(r){return null!=r&&(r[e]===t&&(t!==n||e in Se(r)))}}function Si(e,t,r){return t=gn(t===n?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=gn(n.length-t,0),a=xe(i);++o<i;)a[o]=n[t+o];o=-1;for(var s=xe(t+1);++o<t;)s[o]=n[o];return s[t]=r(a),Ct(e,this,s)}}function Ei(e,t){return t.length<2?e:$r(e,to(t,0,-1))}function ki(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ti=Ii(Jr),Pi=pt||function(e,t){return dt.setTimeout(e,t)},Mi=Ii(Qr);function Li(e,t,n){var r=t+"";return Mi(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return St(f,function(n){var r="_."+n[0];t&n[1]&&!Pt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(ae):[]}(r),n)))}function Ii(e){var t=0,r=0;return function(){var o=yn(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Ri(e,t){var r=-1,o=e.length,i=o-1;for(t=t===n?o:t;++r<t;){var a=Yr(r,i),s=e[a];e[a]=e[r],e[r]=s}return e.length=t,e}var Oi,Ai,Di,Ni=(Oi=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Q,function(e,n,r,o){t.push(r?o.replace(ce,"$1"):n||e)}),t},Ai=Aa(Oi,function(e){return 500===Di.size&&Di.clear(),e}),Di=Ai.cache,Ai);function Fi(e){if("string"==typeof e||cs(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function zi(e){if(null!=e){try{return Re.call(e)}catch(e2){}try{return e+""}catch(e2){}}return""}function Bi(e){if(e instanceof Hn)return e.clone();var t=new jn(e.__wrapped__,e.__chain__);return t.__actions__=To(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var ji=Gr(function(e,t){return Ga(e)?cr(e,mr(t,1,Ga,!0)):[]}),Hi=Gr(function(e,t){var r=Zi(t);return Ga(r)&&(r=n),Ga(e)?cr(e,mr(t,1,Ga,!0),si(r,2)):[]}),Vi=Gr(function(e,t){var r=Zi(t);return Ga(r)&&(r=n),Ga(e)?cr(e,mr(t,1,Ga,!0),n,r):[]});function Ui(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ms(n);return o<0&&(o=gn(r+o,0)),Ft(e,si(t,3),o)}function Wi(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var i=o-1;return r!==n&&(i=ms(r),i=r<0?gn(o+i,0):vn(i,o-1)),Ft(e,si(t,3),i,!0)}function Yi(e){return(null==e?0:e.length)?mr(e,1):[]}function qi(e){return e&&e.length?e[0]:n}var Gi=Gr(function(e){var t=Lt(e,go);return t.length&&t[0]===e[0]?kr(t):[]}),Ki=Gr(function(e){var t=Zi(e),r=Lt(e,go);return t===Zi(r)?t=n:r.pop(),r.length&&r[0]===e[0]?kr(r,si(t,2)):[]}),Xi=Gr(function(e){var t=Zi(e),r=Lt(e,go);return(t="function"==typeof t?t:n)&&r.pop(),r.length&&r[0]===e[0]?kr(r,n,t):[]});function Zi(e){var t=null==e?0:e.length;return t?e[t-1]:n}var Ji=Gr(Qi);function Qi(e,t){return e&&e.length&&t&&t.length?Ur(e,t):e}var ea=ti(function(e,t){var n=null==e?0:e.length,r=or(e,t);return Wr(e,Lt(t,function(e){return vi(e,n)?+e:e}).sort(So)),r});function ta(e){return null==e?e:$n.call(e)}var na=Gr(function(e){return lo(mr(e,1,Ga,!0))}),ra=Gr(function(e){var t=Zi(e);return Ga(t)&&(t=n),lo(mr(e,1,Ga,!0),si(t,2))}),oa=Gr(function(e){var t=Zi(e);return t="function"==typeof t?t:n,lo(mr(e,1,Ga,!0),n,t)});function ia(e){if(!e||!e.length)return[];var t=0;return e=Tt(e,function(e){if(Ga(e))return t=gn(e.length,t),!0}),qt(t,function(t){return Lt(e,Vt(t))})}function aa(e,t){if(!e||!e.length)return[];var r=ia(e);return null==t?r:Lt(r,function(e){return Ct(t,n,e)})}var sa=Gr(function(e,t){return Ga(e)?cr(e,t):[]}),la=Gr(function(e){return ho(Tt(e,Ga))}),ca=Gr(function(e){var t=Zi(e);return Ga(t)&&(t=n),ho(Tt(e,Ga),si(t,2))}),ua=Gr(function(e){var t=Zi(e);return t="function"==typeof t?t:n,ho(Tt(e,Ga),n,t)}),da=Gr(ia);var pa=Gr(function(e){var t=e.length,r=t>1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,aa(e,r)});function fa(e){var t=Fn(e);return t.__chain__=!0,t}function ha(e,t){return t(e)}var ma=ti(function(e){var t=e.length,r=t?e[0]:0,o=this.__wrapped__,i=function(t){return or(t,e)};return!(t>1||this.__actions__.length)&&o instanceof Hn&&vi(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:ha,args:[i],thisArg:n}),new jn(o,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(i)});var ga=Mo(function(e,t,n){Oe.call(e,n)?++e[n]:rr(e,n,1)});var va=No(Ui),ya=No(Wi);function ba(e,t){return(Wa(e)?St:ur)(e,si(t,3))}function xa(e,t){return(Wa(e)?Et:dr)(e,si(t,3))}var $a=Mo(function(e,t,n){Oe.call(e,n)?e[n].push(t):rr(e,n,[t])});var _a=Gr(function(e,t,n){var r=-1,o="function"==typeof t,i=qa(e)?xe(e.length):[];return ur(e,function(e){i[++r]=o?Ct(t,e,n):Tr(e,t,n)}),i}),Ca=Mo(function(e,t,n){rr(e,n,t)});function wa(e,t){return(Wa(e)?Lt:Nr)(e,si(t,3))}var Sa=Mo(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});var Ea=Gr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&yi(e,t[0],t[1])?t=[]:n>2&&yi(t[0],t[1],t[2])&&(t=[t[0]]),Hr(e,mr(t,1),[])}),ka=ut||function(){return dt.Date.now()};function Ta(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Xo(e,s,n,n,n,n,t)}function Pa(e,t){var o;if("function"!=typeof t)throw new Te(r);return e=ms(e),function(){return--e>0&&(o=t.apply(this,arguments)),e<=1&&(t=n),o}}var Ma=Gr(function(e,t,n){var r=1;if(n.length){var o=sn(n,ai(Ma));r|=a}return Xo(e,r,t,n,o)}),La=Gr(function(e,t,n){var r=3;if(n.length){var o=sn(n,ai(La));r|=a}return Xo(t,r,e,n,o)});function Ia(e,t,o){var i,a,s,l,c,u,d=0,p=!1,f=!1,h=!0;if("function"!=typeof e)throw new Te(r);function m(t){var r=i,o=a;return i=a=n,d=t,l=e.apply(o,r)}function g(e){var r=e-u;return u===n||r>=t||r<0||f&&e-d>=s}function v(){var e=ka();if(g(e))return y(e);c=Pi(v,function(e){var n=t-(e-u);return f?vn(n,s-(e-d)):n}(e))}function y(e){return c=n,h&&i?m(e):(i=a=n,l)}function b(){var e=ka(),r=g(e);if(i=arguments,a=this,u=e,r){if(c===n)return function(e){return d=e,c=Pi(v,t),p?m(e):l}(u);if(f)return $o(c),c=Pi(v,t),m(u)}return c===n&&(c=Pi(v,t)),l}return t=vs(t)||0,ts(o)&&(p=!!o.leading,s=(f="maxWait"in o)?gn(vs(o.maxWait)||0,t):s,h="trailing"in o?!!o.trailing:h),b.cancel=function(){c!==n&&$o(c),d=0,i=u=a=c=n},b.flush=function(){return c===n?l:y(ka())},b}var Ra=Gr(function(e,t){return lr(e,1,t)}),Oa=Gr(function(e,t,n){return lr(e,vs(t)||0,n)});function Aa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Te(r);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Aa.Cache||Wn),n}function Da(e){if("function"!=typeof e)throw new Te(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Aa.Cache=Wn;var Na=bo(function(e,t){var n=(t=1==t.length&&Wa(t[0])?Lt(t[0],Kt(si())):Lt(mr(t,1),Kt(si()))).length;return Gr(function(r){for(var o=-1,i=vn(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return Ct(e,this,r)})}),Fa=Gr(function(e,t){var r=sn(t,ai(Fa));return Xo(e,a,n,t,r)}),za=Gr(function(e,t){var r=sn(t,ai(za));return Xo(e,64,n,t,r)}),Ba=ti(function(e,t){return Xo(e,l,n,n,n,t)});function ja(e,t){return e===t||e!=e&&t!=t}var Ha=Wo(wr),Va=Wo(function(e,t){return e>=t}),Ua=Pr(function(){return arguments}())?Pr:function(e){return ns(e)&&Oe.call(e,"callee")&&!qe.call(e,"callee")},Wa=xe.isArray,Ya=vt?Kt(vt):function(e){return ns(e)&&Cr(e)==M};function qa(e){return null!=e&&es(e.length)&&!Ja(e)}function Ga(e){return ns(e)&&qa(e)}var Ka=Dt||vl,Xa=yt?Kt(yt):function(e){return ns(e)&&Cr(e)==v};function Za(e){if(!ns(e))return!1;var t=Cr(e);return t==y||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!is(e)}function Ja(e){if(!ts(e))return!1;var t=Cr(e);return t==b||t==x||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qa(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ns(e){return null!=e&&"object"==typeof e}var rs=bt?Kt(bt):function(e){return ns(e)&&fi(e)==$};function os(e){return"number"==typeof e||ns(e)&&Cr(e)==_}function is(e){if(!ns(e)||Cr(e)!=C)return!1;var t=We(e);if(null===t)return!0;var n=Oe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Re.call(n)==Fe}var as=xt?Kt(xt):function(e){return ns(e)&&Cr(e)==S};var ss=$t?Kt($t):function(e){return ns(e)&&fi(e)==E};function ls(e){return"string"==typeof e||!Wa(e)&&ns(e)&&Cr(e)==k}function cs(e){return"symbol"==typeof e||ns(e)&&Cr(e)==T}var us=_t?Kt(_t):function(e){return ns(e)&&es(e.length)&&!!ot[Cr(e)]};var ds=Wo(Dr),ps=Wo(function(e,t){return e<=t});function fs(e){if(!e)return[];if(qa(e))return ls(e)?un(e):To(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=fi(e);return(t==$?on:t==E?ln:js)(e)}function hs(e){return e?(e=vs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=hs(e),n=t%1;return t==t?n?t-n:t:0}function gs(e){return e?ir(ms(e),0,p):0}function vs(e){if("number"==typeof e)return e;if(cs(e))return d;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Gt(e);var n=fe.test(e);return n||me.test(e)?lt(e.slice(2),n?2:8):pe.test(e)?d:+e}function ys(e){return Po(e,Rs(e))}function bs(e){return null==e?"":so(e)}var xs=Lo(function(e,t){if(_i(t)||qa(t))Po(t,Is(t),e);else for(var n in t)Oe.call(t,n)&&Qn(e,n,t[n])}),$s=Lo(function(e,t){Po(t,Rs(t),e)}),_s=Lo(function(e,t,n,r){Po(t,Rs(t),e,r)}),Cs=Lo(function(e,t,n,r){Po(t,Is(t),e,r)}),ws=ti(or);var Ss=Gr(function(e,t){e=Se(e);var r=-1,o=t.length,i=o>2?t[2]:n;for(i&&yi(t[0],t[1],i)&&(o=1);++r<o;)for(var a=t[r],s=Rs(a),l=-1,c=s.length;++l<c;){var u=s[l],d=e[u];(d===n||ja(d,Le[u])&&!Oe.call(e,u))&&(e[u]=a[u])}return e}),Es=Gr(function(e){return e.push(n,Jo),Ct(As,n,e)});function ks(e,t,r){var o=null==e?n:$r(e,t);return o===n?r:o}function Ts(e,t){return null!=e&&hi(e,t,Er)}var Ps=Bo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=n},tl(ol)),Ms=Bo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),Oe.call(e,t)?e[t].push(n):e[t]=[n]},si),Ls=Gr(Tr);function Is(e){return qa(e)?Gn(e):Or(e)}function Rs(e){return qa(e)?Gn(e,!0):Ar(e)}var Os=Lo(function(e,t,n){Br(e,t,n)}),As=Lo(function(e,t,n,r){Br(e,t,n,r)}),Ds=ti(function(e,t){var n={};if(null==e)return n;var r=!1;t=Lt(t,function(t){return t=yo(t,e),r||(r=t.length>1),t}),Po(e,ri(e),n),r&&(n=ar(n,7,Qo));for(var o=t.length;o--;)co(n,t[o]);return n});var Ns=ti(function(e,t){return null==e?{}:function(e,t){return Vr(e,t,function(t,n){return Ts(e,n)})}(e,t)});function Fs(e,t){if(null==e)return{};var n=Lt(ri(e),function(e){return[e]});return t=si(t),Vr(e,n,function(e,n){return t(e,n[0])})}var zs=Ko(Is),Bs=Ko(Rs);function js(e){return null==e?[]:Xt(e,Is(e))}var Hs=Ao(function(e,t,n){return t=t.toLowerCase(),e+(n?Vs(t):t)});function Vs(e){return Zs(bs(e).toLowerCase())}function Us(e){return(e=bs(e))&&e.replace(ve,en).replace(Ze,"")}var Ws=Ao(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ys=Ao(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),qs=Oo("toLowerCase");var Gs=Ao(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});var Ks=Ao(function(e,t,n){return e+(n?" ":"")+Zs(t)});var Xs=Ao(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Zs=Oo("toUpperCase");function Js(e,t,r){return e=bs(e),(t=r?n:t)===n?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Qs=Gr(function(e,t){try{return Ct(e,n,t)}catch(e2){return Za(e2)?e2:new _e(e2)}}),el=ti(function(e,t){return St(t,function(t){t=Fi(t),rr(e,t,Ma(e[t],e))}),e});function tl(e){return function(){return e}}var nl=Fo(),rl=Fo(!0);function ol(e){return e}function il(e){return Rr("function"==typeof e?e:ar(e,1))}var al=Gr(function(e,t){return function(n){return Tr(n,e,t)}}),sl=Gr(function(e,t){return function(n){return Tr(e,n,t)}});function ll(e,t,n){var r=Is(t),o=xr(t,r);null!=n||ts(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=xr(t,Is(t)));var i=!(ts(n)&&"chain"in n&&!n.chain),a=Ja(e);return St(o,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__);return(n.__actions__=To(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,It([this.value()],arguments))})}),e}function cl(){}var ul=Ho(Lt),dl=Ho(kt),pl=Ho(At);function fl(e){return bi(e)?Vt(Fi(e)):function(e){return function(t){return $r(t,e)}}(e)}var hl=Uo(),ml=Uo(!0);function gl(){return[]}function vl(){return!1}var yl=jo(function(e,t){return e+t},0),bl=qo("ceil"),xl=jo(function(e,t){return e/t},1),$l=qo("floor");var _l,Cl=jo(function(e,t){return e*t},1),wl=qo("round"),Sl=jo(function(e,t){return e-t},0);return Fn.after=function(e,t){if("function"!=typeof t)throw new Te(r);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},Fn.ary=Ta,Fn.assign=xs,Fn.assignIn=$s,Fn.assignInWith=_s,Fn.assignWith=Cs,Fn.at=ws,Fn.before=Pa,Fn.bind=Ma,Fn.bindAll=el,Fn.bindKey=La,Fn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Wa(e)?e:[e]},Fn.chain=fa,Fn.chunk=function(e,t,r){t=(r?yi(e,t,r):t===n)?1:gn(ms(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,s=xe(ft(o/t));i<o;)s[a++]=to(e,i,i+=t);return s},Fn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Fn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=xe(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return It(Wa(n)?To(n):[n],mr(t,1))},Fn.cond=function(e){var t=null==e?0:e.length,n=si();return e=t?Lt(e,function(e){if("function"!=typeof e[1])throw new Te(r);return[n(e[0]),e[1]]}):[],Gr(function(n){for(var r=-1;++r<t;){var o=e[r];if(Ct(o[0],this,n))return Ct(o[1],this,n)}})},Fn.conforms=function(e){return function(e){var t=Is(e);return function(n){return sr(n,e,t)}}(ar(e,1))},Fn.constant=tl,Fn.countBy=ga,Fn.create=function(e,t){var n=zn(e);return null==t?n:nr(n,t)},Fn.curry=function e(t,r,o){var i=Xo(t,8,n,n,n,n,n,r=o?n:r);return i.placeholder=e.placeholder,i},Fn.curryRight=function e(t,r,o){var i=Xo(t,16,n,n,n,n,n,r=o?n:r);return i.placeholder=e.placeholder,i},Fn.debounce=Ia,Fn.defaults=Ss,Fn.defaultsDeep=Es,Fn.defer=Ra,Fn.delay=Oa,Fn.difference=ji,Fn.differenceBy=Hi,Fn.differenceWith=Vi,Fn.drop=function(e,t,r){var o=null==e?0:e.length;return o?to(e,(t=r||t===n?1:ms(t))<0?0:t,o):[]},Fn.dropRight=function(e,t,r){var o=null==e?0:e.length;return o?to(e,0,(t=o-(t=r||t===n?1:ms(t)))<0?0:t):[]},Fn.dropRightWhile=function(e,t){return e&&e.length?po(e,si(t,3),!0,!0):[]},Fn.dropWhile=function(e,t){return e&&e.length?po(e,si(t,3),!0):[]},Fn.fill=function(e,t,r,o){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&yi(e,t,r)&&(r=0,o=i),function(e,t,r,o){var i=e.length;for((r=ms(r))<0&&(r=-r>i?0:i+r),(o=o===n||o>i?i:ms(o))<0&&(o+=i),o=r>o?0:gs(o);r<o;)e[r++]=t;return e}(e,t,r,o)):[]},Fn.filter=function(e,t){return(Wa(e)?Tt:hr)(e,si(t,3))},Fn.flatMap=function(e,t){return mr(wa(e,t),1)},Fn.flatMapDeep=function(e,t){return mr(wa(e,t),c)},Fn.flatMapDepth=function(e,t,r){return r=r===n?1:ms(r),mr(wa(e,t),r)},Fn.flatten=Yi,Fn.flattenDeep=function(e){return(null==e?0:e.length)?mr(e,c):[]},Fn.flattenDepth=function(e,t){return(null==e?0:e.length)?mr(e,t=t===n?1:ms(t)):[]},Fn.flip=function(e){return Xo(e,512)},Fn.flow=nl,Fn.flowRight=rl,Fn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r},Fn.functions=function(e){return null==e?[]:xr(e,Is(e))},Fn.functionsIn=function(e){return null==e?[]:xr(e,Rs(e))},Fn.groupBy=$a,Fn.initial=function(e){return(null==e?0:e.length)?to(e,0,-1):[]},Fn.intersection=Gi,Fn.intersectionBy=Ki,Fn.intersectionWith=Xi,Fn.invert=Ps,Fn.invertBy=Ms,Fn.invokeMap=_a,Fn.iteratee=il,Fn.keyBy=Ca,Fn.keys=Is,Fn.keysIn=Rs,Fn.map=wa,Fn.mapKeys=function(e,t){var n={};return t=si(t,3),yr(e,function(e,r,o){rr(n,t(e,r,o),e)}),n},Fn.mapValues=function(e,t){var n={};return t=si(t,3),yr(e,function(e,r,o){rr(n,r,t(e,r,o))}),n},Fn.matches=function(e){return Fr(ar(e,1))},Fn.matchesProperty=function(e,t){return zr(e,ar(t,1))},Fn.memoize=Aa,Fn.merge=Os,Fn.mergeWith=As,Fn.method=al,Fn.methodOf=sl,Fn.mixin=ll,Fn.negate=Da,Fn.nthArg=function(e){return e=ms(e),Gr(function(t){return jr(t,e)})},Fn.omit=Ds,Fn.omitBy=function(e,t){return Fs(e,Da(si(t)))},Fn.once=function(e){return Pa(2,e)},Fn.orderBy=function(e,t,r,o){return null==e?[]:(Wa(t)||(t=null==t?[]:[t]),Wa(r=o?n:r)||(r=null==r?[]:[r]),Hr(e,t,r))},Fn.over=ul,Fn.overArgs=Na,Fn.overEvery=dl,Fn.overSome=pl,Fn.partial=Fa,Fn.partialRight=za,Fn.partition=Sa,Fn.pick=Ns,Fn.pickBy=Fs,Fn.property=fl,Fn.propertyOf=function(e){return function(t){return null==e?n:$r(e,t)}},Fn.pull=Ji,Fn.pullAll=Qi,Fn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ur(e,t,si(n,2)):e},Fn.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Ur(e,t,n,r):e},Fn.pullAt=ea,Fn.range=hl,Fn.rangeRight=ml,Fn.rearg=Ba,Fn.reject=function(e,t){return(Wa(e)?Tt:hr)(e,Da(si(t,3)))},Fn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=si(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return Wr(e,o),n},Fn.rest=function(e,t){if("function"!=typeof e)throw new Te(r);return Gr(e,t=t===n?t:ms(t))},Fn.reverse=ta,Fn.sampleSize=function(e,t,r){return t=(r?yi(e,t,r):t===n)?1:ms(t),(Wa(e)?Xn:Xr)(e,t)},Fn.set=function(e,t,n){return null==e?e:Zr(e,t,n)},Fn.setWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:Zr(e,t,r,o)},Fn.shuffle=function(e){return(Wa(e)?Zn:eo)(e)},Fn.slice=function(e,t,r){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&yi(e,t,r)?(t=0,r=o):(t=null==t?0:ms(t),r=r===n?o:ms(r)),to(e,t,r)):[]},Fn.sortBy=Ea,Fn.sortedUniq=function(e){return e&&e.length?io(e):[]},Fn.sortedUniqBy=function(e,t){return e&&e.length?io(e,si(t,2)):[]},Fn.split=function(e,t,r){return r&&"number"!=typeof r&&yi(e,t,r)&&(t=r=n),(r=r===n?p:r>>>0)?(e=bs(e))&&("string"==typeof t||null!=t&&!as(t))&&!(t=so(t))&&rn(e)?xo(un(e),0,r):e.split(t,r):[]},Fn.spread=function(e,t){if("function"!=typeof e)throw new Te(r);return t=null==t?0:gn(ms(t),0),Gr(function(n){var r=n[t],o=xo(n,0,t);return r&&It(o,r),Ct(e,this,o)})},Fn.tail=function(e){var t=null==e?0:e.length;return t?to(e,1,t):[]},Fn.take=function(e,t,r){return e&&e.length?to(e,0,(t=r||t===n?1:ms(t))<0?0:t):[]},Fn.takeRight=function(e,t,r){var o=null==e?0:e.length;return o?to(e,(t=o-(t=r||t===n?1:ms(t)))<0?0:t,o):[]},Fn.takeRightWhile=function(e,t){return e&&e.length?po(e,si(t,3),!1,!0):[]},Fn.takeWhile=function(e,t){return e&&e.length?po(e,si(t,3)):[]},Fn.tap=function(e,t){return t(e),e},Fn.throttle=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new Te(r);return ts(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),Ia(e,t,{leading:o,maxWait:t,trailing:i})},Fn.thru=ha,Fn.toArray=fs,Fn.toPairs=zs,Fn.toPairsIn=Bs,Fn.toPath=function(e){return Wa(e)?Lt(e,Fi):cs(e)?[e]:To(Ni(bs(e)))},Fn.toPlainObject=ys,Fn.transform=function(e,t,n){var r=Wa(e),o=r||Ka(e)||us(e);if(t=si(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:ts(e)&&Ja(i)?zn(We(e)):{}}return(o?St:yr)(e,function(e,r,o){return t(n,e,r,o)}),n},Fn.unary=function(e){return Ta(e,1)},Fn.union=na,Fn.unionBy=ra,Fn.unionWith=oa,Fn.uniq=function(e){return e&&e.length?lo(e):[]},Fn.uniqBy=function(e,t){return e&&e.length?lo(e,si(t,2)):[]},Fn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?lo(e,n,t):[]},Fn.unset=function(e,t){return null==e||co(e,t)},Fn.unzip=ia,Fn.unzipWith=aa,Fn.update=function(e,t,n){return null==e?e:uo(e,t,vo(n))},Fn.updateWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:uo(e,t,vo(r),o)},Fn.values=js,Fn.valuesIn=function(e){return null==e?[]:Xt(e,Rs(e))},Fn.without=sa,Fn.words=Js,Fn.wrap=function(e,t){return Fa(vo(t),e)},Fn.xor=la,Fn.xorBy=ca,Fn.xorWith=ua,Fn.zip=da,Fn.zipObject=function(e,t){return mo(e||[],t||[],Qn)},Fn.zipObjectDeep=function(e,t){return mo(e||[],t||[],Zr)},Fn.zipWith=pa,Fn.entries=zs,Fn.entriesIn=Bs,Fn.extend=$s,Fn.extendWith=_s,ll(Fn,Fn),Fn.add=yl,Fn.attempt=Qs,Fn.camelCase=Hs,Fn.capitalize=Vs,Fn.ceil=bl,Fn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=vs(r))==r?r:0),t!==n&&(t=(t=vs(t))==t?t:0),ir(vs(e),t,r)},Fn.clone=function(e){return ar(e,4)},Fn.cloneDeep=function(e){return ar(e,5)},Fn.cloneDeepWith=function(e,t){return ar(e,5,t="function"==typeof t?t:n)},Fn.cloneWith=function(e,t){return ar(e,4,t="function"==typeof t?t:n)},Fn.conformsTo=function(e,t){return null==t||sr(e,t,Is(t))},Fn.deburr=Us,Fn.defaultTo=function(e,t){return null==e||e!=e?t:e},Fn.divide=xl,Fn.endsWith=function(e,t,r){e=bs(e),t=so(t);var o=e.length,i=r=r===n?o:ir(ms(r),0,o);return(r-=t.length)>=0&&e.slice(r,i)==t},Fn.eq=ja,Fn.escape=function(e){return(e=bs(e))&&q.test(e)?e.replace(W,tn):e},Fn.escapeRegExp=function(e){return(e=bs(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Fn.every=function(e,t,r){var o=Wa(e)?kt:pr;return r&&yi(e,t,r)&&(t=n),o(e,si(t,3))},Fn.find=va,Fn.findIndex=Ui,Fn.findKey=function(e,t){return Nt(e,si(t,3),yr)},Fn.findLast=ya,Fn.findLastIndex=Wi,Fn.findLastKey=function(e,t){return Nt(e,si(t,3),br)},Fn.floor=$l,Fn.forEach=ba,Fn.forEachRight=xa,Fn.forIn=function(e,t){return null==e?e:gr(e,si(t,3),Rs)},Fn.forInRight=function(e,t){return null==e?e:vr(e,si(t,3),Rs)},Fn.forOwn=function(e,t){return e&&yr(e,si(t,3))},Fn.forOwnRight=function(e,t){return e&&br(e,si(t,3))},Fn.get=ks,Fn.gt=Ha,Fn.gte=Va,Fn.has=function(e,t){return null!=e&&hi(e,t,Sr)},Fn.hasIn=Ts,Fn.head=qi,Fn.identity=ol,Fn.includes=function(e,t,n,r){e=qa(e)?e:js(e),n=n&&!r?ms(n):0;var o=e.length;return n<0&&(n=gn(o+n,0)),ls(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&zt(e,t,n)>-1},Fn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ms(n);return o<0&&(o=gn(r+o,0)),zt(e,t,o)},Fn.inRange=function(e,t,r){return t=hs(t),r===n?(r=t,t=0):r=hs(r),function(e,t,n){return e>=vn(t,n)&&e<gn(t,n)}(e=vs(e),t,r)},Fn.invoke=Ls,Fn.isArguments=Ua,Fn.isArray=Wa,Fn.isArrayBuffer=Ya,Fn.isArrayLike=qa,Fn.isArrayLikeObject=Ga,Fn.isBoolean=function(e){return!0===e||!1===e||ns(e)&&Cr(e)==g},Fn.isBuffer=Ka,Fn.isDate=Xa,Fn.isElement=function(e){return ns(e)&&1===e.nodeType&&!is(e)},Fn.isEmpty=function(e){if(null==e)return!0;if(qa(e)&&(Wa(e)||"string"==typeof e||"function"==typeof e.splice||Ka(e)||us(e)||Ua(e)))return!e.length;var t=fi(e);if(t==$||t==E)return!e.size;if(_i(e))return!Or(e).length;for(var n in e)if(Oe.call(e,n))return!1;return!0},Fn.isEqual=function(e,t){return Mr(e,t)},Fn.isEqualWith=function(e,t,r){var o=(r="function"==typeof r?r:n)?r(e,t):n;return o===n?Mr(e,t,n,r):!!o},Fn.isError=Za,Fn.isFinite=function(e){return"number"==typeof e&&Ut(e)},Fn.isFunction=Ja,Fn.isInteger=Qa,Fn.isLength=es,Fn.isMap=rs,Fn.isMatch=function(e,t){return e===t||Lr(e,t,ci(t))},Fn.isMatchWith=function(e,t,r){return r="function"==typeof r?r:n,Lr(e,t,ci(t),r)},Fn.isNaN=function(e){return os(e)&&e!=+e},Fn.isNative=function(e){if($i(e))throw new _e("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ir(e)},Fn.isNil=function(e){return null==e},Fn.isNull=function(e){return null===e},Fn.isNumber=os,Fn.isObject=ts,Fn.isObjectLike=ns,Fn.isPlainObject=is,Fn.isRegExp=as,Fn.isSafeInteger=function(e){return Qa(e)&&e>=-9007199254740991&&e<=u},Fn.isSet=ss,Fn.isString=ls,Fn.isSymbol=cs,Fn.isTypedArray=us,Fn.isUndefined=function(e){return e===n},Fn.isWeakMap=function(e){return ns(e)&&fi(e)==P},Fn.isWeakSet=function(e){return ns(e)&&"[object WeakSet]"==Cr(e)},Fn.join=function(e,t){return null==e?"":hn.call(e,t)},Fn.kebabCase=Ws,Fn.last=Zi,Fn.lastIndexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var i=o;return r!==n&&(i=(i=ms(r))<0?gn(o+i,0):vn(i,o-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Ft(e,jt,i,!0)},Fn.lowerCase=Ys,Fn.lowerFirst=qs,Fn.lt=ds,Fn.lte=ps,Fn.max=function(e){return e&&e.length?fr(e,ol,wr):n},Fn.maxBy=function(e,t){return e&&e.length?fr(e,si(t,2),wr):n},Fn.mean=function(e){return Ht(e,ol)},Fn.meanBy=function(e,t){return Ht(e,si(t,2))},Fn.min=function(e){return e&&e.length?fr(e,ol,Dr):n},Fn.minBy=function(e,t){return e&&e.length?fr(e,si(t,2),Dr):n},Fn.stubArray=gl,Fn.stubFalse=vl,Fn.stubObject=function(){return{}},Fn.stubString=function(){return""},Fn.stubTrue=function(){return!0},Fn.multiply=Cl,Fn.nth=function(e,t){return e&&e.length?jr(e,ms(t)):n},Fn.noConflict=function(){return dt._===this&&(dt._=ze),this},Fn.noop=cl,Fn.now=ka,Fn.pad=function(e,t,n){e=bs(e);var r=(t=ms(t))?cn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Vo(mt(o),n)+e+Vo(ft(o),n)},Fn.padEnd=function(e,t,n){e=bs(e);var r=(t=ms(t))?cn(e):0;return t&&r<t?e+Vo(t-r,n):e},Fn.padStart=function(e,t,n){e=bs(e);var r=(t=ms(t))?cn(e):0;return t&&r<t?Vo(t-r,n)+e:e},Fn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),bn(bs(e).replace(ne,""),t||0)},Fn.random=function(e,t,r){if(r&&"boolean"!=typeof r&&yi(e,t,r)&&(t=r=n),r===n&&("boolean"==typeof t?(r=t,t=n):"boolean"==typeof e&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=hs(e),t===n?(t=e,e=0):t=hs(t)),e>t){var o=e;e=t,t=o}if(r||e%1||t%1){var i=xn();return vn(e+i*(t-e+st("1e-"+((i+"").length-1))),t)}return Yr(e,t)},Fn.reduce=function(e,t,n){var r=Wa(e)?Rt:Wt,o=arguments.length<3;return r(e,si(t,4),n,o,ur)},Fn.reduceRight=function(e,t,n){var r=Wa(e)?Ot:Wt,o=arguments.length<3;return r(e,si(t,4),n,o,dr)},Fn.repeat=function(e,t,r){return t=(r?yi(e,t,r):t===n)?1:ms(t),qr(bs(e),t)},Fn.replace=function(){var e=arguments,t=bs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Fn.result=function(e,t,r){var o=-1,i=(t=yo(t,e)).length;for(i||(i=1,e=n);++o<i;){var a=null==e?n:e[Fi(t[o])];a===n&&(o=i,a=r),e=Ja(a)?a.call(e):a}return e},Fn.round=wl,Fn.runInContext=e,Fn.sample=function(e){return(Wa(e)?Kn:Kr)(e)},Fn.size=function(e){if(null==e)return 0;if(qa(e))return ls(e)?cn(e):e.length;var t=fi(e);return t==$||t==E?e.size:Or(e).length},Fn.snakeCase=Gs,Fn.some=function(e,t,r){var o=Wa(e)?At:no;return r&&yi(e,t,r)&&(t=n),o(e,si(t,3))},Fn.sortedIndex=function(e,t){return ro(e,t)},Fn.sortedIndexBy=function(e,t,n){return oo(e,t,si(n,2))},Fn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ro(e,t);if(r<n&&ja(e[r],t))return r}return-1},Fn.sortedLastIndex=function(e,t){return ro(e,t,!0)},Fn.sortedLastIndexBy=function(e,t,n){return oo(e,t,si(n,2),!0)},Fn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=ro(e,t,!0)-1;if(ja(e[n],t))return n}return-1},Fn.startCase=Ks,Fn.startsWith=function(e,t,n){return e=bs(e),n=null==n?0:ir(ms(n),0,e.length),t=so(t),e.slice(n,n+t.length)==t},Fn.subtract=Sl,Fn.sum=function(e){return e&&e.length?Yt(e,ol):0},Fn.sumBy=function(e,t){return e&&e.length?Yt(e,si(t,2)):0},Fn.template=function(e,t,r){var o=Fn.templateSettings;r&&yi(e,t,r)&&(t=n),e=bs(e),t=_s({},t,o,Zo);var i,a,s=_s({},t.imports,o.imports,Zo),l=Is(s),c=Xt(s,l),u=0,d=t.interpolate||ye,p="__p += '",f=Ee((t.escape||ye).source+"|"+d.source+"|"+(d===X?ue:ye).source+"|"+(t.evaluate||ye).source+"|$","g"),h="//# sourceURL="+(Oe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";e.replace(f,function(t,n,r,o,s,l){return r||(r=o),p+=e.slice(u,l).replace(be,nn),n&&(i=!0,p+="' +\n__e("+n+") +\n'"),s&&(a=!0,p+="';\n"+s+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t}),p+="';\n";var m=Oe.call(t,"variable")&&t.variable;if(m){if(le.test(m))throw new _e("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(a?p.replace(j,""):p).replace(H,"$1").replace(V,"$1;"),p="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=Qs(function(){return Ce(l,h+"return "+p).apply(n,c)});if(g.source=p,Za(g))throw g;return g},Fn.times=function(e,t){if((e=ms(e))<1||e>u)return[];var n=p,r=vn(e,p);t=si(t),e-=p;for(var o=qt(r,t);++n<e;)t(n);return o},Fn.toFinite=hs,Fn.toInteger=ms,Fn.toLength=gs,Fn.toLower=function(e){return bs(e).toLowerCase()},Fn.toNumber=vs,Fn.toSafeInteger=function(e){return e?ir(ms(e),-9007199254740991,u):0===e?e:0},Fn.toString=bs,Fn.toUpper=function(e){return bs(e).toUpperCase()},Fn.trim=function(e,t,r){if((e=bs(e))&&(r||t===n))return Gt(e);if(!e||!(t=so(t)))return e;var o=un(e),i=un(t);return xo(o,Jt(o,i),Qt(o,i)+1).join("")},Fn.trimEnd=function(e,t,r){if((e=bs(e))&&(r||t===n))return e.slice(0,dn(e)+1);if(!e||!(t=so(t)))return e;var o=un(e);return xo(o,0,Qt(o,un(t))+1).join("")},Fn.trimStart=function(e,t,r){if((e=bs(e))&&(r||t===n))return e.replace(ne,"");if(!e||!(t=so(t)))return e;var o=un(e);return xo(o,Jt(o,un(t))).join("")},Fn.truncate=function(e,t){var r=30,o="...";if(ts(t)){var i="separator"in t?t.separator:i;r="length"in t?ms(t.length):r,o="omission"in t?so(t.omission):o}var a=(e=bs(e)).length;if(rn(e)){var s=un(e);a=s.length}if(r>=a)return e;var l=r-cn(o);if(l<1)return o;var c=s?xo(s,0,l).join(""):e.slice(0,l);if(i===n)return c+o;if(s&&(l+=c.length-l),as(i)){if(e.slice(l).search(i)){var u,d=c;for(i.global||(i=Ee(i.source,bs(de.exec(i))+"g")),i.lastIndex=0;u=i.exec(d);)var p=u.index;c=c.slice(0,p===n?l:p)}}else if(e.indexOf(so(i),l)!=l){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+o},Fn.unescape=function(e){return(e=bs(e))&&Y.test(e)?e.replace(U,pn):e},Fn.uniqueId=function(e){var t=++Ae;return bs(e)+t},Fn.upperCase=Xs,Fn.upperFirst=Zs,Fn.each=ba,Fn.eachRight=xa,Fn.first=qi,ll(Fn,(_l={},yr(Fn,function(e,t){Oe.call(Fn.prototype,t)||(_l[t]=e)}),_l),{chain:!1}),Fn.VERSION="4.17.23",St(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Fn[e].placeholder=Fn}),St(["drop","take"],function(e,t){Hn.prototype[e]=function(r){r=r===n?1:gn(ms(r),0);var o=this.__filtered__&&!t?new Hn(this):this.clone();return o.__filtered__?o.__takeCount__=vn(r,o.__takeCount__):o.__views__.push({size:vn(r,p),type:e+(o.__dir__<0?"Right":"")}),o},Hn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),St(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Hn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:si(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),St(["head","last"],function(e,t){var n="take"+(t?"Right":"");Hn.prototype[e]=function(){return this[n](1).value()[0]}}),St(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Hn.prototype[e]=function(){return this.__filtered__?new Hn(this):this[n](1)}}),Hn.prototype.compact=function(){return this.filter(ol)},Hn.prototype.find=function(e){return this.filter(e).head()},Hn.prototype.findLast=function(e){return this.reverse().find(e)},Hn.prototype.invokeMap=Gr(function(e,t){return"function"==typeof e?new Hn(this):this.map(function(n){return Tr(n,e,t)})}),Hn.prototype.reject=function(e){return this.filter(Da(si(e)))},Hn.prototype.slice=function(e,t){e=ms(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Hn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ms(t))<0?r.dropRight(-t):r.take(t-e)),r)},Hn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hn.prototype.toArray=function(){return this.take(p)},yr(Hn.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),i=Fn[o?"take"+("last"==t?"Right":""):t],a=o||/^find/.test(t);i&&(Fn.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,l=t instanceof Hn,c=s[0],u=l||Wa(t),d=function(e){var t=i.apply(Fn,It([e],s));return o&&p?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var p=this.__chain__,f=!!this.__actions__.length,h=a&&!p,m=l&&!f;if(!a&&u){t=m?t:new Hn(this);var g=e.apply(t,s);return g.__actions__.push({func:ha,args:[d],thisArg:n}),new jn(g,p)}return h&&m?e.apply(this,s):(g=this.thru(d),h?o?g.value()[0]:g.value():g)})}),St(["pop","push","shift","sort","splice","unshift"],function(e){var t=Pe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Fn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Wa(o)?o:[],e)}return this[n](function(n){return t.apply(Wa(n)?n:[],e)})}}),yr(Hn.prototype,function(e,t){var n=Fn[t];if(n){var r=n.name+"";Oe.call(Pn,r)||(Pn[r]=[]),Pn[r].push({name:t,func:n})}}),Pn[zo(n,2).name]=[{name:"wrapper",func:n}],Hn.prototype.clone=function(){var e=new Hn(this.__wrapped__);return e.__actions__=To(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=To(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=To(this.__views__),e},Hn.prototype.reverse=function(){if(this.__filtered__){var e=new Hn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Wa(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=vn(t,e+a);break;case"takeRight":e=gn(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,s=i.end,l=s-a,c=r?s:a-1,u=this.__iteratees__,d=u.length,p=0,f=vn(l,this.__takeCount__);if(!n||!r&&o==l&&f==l)return fo(e,this.__actions__);var h=[];e:for(;l--&&p<f;){for(var m=-1,g=e[c+=t];++m<d;){var v=u[m],y=v.iteratee,b=v.type,x=y(g);if(2==b)g=x;else if(!x){if(1==b)continue e;break e}}h[p++]=g}return h},Fn.prototype.at=ma,Fn.prototype.chain=function(){return fa(this)},Fn.prototype.commit=function(){return new jn(this.value(),this.__chain__)},Fn.prototype.next=function(){this.__values__===n&&(this.__values__=fs(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Fn.prototype.plant=function(e){for(var t,r=this;r instanceof Bn;){var o=Bi(r);o.__index__=0,o.__values__=n,t?i.__wrapped__=o:t=o;var i=o;r=r.__wrapped__}return i.__wrapped__=e,t},Fn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hn){var t=e;return this.__actions__.length&&(t=new Hn(this)),(t=t.reverse()).__actions__.push({func:ha,args:[ta],thisArg:n}),new jn(t,this.__chain__)}return this.thru(ta)},Fn.prototype.toJSON=Fn.prototype.valueOf=Fn.prototype.value=function(){return fo(this.__wrapped__,this.__actions__)},Fn.prototype.first=Fn.prototype.head,Je&&(Fn.prototype[Je]=function(){return this}),Fn}();ft?((ft.exports=fn)._=fn,pt._=fn):dt._=fn}).call(commonjsGlobal)}(lodash,lodash.exports);var lodashExports=lodash.exports;const LOCALE$1={Notifications:"Notifications",All:"All",Signals:"Signals",Opened:"Opened",Closed:"Closed",Scheduled:"Scheduled",Cancelled:"Cancelled","Partial profit":"Partial profit","Profit fixed":"Profit fixed","Partial loss":"Partial loss","Loss fixed":"Loss fixed","Breakeven available":"Breakeven available","Breakeven set":"Breakeven set","Trailing stop":"Trailing stop","Trailing take":"Trailing take",Rejected:"Rejected",Error:"Error",Validation:"Validation",Critical:"Critical",Unknown:"Unknown","Copied!":"Copied successfully!","Saved!":"Saved!",Empty:"",Copy:"Copy",Paste:"Paste",Prompt:"Prompt","Refresh manually":"Refresh","Create new row":"Create new row","Change sort order":"Change sort order","Drop filters":"Drop filters",Filters:"Filters",Search:"Search","Loading data":"Loading data","Nothing found":" ","Point not choosen":"Point not chosen","No data":" ","Not found":"Not found","No options":"No options","Drag and drop a file here or click":"Drag and drop a file here or click",Next:"Next",Prev:"Prev",Choose:"Choose",Deselect:"Deselect",Green:"Green",Skyblue:"Skyblue",Yellow:"Yellow",Red:"Red",Submit:"Submit",Date:"Date",Time:"Time",Loading:"Loading",Required:"Required","The form contains unsaved changes. Continue?":"The form contains unsaved changes. Continue?","The form contains invalid data. Continue?":"The form contains invalid data. Continue?","Are you sure you want to delete this file?":"Are you sure you want to delete this file?",Confirmation:"Confirmation",Forbidden:"Forbidden",Ok:"Ok",Cancel:"Cancel",Remove:"Remove",Send:"Send",Actions:"Actions",Save:"Save","Not chosen":"Not chosen","Continue?":"Continue?",Unset:"Unset","Select all":"Select all","No tips":"No tips","Column configuration":"Column configuration","Loading...":"Loading...","Pick item":"Pick item","Sign in":"Sign in","Document preview":"Document preview",Download:"Download","Show details":"Show details",Symbol:"Symbol",Position:"Position","Buy price":"Buy price","Profit/Loss":"Profit/Loss",Details:"Details",Info:"Info",Back:"Back","N/A":"N/A",Dashboard:"Dashboard","31 days":"31 days","Profit for 31 days":"Profit for 31 days","7 days":"7 days","Profit for 7 days":"Profit for 7 days",Yesterday:"Yesterday","Yesterday's profit":"Yesterday's profit",Today:"Today","Today's profit":"Today's profit",Failed:"Failed",Successful:"Successful",Total:"Total",Resolved:"Resolved","No signals":"No signals","Signals will be displayed here after they appear":"Signals will be displayed here after they appear","Successful signal":"Successful signal","Successful signals":"Successful signals","Data is outdated. Please refresh the page":"Data is outdated. Please refresh the page","Disconnected from server":"Disconnected from server","Reload page":"Reload page",Reconnect:"Reconnect"},LOCALE={Notifications:"Уведомления",All:"Все",Signals:"Сигналы",Opened:"Открыт",Closed:"Закрыт",Scheduled:"Запланирован",Cancelled:"Отменён","Partial profit":"Частичный профит","Profit fixed":"Зафиксирован профит","Partial loss":"Частичный убыток","Loss fixed":"Зафиксирован убыток","Breakeven available":"Безубыток доступен","Breakeven set":"Безубыток установлен","Trailing stop":"Трейлинг стоп","Trailing take":"Трейлинг тейк",Rejected:"Отклонён",Error:"Ошибка",Validation:"Валидация",Critical:"Критическая",Unknown:"Неизвестно","Copied!":"Скопировано успешно!","Saved!":"Сохранено!",Empty:"",Copy:"Копировать",Paste:"Вставить",Prompt:"Ввод","Refresh manually":"Обновить","Create new row":"Создать новую строку","Change sort order":"Изменить порядок сортировки","Drop filters":"Сбросить фильтры",Filters:"Фильтры",Search:"Поиск","Loading data":"Загрузка данных","Nothing found":" ","Point not choosen":"Точка не указана","No data":" ","Not found":"Нет данных","No options":"Нет данных","Drag and drop a file here or click":"Выберите файл",Next:"Далее",Prev:"Назад",Choose:"Выбрать",Deselect:"Убрать",Green:"Зеленый",Skyblue:"Синий",Yellow:"Желтый",Red:"Красный",Submit:"Применить",Date:"Дата",Time:"Время",Loading:"Загрузка",Required:"Заполнить","The form contains unsaved changes. Continue?":"Форма содержит несохраненные изменения. Продолжить?","The form contains invalid data. Continue?":"Форма содержит неправильно указанные данные. Продолжить?","Are you sure you want to delete this file?":"Вы уверены, что хотите удалить файл?",Confirmation:"Подтверждение",Forbidden:"Нет доступа",Ok:"Ок",Cancel:"Отмена",Remove:"Удалить",Send:"Отправить",Actions:"Действие",Save:"Сохранить","Not chosen":"Не указано","Continue?":"Продолжить",Unset:"Нет данных","Select all":"Выбрать","No tips":"Нет данных","Column configuration":"Отображение колонок","Loading...":"Загрузка","Pick item":"Выберите","Sign in":"Далее","Document preview":"Предпросмотр",Download:"Скачать","Show details":"Показать / Скрыть",Symbol:"Символ",Position:"Позиция","Buy price":"Цена покупки","Profit/Loss":"Прибыль/Убыток",Details:"Детали",Info:"Информация",Back:"Назад","N/A":"Не указано",Dashboard:"Дэшборд","31 days":"31 день","Profit for 31 days":"Прибыль за 31 день","7 days":"7 дней","Profit for 7 days":"Прибыль за 7 дней",Yesterday:"Вчера","Yesterday's profit":"Прибыль за вчера",Today:"Сегодня","Today's profit":"Прибыль за сегодня",Failed:"Неудачно",Successful:"Удачно",Total:"Всего",Resolved:"Выполнено","No signals":"Нет сигналов","Signals will be displayed here after they appear":"Сигналы будут отображены здесь после появления","Successful signal":"Удачный сигнал","Successful signals":"Удачных сигналов","Data is outdated. Please refresh the page":"Данные устарели. Обновите страницу","Disconnected from server":"Отключен от сервера","Reload page":"Перезагрузить страницу",Reconnect:"Переподключиться"},getLocale=so(()=>new URL(location.href,window.location.origin).searchParams.get("locale")||"en"),localeChangedSubject=new ar,localeMap={en:LOCALE$1,ru:LOCALE};function t$1(e){const t=getLocale(),n=localeMap[t];return n&&n[e]||e}const MUTATION_DEBOUNCE=1,mutations=[()=>{document.querySelectorAll("input").forEach(e=>{e.placeholder&&(e.dataset.originalPlaceholder||(e.dataset.originalPlaceholder=e.placeholder),e.placeholder=window.Translate.translateText(e.dataset.originalPlaceholder))})},()=>{document.querySelectorAll("textarea").forEach(e=>{e.placeholder&&(e.dataset.originalPlaceholder||(e.dataset.originalPlaceholder=e.placeholder),e.placeholder=window.Translate.translateText(e.dataset.originalPlaceholder))})}],dom_patch=()=>{const e=lodashExports.throttle(Un$1(...mutations.map(e=>()=>{e()})),MUTATION_DEBOUNCE,{trailing:!0}),t=new MutationObserver(e);localeChangedSubject.subscribe(e),t.observe(document.body,{childList:!0,subtree:!0})};document.addEventListener("DOMContentLoaded",dom_patch);const createElementRef=React.createElement,TRANSLATE_MARK=Symbol("translated"),createElementFactory=e=>(t,n,...r)=>{for(let o=0;o!==r.length;o++)"string"==typeof r[o]&&(r[o]=e(r[o]));return createElementRef(t,n,...r)};class Translate{constructor(e={},t,n={}){this.transform=t,this.config=n;const{rawSymbol:r="撝",useRawMark:o=!1,rawCondition:i=()=>!0}=n,a=e=>{const t=this.tr(e);return t===e&&i(t)?r:t};o?(this.createElement=createElementFactory(a),this.translateText=a):(this.createElement=createElementFactory(this.tr),this.translateText=this.tr),Object.entries(e).forEach(([e,t])=>this._map.set(e,this.applyMark(t)))}_skip=new Set;_map=new Map;_transformed=new Map;_middleware=[];get skipList(){return[...this._skip]}translateText;tryTransform=e=>{if(this.transform){if(this._transformed.has(e))return this._transformed.get(e);{let t="";if(this._middleware.some(n=>t=n(e))||(t=this.transform(e)),t!==e){const n=this.applyMark(t);return this._transformed.set(e,n),n}return null}}return null};applyMark=e=>{const t=new String(e);return t[TRANSLATE_MARK]=!0,t};tr=e=>{if(!e)return e;if(e[TRANSLATE_MARK])return e;if(this._skip.has(e))return e;if(this._map.has(e))return this._map.get(e)||"";const t=this.tryTransform(e);return null!==t?t:(this._skip.add(e),e)};use=e=>{this._middleware.push(e)};createElement;jss=(e,t)=>{const n=Array.isArray(null==t?void 0:t.children)?(null==t?void 0:t.children)||[]:[null==t?void 0:t.children];return this.createElement(e,t,...n)};static install=(...e)=>{const t=new Translate(...e);return window.Translate=t,Object.assign(React,{createElement:t.createElement}),t};clear=()=>{this._skip.clear(),this._transformed.clear()}}Translate.install({},t$1,{rawCondition:e=>/[ЁёА-я]/.test(e),useRawMark:!1});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",f="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|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,g={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])+"]"}},v=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:v,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+v(r,2,"0")+":"+v(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}},b="en",x={};x[b]=g;var $="$isDayjsObject",_=function(e){return e instanceof E||!(!e||!e[$])},C=function e(t,n,r){var o;if(!t)return b;if("string"==typeof t){var i=t.toLowerCase();x[i]&&(o=i),n&&(x[i]=n,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var s=t.name;x[s]=t,o=s}return!r&&o&&(b=o),o||!r&&b},w=function(e,t){if(_(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new E(n)},S=y;S.l=C,S.i=_,S.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[$]=!0}var v=g.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(S.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(h);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()},v.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()},v.$utils=function(){return S},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},v.isAfter=function(e,t){return w(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<w(e)},v.$g=function(e,t,n){return S.u(e)?this[t]:this.set(n,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var n=this,r=!!S.u(t)||t,u=S.p(e),f=function(e,t){var o=S.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?o:o.endOf(s)},h=function(e,t){return S.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},m=this.$W,g=this.$M,v=this.$D,y="set"+(this.$u?"UTC":"");switch(u){case d:return r?f(1,0):f(31,11);case c:return r?f(1,g):f(0,g+1);case l:var b=this.$locale().weekStart||0,x=(m<b?m+7:m)-b;return f(r?v-x:v+(6-x),g);case s:case p:return h(y+"Hours",0);case a:return h(y+"Minutes",1);case i:return h(y+"Seconds",2);case o:return h(y+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var n,l=S.p(e),u="set"+(this.$u?"UTC":""),f=(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],h=l===s?this.$D+(t-this.$W):t;if(l===c||l===d){var m=this.clone().set(p,1);m.$d[f](h),m.init(),this.$d=m.set(p,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](h);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[S.p(e)]()},v.add=function(r,u){var p,f=this;r=Number(r);var h=S.p(u),m=function(e){var t=w(f);return S.w(t.date(t.date()+Math.round(e*r)),f)};if(h===c)return this.set(c,this.$M+r);if(h===d)return this.set(d,this.$y+r);if(h===s)return m(1);if(h===l)return m(7);var g=(p={},p[i]=t,p[a]=n,p[o]=e,p)[h]||1,v=this.$d.getTime()+r*g;return S.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=e||"YYYY-MM-DDTHH:mm:ssZ",o=S.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.s(i%12||12,e,"0")},h=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(m,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return S.s(t.$y,4,"0");case"M":return s+1;case"MM":return S.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.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.s(i,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return h(i,a,!0);case"A":return h(i,a,!1);case"m":return String(a);case"mm":return S.s(a,2,"0");case"s":return String(t.$s);case"ss":return S.s(t.$s,2,"0");case"SSS":return S.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")})},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(r,p,f){var h,m=this,g=S.p(p),v=w(r),y=(v.utcOffset()-this.utcOffset())*t,b=this-v,x=function(){return S.m(m,v)};switch(g){case d:h=x()/12;break;case c:h=x();break;case u:h=x()/3;break;case l:h=(b-y)/6048e5;break;case s:h=(b-y)/864e5;break;case a:h=b/n;break;case i:h=b/t;break;case o:h=b/e;break;default:h=b}return f?h:S.a(h)},v.daysInMonth=function(){return this.endOf(c).$D},v.$locale=function(){return x[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},v.clone=function(){return S.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},g}(),k=E.prototype;return w.prototype=k,[["$ms",r],["$s",o],["$m",i],["$H",a],["$W",s],["$M",c],["$y",d],["$D",p]].forEach(function(e){k[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),w.extend=function(e,t){return e.$i||(e(t,E,w),e.$i=!0),w},w.locale=C,w.isDayjs=_,w.unix=function(e){return w(1e3*e)},w.en=x[b],w.Ls=x,w.p={},w}()),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);dayjs.extend(localeData),dayjs.extend(utcPlugin),dayjs.extend(isToday),dayjs.locale(ruLocale);var dayjs_minExports=requireDayjs_min();const J$1=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$2={};const CC_ENABLE_MOCK=!!define_process_env_default$2.CC_ENABLE_MOCK||!1,CC_FORCE_BROWSER_HISTORY=!!define_process_env_default$2.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$2.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)}
192
192
  /*!
193
193
  * @kurkle/color v0.3.4
194
194
  * https://github.com/kurkle/color#readme
@@ -207,7 +207,7 @@ function round$1(e){return e+.5|0}J$1.extend(localeData),J$1.extend(utcPlugin),J
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([e.to,r,o,e.from]);const i=resolve([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([e.to,t,r,e.from]),this._from=resolve([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$2(e))return;const t=Object.keys(defaults.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{const o=e[r];if(!isObject$2(o))return;const i={};for(const e of t)i[e]=o[e];(isArray(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$2(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(t)===sign(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 f=0;f<d;++f){const e=t[f],{[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$2(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(r[e])?this.parseArrayData(n,r,e,t):isObject$2(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,f;for(d=0,p=r;d<p;++d)f=d+n,u[d]={[a]:c||o.parse(l[f],f),[s]:i.parse(t[f],f)};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 f(){p=r[d];const t=p[a.axis];return!isNumberFinite(p[e.axis])||c>t||u<t}for(d=0;d<i&&(f()||(this.updateRangeFromParsed(l,e,p,s),!o));++d);if(o)for(d=i-1;d>=0;--d)if(!f()){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.elements[e]),f=l.resolveNamedOptions(d,p,()=>this.getContext(n,r,t),u);return f.$shared&&(f.$shared=s,o[i]=Object.freeze(cloneIfNotShared(f,s))),f}_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 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 f=s(t,p);f<l?(a=[{element:n,datasetIndex:c,index:u}],l=f):f===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$2(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(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 f=Object.assign({maxPadding:p,w:i,h:a,x:o.left,y:o.top},o),h=setLayoutDims(l.concat(c),d);fitBoxes(s.fullSize,f,d,h),fitBoxes(l,f,d,h),fitBoxes(c,f,d,h)&&fitBoxes(l,f,d,h),handleMaxPadding(f),placeBoxes(s.leftAndTop,f,d,h),f.x+=f.w,f.y+=f.h,placeBoxes(s.rightAndBottom,f,d,h),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},each(s.chartArea,t=>{const n=t.box;Object.assign(n,e.chartArea),n.update(f.w,f.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$1=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$1(this.x)&&isNumber$1(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(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(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,f,h=0;const m=a-o,g=s-i;if(e.isHorizontal()){if(p=_alignStartEnd(r,i,s),isObject$2(n)){const e=Object.keys(n)[0],r=n[e];f=u[e].getPixelForValue(r)+m-t}else f="center"===n?(c.bottom+c.top)/2+m-t:offsetFromEdge(e,n,t);d=s-i}else{if(isObject$2(n)){const e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)-g+t}else p="center"===n?(c.left+c.right)/2-g+t:offsetFromEdge(e,n,t);f=_alignStartEnd(r,a,o),h="left"===n?-HALF_PI:HALF_PI}return{titleX:p,titleY:f,maxWidth:d,rotation:h}}class Scale extends Element$1{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,f,h,m,g,v,y,b=0,x=0;for(l=0;l<t;l+=s){if(d=e[l].label,p=this._resolveTickFontOptions(l),r.font=f=p.string,h=o[f]=o[f]||{data:{},gc:[]},m=p.lineHeight,g=v=0,isNullOrUndef(d)||isArray(d)){if(isArray(d))for(c=0,u=d.length;c<u;++c)y=d[c],isNullOrUndef(y)||isArray(y)||(g=_measureText(r,h.data,h.gc,g,y),v+=m)}else g=_measureText(r,h.data,h.gc,g,d),v=m;i.push(g),a.push(v),b=Math.max(g,b),x=Math.max(v,x)}garbageCollect(o,t);const $=i.indexOf(b),_=a.indexOf(x),C=e=>({width:i[e]||0,height:a[e]||0});return{first:C(0),last:C(t-1),widest:C($),highest:C(_),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()),f=p.display?p.width:0,h=f/2,m=function(e){return _alignPixel(n,e,f)};let g,v,y,b,x,$,_,C,w,S,E,k;if("top"===i)g=m(this.bottom),$=this.bottom-u,C=g-h,S=m(e.top)+h,k=e.bottom;else if("bottom"===i)g=m(this.top),S=e.top,k=m(e.bottom)-h,$=g+h,C=this.top+u;else if("left"===i)g=m(this.right),x=this.right-u,_=g-h,w=m(e.left)+h,E=e.right;else if("right"===i)g=m(this.left),w=e.left,E=m(e.right)-h,x=g+h,_=this.left+u;else if("x"===t){if("center"===i)g=m((e.top+e.bottom)/2+.5);else if(isObject$2(i)){const e=Object.keys(i)[0],t=i[e];g=m(this.chart.scales[e].getPixelForValue(t))}S=e.top,k=e.bottom,$=g+h,C=$+u}else if("y"===t){if("center"===i)g=m((e.left+e.right)/2);else if(isObject$2(i)){const e=Object.keys(i)[0],t=i[e];g=m(this.chart.scales[e].getPixelForValue(t))}x=g-h,_=x-u,w=e.left,E=e.right}const T=valueOrDefault(r.ticks.maxTicksLimit,c),P=Math.max(1,Math.ceil(c/T));for(v=0;v<c;v+=P){const e=this.getContext(v),t=o.setContext(e),r=a.setContext(e),i=t.lineWidth,c=t.color,u=r.dash||[],p=r.dashOffset,f=t.tickWidth,h=t.tickColor,m=t.tickBorderDash||[],g=t.tickBorderDashOffset;y=getPixelForGridLine(this,v,s),void 0!==y&&(b=_alignPixel(n,y,i),l?x=_=w=E=b:$=C=S=k=b,d.push({tx1:x,ty1:$,tx2:_,ty2:C,x1:w,y1:S,x2:E,y2:k,width:i,color:c,borderDash:u,borderDashOffset:p,tickWidth:f,tickColor:h,tickBorderDash:m,tickBorderDashOffset:g}))}return this._ticksLength=c,this._borderValue=g,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,f=u?-c:p,h=-toRadians(this.labelRotation),m=[];let g,v,y,b,x,$,_,C,w,S,E,k,T="middle";if("top"===r)$=this.bottom-f,_=this._getXAxisLabelAlignment();else if("bottom"===r)$=this.top+f,_=this._getXAxisLabelAlignment();else if("left"===r){const e=this._getYAxisLabelAlignment(d);_=e.textAlign,x=e.x}else if("right"===r){const e=this._getYAxisLabelAlignment(d);_=e.textAlign,x=e.x}else if("x"===t){if("center"===r)$=(e.top+e.bottom)/2+p;else if(isObject$2(r)){const e=Object.keys(r)[0],t=r[e];$=this.chart.scales[e].getPixelForValue(t)+p}_=this._getXAxisLabelAlignment()}else if("y"===t){if("center"===r)x=(e.left+e.right)/2-p;else if(isObject$2(r)){const e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)}_=this._getYAxisLabelAlignment(d).textAlign}"y"===t&&("start"===s?T="top":"end"===s&&(T="bottom"));const P=this._getLabelSizes();for(g=0,v=a.length;g<v;++g){y=a[g],b=y.label;const e=o.setContext(this.getContext(g));C=this.getPixelForTick(g)+o.labelOffset,w=this._resolveTickFontOptions(g),S=w.lineHeight,E=isArray(b)?b.length:1;const t=E/2,n=e.color,s=e.textStrokeColor,c=e.textStrokeWidth;let d,p=_;if(i?(x=C,"inner"===_&&(p=g===v-1?this.options.reverse?"left":"right":0===g?this.options.reverse?"right":"left":"center"),k="top"===r?"near"===l||0!==h?-E*S+S/2:"center"===l?-P.highest.height/2-t*S+S:-P.highest.height+S/2:"near"===l||0!==h?S/2:"center"===l?P.highest.height/2-t*S:P.highest.height-E*S,u&&(k*=-1),0===h||e.showLabelBackdrop||(x+=S/2*Math.sin(h))):($=C,k=(1-E)*S/2),e.showLabelBackdrop){const t=toPadding(e.backdropPadding),n=P.heights[g],r=P.widths[g];let o=k-t.top,i=0-t.left;switch(T){case"middle":o-=n/2;break;case"bottom":o-=n}switch(_){case"center":i-=r/2;break;case"right":i-=r;break;case"inner":g===v-1?i-=r:g>0&&(i-=r/2)}d={left:i,top:o,width:r+t.width,height:n+t.height,color:e.backdropColor}}m.push({label:b,font:w,textOffset:k,options:{rotation:h,color:n,strokeColor:s,strokeWidth:c,textAlign:p,textBaseline:T,translation:[x,$],backdrop:d}})}return m}_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(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$2(t)?(s+=i.bottom,isArray(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(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.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[r]&&(delete defaults[r][n],this.override&&delete overrides[n])}}function registerDefaults(e,t,n){const r=merge(Object.create(null),[n?defaults.get(n):{},defaults.get(t),e.defaults]);defaults.set(t,r),e.defaultRoutes&&routeDefaults(t,e.defaultRoutes),e.descriptors&&defaults.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.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$1,"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(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.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$2(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.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.scales[t.type],defaults.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,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.datasets[t]||{},{type:t},defaults,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(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$2(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$2(e)&&Object.getOwnPropertyNames(e).some(t=>isFunction(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(a)||hasFunction(a))||i&&isArray(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}class Chart{static defaults=defaults;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(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(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(r,(e,t)=>{e||delete n[t]}),each(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.datasets[i];Object.assign(t,{dataElementType:registry.getElement(a),datasetElementType:r&&registry.getElement(r)}),o.controller=new t(this,n),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){each(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(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(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(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(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(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(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},each(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(Chart.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 f=0;const h=o-l;if(r){const e=((u>0?u-r:0)+(d>0?d-r:0))/2;f=(h-(0!==e?h*e/(e+r):h))/2}const m=(h-Math.max(.001,h*d-n/PI)/d)/2,g=l+m+f,v=o-m-f,{outerStart:y,outerEnd:b,innerStart:x,innerEnd:$}=parseBorderRadius$1(t,p,d,v-g),_=d-y,C=d-b,w=g+y/_,S=v-b/C,E=p+x,k=p+$,T=g+x/E,P=v-$/k;if(e.beginPath(),i){const t=(w+S)/2;if(e.arc(a,s,d,w,t),e.arc(a,s,d,t,S),b>0){const t=rThetaToXY(C,S,a,s);e.arc(t.x,t.y,b,S,v+HALF_PI)}const n=rThetaToXY(k,v,a,s);if(e.lineTo(n.x,n.y),$>0){const t=rThetaToXY(k,P,a,s);e.arc(t.x,t.y,$,v+HALF_PI,P+Math.PI)}const r=(v-$/p+(g+x/p))/2;if(e.arc(a,s,p,v-$/p,r,!0),e.arc(a,s,p,r,g+x/p,!0),x>0){const t=rThetaToXY(E,T,a,s);e.arc(t.x,t.y,x,T+Math.PI,g-HALF_PI)}const o=rThetaToXY(_,g,a,s);if(e.lineTo(o.x,o.y),y>0){const t=rThetaToXY(_,w,a,s);e.arc(t.x,t.y,y,g-HALF_PI,w)}}else{e.moveTo(a,s);const t=Math.cos(w)*d+a,n=Math.sin(w)*d+s;e.lineTo(t,n);const r=Math.cos(S)*d+a,o=Math.sin(S)*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,f="inner"===l.borderAlign;if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=p,f?(e.lineWidth=2*c,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let h=t.endAngle;if(i){pathArc(e,t,n,r,h,o);for(let t=0;t<i;++t)e.stroke();isNaN(s)||(h=a+(s%TAU||TAU))}f&&clipArc(e,t,h),i||(pathArc(e,t,n,r,h,o),e.stroke())}class ArcElement extends Element$1{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),f=_isBetween(i,l+d,c+d);return p&&f}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 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$2(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$1{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$1{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,f)=>{const h=n+t/2+o.measureText(e.text).width;(0===f||l[l.length-1]+h+2*a>i)&&(u+=c,l[l.length-(f>0?0:1)]=0,p+=c,d++),s[f]={left:0,top:p,row:d,width:h,height:r},l[l.length-1]+=h+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,f=0,h=0;return this.legendItems.forEach((e,i)=>{const{itemWidth:m,itemHeight:g}=calculateItemSize(n,t,o,e,r);i>0&&p+g+2*a>c&&(u+=d+a,l.push({width:d,height:p}),f+=d+a,h++,d=p=0),s[i]={left:f,top:p,col:h,width:m,height:g},d=Math.max(d,m),p+=g+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.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:f,boxHeight:h,itemHeight:m}=getBoxSize(i,u),g=this.isHorizontal(),v=this._computeTitleHeight();p=g?{x:_alignStartEnd(o,this.left+c,this.right-n[0]),y:this.top+c+v,line:0}:{x:this.left+c,y:_alignStartEnd(o,this.top+v+c,this.bottom-t[0].height),line:0},overrideTextDirection(this.ctx,e.textDirection);const y=m+c;this.legendItems.forEach((b,x)=>{r.strokeStyle=b.fontColor,r.fillStyle=b.fontColor;const $=r.measureText(b.text).width,_=s.textAlign(b.textAlign||(b.textAlign=i.textAlign)),C=f+d+$;let w=p.x,S=p.y;s.setWidth(this.width),g?x>0&&w+C+c>this.right&&(S=p.y+=y,p.line++,w=p.x=_alignStartEnd(o,this.left+c,this.right-n[p.line])):x>0&&S+y>this.bottom&&(w=p.x=w+t[p.line].width+c,p.line++,S=p.y=_alignStartEnd(o,this.top+v+c,this.bottom-t[p.line].height));if(function(e,t,n){if(isNaN(f)||f<=0||isNaN(h)||h<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:h*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:o},l=s.xPlus(e,f/2);drawPointLegend(r,a,l,t+d,i.pointStyleWidth&&f)}else{const i=t+Math.max((u-h)/2,0),a=s.leftForLtr(e,f),l=toTRBLCorners(n.borderRadius);r.beginPath(),Object.values(l).some(e=>0!==e)?addRoundedRectPath(r,{x:a,y:i,w:f,h:h,radius:l}):r.rect(a,i,f,h),r.fill(),0!==o&&r.stroke()}r.restore()}(s.x(w),S,b),w=_textX(_,w+f+d,g?w+C:this.right,e.rtl),function(e,t,n){renderText(r,n.text,e,t+m/2,l,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})}(s.x(w),S,b),g)p.x+=C+c;else if("string"!=typeof b.text){const e=l.lineHeight;p.y+=calculateLegendItemHeight(b,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(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$1{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(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(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(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,f=r.length,h=toPadding(t.padding);let m=h.height,g=0,v=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){m+=f*(t.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(v-f)*l.lineHeight+(v-1)*t.bodySpacing}p&&(m+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let y=0;const b=function(e){g=Math.max(g,n.measureText(e).width+y)};return n.save(),n.font=c.string,each(e.title,b),n.font=l.string,each(e.beforeBody.concat(e.afterBody),b),y=t.displayColors?a+2+t.boxPadding:0,each(r,e=>{each(e.before,b),each(e.lines,b),each(e.after,b)}),y=0,n.font=u.string,each(e.footer,b),n.restore(),g+=h.width,{width:g,height:m}}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:f}=toTRBLCorners(a);let h=alignX(t,s);const m=alignY(t,l,c);return"center"===l?"left"===s?h+=c:"right"===s&&(h-=c):"left"===s?h-=Math.max(u,p)+o:"right"===s&&(h+=Math.max(d,f)+o),{x:_limitValue(h,0,r.width-t.width),y:_limitValue(m,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}class Tooltip extends Element$1{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(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(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:f,height:h}=t;let m,g,v,y,b,x;return"center"===o?(b=p+h/2,"left"===r?(m=d,g=m-i,y=b+i,x=b-i):(m=d+f,g=m+i,y=b-i,x=b+i),v=m):(g="left"===r?d+Math.max(s,c)+i:"right"===r?d+f-Math.max(l,u)-i:this.caretX,"top"===o?(y=p,b=y-i,m=g-i,v=g+i):(y=p+h,b=y+i,m=g+i,v=g-i),x=y),{x1:m,x2:g,x3:v,y1:y,y2:b,y3:x}}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,f=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=f+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$2(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:f,w:l,h:s,radius:a}),e.fill(),e.stroke(),e.fillStyle=i.backgroundColor,e.beginPath(),addRoundedRectPath(e,{x:n,y:f+1,w:l-2,h:s-2,radius:a}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(t,f,l,s),e.strokeRect(t,f,l,s),e.fillStyle=i.backgroundColor,e.fillRect(n,f+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 f=getRtlAdapter(n.rtl,this.x,this.width),h=function(n){t.fillText(n,f.x(e.x+p),e.y+d/2),e.y+=d+o},m=f.textAlign(i);let g,v,y,b,x,$,_;for(t.textAlign=i,t.textBaseline="middle",t.font=u.string,e.x=getAlignedX(this,m,n),t.fillStyle=n.bodyColor,each(this.beforeBody,h),p=a&&"right"!==m?"center"===i?l/2+c:l+2+c:0,b=0,$=r.length;b<$;++b){for(g=r[b],v=this.labelTextColors[b],t.fillStyle=v,each(g.before,h),y=g.lines,a&&y.length&&(this._drawColorBox(t,e,b,f,n),d=Math.max(u.lineHeight,s)),x=0,_=y.length;x<_;++x)h(y[x]),d=u.lineHeight;each(g.after,h)}p=0,d=u.lineHeight,each(this.afterBody,h),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:f}=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-f),t.quadraticCurveTo(a+l,s+c,a+l-f,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,positioners:positioners,afterInit(e,t,n){n&&(e.tooltip=new Tooltip({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,f=c-1,{min:h,max:m}=t,g=!isNullOrUndef(i),v=!isNullOrUndef(a),y=!isNullOrUndef(l),b=(m-h)/(u+1);let x,$,_,C,w=niceNum((m-h)/f/p)*p;if(w<1e-14&&!g&&!v)return[{value:h},{value:m}];C=Math.ceil(m/w)-Math.floor(h/w),C>f&&(w=niceNum(C*w/f/p)*p),isNullOrUndef(s)||(x=Math.pow(10,s),w=Math.ceil(w*x)/x),"ticks"===r?($=Math.floor(h/w)*w,_=Math.ceil(m/w)*w):($=h,_=m),g&&v&&o&&almostWhole((a-i)/o,w/1e3)?(C=Math.round(Math.min((a-i)/w,c)),w=(a-i)/C,$=i,_=a):y?($=g?i:$,_=v?a:_,C=l-1,w=(_-$)/C):(C=(_-$)/w,C=almostEquals(C,Math.round(C),w/1e3)?Math.round(C):Math.ceil(C));const S=Math.max(_decimalPlaces(w),_decimalPlaces($));x=Math.pow(10,isNullOrUndef(s)?S:s),$=Math.round($*x)/x,_=Math.round(_*x)/x;let E=0;for(g&&(d&&$!==i?(n.push({value:i}),$<i&&E++,almostEquals(Math.round(($+E*w)*x)/x,i,relativeLabelSize(i,b,e))&&E++):$<i&&E++);E<C;++E){const e=Math.round(($+E*w)*x)/x;if(v&&e>a)break;n.push({value:e})}return v&&d&&_!==a?n.length&&almostEquals(n[n.length-1].value,a,relativeLabelSize(a,b,e))?n[n.length-1].value=a:n.push({value:a}):v&&_!==a||n.push({value:_}),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(r),t=sign(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$2(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$1(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$2(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$1(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 f="data"===r.ticks.source&&this.getDataTimestamps();for(u=p,d=0;u<n;u=+e.add(u,a,i),d++)addTick(c,u,f);return u!==n&&"ticks"!==r.bounds&&1!==d||addTick(c,u,f),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$2(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)}}const{makeStyles:makeStyles}=createMakeAndWithStyles({useTheme:useTheme}),useStyles$m=makeStyles()({root:{position:"relative",width:48,maxWidth:48}}),MobileCheckboxBodyCell=e=>{const{classes:t}=useStyles$m();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$l=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:"hidden",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$l(),{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:`${eM.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$k=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:"hidden"},row:{"& .MuiTableCell-root":{padding:"6px",overflow:"hidden"},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$k(),c=fm(),u=Zm(),{selection:d,setSelection:p}=pm(),{onRowClick:f,onRowAction:h,rowColor:m=()=>"inherit"}=c,g=e=>{s(e)},v=t=>{h&&h(t,e,u)},[y,b,x]=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:v,withLabel:a,disableGutters:s,onMenuToggle:g}),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]),$=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:$},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)):f&&f(e,u))},children:factory$1(TableCell,{padding:"none",sx:{background:m(e),maxWidth:$},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,b]}),x.map((e,t)=>factory$1(TableRow,{className:clsx$2(t===x.length-1&&l.noBorder),children:e},t))]})})})})};function keys(e){return Object.keys(e)}function isObject$1(e){return e&&"object"==typeof e&&!Array.isArray(e)}function deepMerge(e,t){const n={...e},r=t;return isObject$1(e)&&isObject$1(t)&&Object.keys(t).forEach(t=>{isObject$1(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$1(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",h),document.addEventListener("mouseup",p),document.addEventListener("touchmove",g),document.addEventListener("touchend",p))},p=()=>{i.current&&o.current&&(i.current=!1,l(!1),document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",p),document.removeEventListener("touchmove",g),document.removeEventListener("touchend",p),setTimeout(()=>{"function"==typeof(null==t?void 0:t.onScrubEnd)&&t.onScrubEnd()},0))},f=e=>{d(),e.preventDefault(),h(e)},h=e=>u({x:e.clientX,y:e.clientY}),m=e=>{e.cancelable&&e.preventDefault(),d(),g(e)},g=e=>{e.cancelable&&e.preventDefault(),u({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY})};return null==(s=r.current)||s.addEventListener("mousedown",f),null==(c=r.current)||c.addEventListener("touchstart",m,{passive:!1}),()=>{r.current&&(r.current.removeEventListener("mousedown",f),r.current.removeEventListener("touchstart",m))}},[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&&currentQueue&&(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&&currentQueue[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$1={};function getEnv(){return void 0!==process$1&&define_process_env_default$1?"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(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("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("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("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(e,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${i}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:a,isLight:isLightColor(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:f,stylesTransform:h}){const{colorScheme:m,setColorScheme:g,clearColorScheme:v}=useProviderColorScheme({defaultColorScheme:u,forceColorScheme:f,manager:c,getRootElement:d});return useRespectReduceMotion({respectReducedMotion:(null==e?void 0:e.respectReducedMotion)||!1,getRootElement:d}),factory$1(MantineContext.Provider,{value:{colorScheme:m,setColorScheme:g,clearColorScheme:v,getRootElement:d,classNamesPrefix:l,getStyleNonce:n,cssVariablesResolver:p,cssVariablesSelector:s,withStaticClasses:r,stylesTransform:h},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:f,transformedStyles:h}){return clsx$2(getGlobalClassNames({theme:e,options:t,unstyled:s||f}),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:h,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||f}),p&&!f&&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$j({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(),f=useMantineClassNamesPrefix(),h=useMantineWithStaticClasses(),m=useMantineIsHeadless(),g=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:v,getTransformedStyles:y}=useStylesTransform({props:n,stylesCtx:r,themeName:g});return(e,b)=>({className:getClassName({theme:p,options:b,themeName:g,selector:e,classNamesPrefix:f,classNames:l,classes:t,unstyled:s,className:o,rootSelector:a,props:n,stylesCtx:r,withStaticClasses:h,headless:m,transformedStyles:y([null==b?void 0:b.styles,c])}),style:getStyle({theme:p,themeName:g,selector:e,options:b,props:n,stylesCtx:r,rootSelector:a,styles:c,style:i,vars:u,varsResolver:d,headless:m,withStylesTransform:v})})}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:f,pb:h,pl:m,pr:g,pe:v,ps:y,bd:b,bg:x,c:$,opacity:_,ff:C,fz:w,fw:S,lts:E,ta:k,lh:T,fs:P,tt:M,td:L,w:I,miw:R,maw:O,h:A,mih:D,mah:N,bgsz:F,bgp:z,bgr:B,bga:j,pos:H,top:V,left:U,bottom:W,right:Y,inset:q,display:G,flex:K,hiddenFrom:X,visibleFrom:Z,lightHidden:J,darkHidden:Q,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:f,pb:h,pl:m,pr:g,pe:v,ps:y,bd:b,bg:x,c:$,opacity:_,ff:C,fz:w,fw:S,lts:E,ta:k,lh:T,fs:P,tt:M,td:L,w:I,miw:R,maw:O,h:A,mih:D,mah:N,bgsz:F,bgp:z,bgr:B,bga:j,pos:H,top:V,left:U,bottom:W,right:Y,inset:q,display:G,flex:K,hiddenFrom:X,visibleFrom:Z,lightHidden:J,darkHidden:Q,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,...f},h)=>{var m;const g=useMantineTheme(),v=e||"div",{styleProps:y,rest:b}=extractStyleProps(f),x=useMantineSxTransform(),$=null==(m=null==x?void 0:x())?void 0:m(y.sx),_=useRandomClassName(),C=parseStyleProps({styleProps:y,theme:g,data:STYlE_PROPS_DATA}),w={ref:h,style:getBoxStyle({theme:g,style:t,vars:n,styleProps:C.inlineStyles}),className:clsx$2(r,$,{[_]: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),...b};return factory$1(Fragment,{children:[C.hasResponsiveStyles&&factory$1(InlineStyles,{selector:`.${_}`,styles:C.styles,media:C.media}),"function"==typeof d?d(w):factory$1(v,{...w})]})});_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),[f,h]=reactExports.useState(null),[m,g]=reactExports.useState(null),[v,y]=reactExports.useState(0),[b,x]=reactExports.useState(0),[$,_]=reactExports.useState(!1),[C,w]=reactExports.useState(!1),S=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:f,onScrollbarXChange:h,scrollbarXEnabled:$,onScrollbarXEnabledChange:_,scrollbarY:m,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:y,onCornerHeightChange:x},children:factory$1(Box,{...a,ref:S,__vars:{"--sa-corner-width":"xy"!==i?"0px":`${v}px`,"--sa-corner-height":"xy"!==i?"0px":`${b}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(),[f,h]=reactExports.useState(null),m=useMergedRef(t,e=>h(e)),g=reactExports.useRef(null),v=reactExports.useRef(""),{viewport:y}=p,b=n.content-n.viewport,x=useCallbackRef(c),$=useCallbackRef(s),_=useDebouncedCallback(u,10),C=e=>{if(g.current){const t=e.clientX-g.current.left,n=e.clientY-g.current.top;l({x:t,y:n})}};return reactExports.useEffect(()=>{const e=e=>{const t=e.target;(null==f?void 0:f.contains(t))&&x(e,b)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[y,f,b,x]),reactExports.useEffect($,[n,$]),useResizeObserver(f,_),useResizeObserver(p.content,_),factory$1(ScrollbarProvider,{value:{scrollbar:f,hasThumb:r,onThumbChange:useCallbackRef(o),onThumbPointerUp:useCallbackRef(i),onThumbPositionChange:$,onThumbPointerDown:useCallbackRef(a)},children:factory$1("div",{...d,ref:m,"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),g.current=f.getBoundingClientRect(),v.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=v.current,g.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:f,onScrollPositionChange:h,children:m,offsetScrollbars:g,scrollbars:v,onBottomReached:y,onTopReached:b,...x}=n,[$,_]=reactExports.useState(!1),C=useStyles$j({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:v,...C("root"),...x,children:[factory$1(ScrollAreaViewport,{...p,...C("viewport",{style:null==p?void 0:p.style}),ref:f,"data-offset-scrollbars":!0===g?"xy":g||void 0,"data-scrollbars":v||void 0,onScroll:e=>{var t;null==(t=null==p?void 0:p.onScroll)||t.call(p,e),null==h||h({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==b||b())},children:m}),("xy"===v||"x"===v)&&factory$1(ScrollAreaScrollbar,{...C("scrollbar"),orientation:"horizontal","data-hidden":"never"===u||void 0,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:factory$1(ScrollAreaThumb,{...C("thumb")})}),("xy"===v||"y"===v)&&factory$1(ScrollAreaScrollbar,{...C("scrollbar"),orientation:"vertical","data-hidden":"never"===u||void 0,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:factory$1(ScrollAreaThumb,{...C("thumb")})}),factory$1(ScrollAreaCorner,{...C("corner"),"data-hovered":$||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:f,viewportProps:h,scrollbars:m,style:g,vars:v,onBottomReached:y,...b}=useProps("ScrollAreaAutosize",defaultProps$_,e);return factory$1(Box,{...b,ref:t,style:[{display:"flex",overflow:"auto"},g],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:f,viewportProps:h,vars:v,scrollbars:m,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$j({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$j({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(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(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(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=Math.min,max=Math.max,round=Math.round,floor=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(e,min(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 f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(getAlignment(t)){case"start":f[a]-=p*(n&&c?-1:1);break;case"end":f[a]+=p*(n&&c?-1:1)}return f}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:f=0}=evaluate(t,e),h=getPaddingObject(f),m=s[p?"floating"===d?"reference":"floating":d],g=rectToClientRect(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="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)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=rectToClientRect(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+h.top)/b.y,bottom:(x.bottom-g.bottom+h.bottom)/b.y,left:(g.left-x.left+h.left)/b.x,right:(x.right-g.right+h.right)/b.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,f={},h=0;for(let g=0;g<s.length;g++){var m;const{name:n,fn:i}=s[g],{x:v,y:y,data:b,reset:x}=await i({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:{...a,detectOverflow:null!=(m=a.detectOverflow)?m:detectOverflow},elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=y?y:d,f={...f,[n]:{...f[n],...b}},x&&h<=50&&(h++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(c=!0===x.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:u,y:d}=computeCoordsFromPlacement(c,p,l))),g=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}},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},f=getAlignmentAxis(o),h=getAxisLength(f),m=await a.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[f]-p[f]-i.floating[h],$=p[f]-i.reference[f],_=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let C=_?_[b]:0;C&&await(null==a.isElement?void 0:a.isElement(_))||(C=s.floating[b]||i.floating[h]);const w=x/2-$/2,S=C/2-m[h]/2-1,E=min(d[v],S),k=min(d[y],S),T=E,P=C-m[h]-k,M=C/2-m[h]/2+w,L=clamp(T,M,P),I=!l.arrow&&null!=getAlignment(o)&&M!==L&&i.reference[h]/2-(M<T?E:k)-m[h]/2<0,R=I?M<T?M-T:M-P:0;return{[f]:p[f]+R,data:{[f]:L,centerOffset:M-L-R,...I&&{alignmentOffset:R}},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:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=evaluate(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=getSide(o),y=getSideAxis(s),b=getSide(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),$=p||(b||!m?[getOppositePlacement(s)]:getExpandedPlacements(s)),_="none"!==h;!p&&_&&$.push(...getOppositeAxisPlacements(s,m,h,x));const C=[s,...$],w=await l.detectOverflow(t,g),S=[];let E=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&S.push(w[v]),d){const e=getAlignmentSides(o,a,x);S.push(w[e[0]],w[e[1]])}if(E=[...E,{placement:o,overflows:S}],!S.every(e=>e<=0)){var k,T;const e=((null==(k=i.flip)?void 0:k.index)||0)+1,t=C[e];if(t){if(!("alignment"===d&&y!==getSideAxis(t))||E.every(e=>getSideAxis(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:E},reset:{placement:t}}}let n=null==(T=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:T.placement;if(!n)switch(f){case"bestFit":{var P;const e=null==(P=E.filter(e=>{if(_){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:P[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}};function getBoundingRect(e){const t=min(...e.map(e=>e.left)),n=min(...e.map(e=>e.top));return{x:t,y:n,width:max(...e.map(e=>e.right))-t,height:max(...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$2=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)),f=getPaddingObject(s);const h=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-f.left&&l<e.right+f.right&&c>e.top-f.top&&c<e.bottom+f.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(...d.map(e=>e.right)),r=min(...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!==h.reference.x||o.reference.y!==h.reference.y||o.reference.width!==h.reference.width||o.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},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:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*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)),f=getOppositeAxis(p);let h=u[f],m=u[p];if(a){const e="y"===f?"bottom":"right";h=clamp(h+d["y"===f?"top":"left"],h,h-d[e])}if(s){const e="y"===p?"bottom":"right";m=clamp(m+d["y"===p?"top":"left"],m,m-d[e])}const g=l.fn({...t,[f]:h,[p]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[f]: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 f=u[p],h=u[d];const m=evaluate(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+g.mainAxis,n=i.reference[p]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var v,y;const e="y"===p?"width":"height",t=originSides.has(getSide(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=a.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:f,[d]:h}}}},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),f="y"===getSideAxis(o),{width:h,height:m}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,g="end"===p?"top":"bottom");const y=m-u.top-u.bottom,b=h-u.left-u.right,x=min(m-u[g],y),$=min(h-u[v],b),_=!t.middlewareData.shift;let C=x,w=$;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(w=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(C=y),_&&!p){const e=max(u.left,0),t=max(u.right,0),n=max(u.top,0),r=max(u.bottom,0);f?w=h-2*(0!==e||0!==t?e+t:max(u.left,u.right)):C=m-2*(0!==n||0!==r?n+r:max(u.top,u.bottom))}await l({...t,availableWidth:w,availableHeight:C});const S=await a.getDimensions(s.floating);return h!==S.width||m!==S.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(n)!==i||round(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function unwrapElement(e){return isElement(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(n.width):n.width)/r,s=(i?round(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(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(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(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=max(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(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(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(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(e)&&"body"!==getNodeName(e)),o=null;const i="fixed"===getComputedStyle$1(e).position;let a=i?getParentNode(e):e;for(;isElement(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(r.top,e.top),e.right=min(r.right,e.right),e.bottom=min(r.bottom,e.bottom),e.left=max(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(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,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:f}=c;if(s||t(),!p||!f)return;const h={rootMargin:-floor(d)+"px "+-floor(o.clientWidth-(u+p))+"px "+-floor(o.clientHeight-(d+f))+"px "+-floor(u)+"px",threshold:max(0,min(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||rectsAreEqual(c,e.getBoundingClientRect())||a(),m=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(v){r=new IntersectionObserver(g,h)}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,f=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m=l?getBoundingClientRect(e):null;return l&&function t(){const r=getBoundingClientRect(e);m&&!rectsAreEqual(m,r)&&n();m=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=h)||e.disconnect(),h=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$1=inline$2,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,f]=reactExports.useState(r);deepEqual(p,r)||f(r);const[h,m]=reactExports.useState(null),[g,v]=reactExports.useState(null),y=reactExports.useCallback(e=>{e!==_.current&&(_.current=e,m(e))},[]),b=reactExports.useCallback(e=>{e!==C.current&&(C.current=e,v(e))},[]),x=i||h,$=a||g,_=reactExports.useRef(null),C=reactExports.useRef(null),w=reactExports.useRef(u),S=null!=l,E=useLatestRef(l),k=useLatestRef(o),T=useLatestRef(c),P=reactExports.useCallback(()=>{if(!_.current||!C.current)return;const e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),computePosition(_.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==T.current};M.current&&!deepEqual(w.current,t)&&(w.current=t,reactDomExports.flushSync(()=>{d(t)}))})},[p,t,n,k,T]);index$3(()=>{!1===c&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);const M=reactExports.useRef(!1);index$3(()=>(M.current=!0,()=>{M.current=!1}),[]),index$3(()=>{if(x&&(_.current=x),$&&(C.current=$),x&&$){if(E.current)return E.current(x,$,P);P()}},[x,$,P,E,S]);const L=reactExports.useMemo(()=>({reference:_,floating:C,setReference:y,setFloating:b}),[y,b]),I=reactExports.useMemo(()=>({reference:x,floating:$}),[x,$]),R=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:P,refs:L,elements:I,floatingStyles:R}),[u,P,L,I,R])}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=(e,t)=>({...inline$1(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}}}),f=reactExports.useCallback(e=>{const t=isElement(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),p.refs.setReference(t)},[p.refs]),h=reactExports.useCallback(e=>{(isElement(e)||null===e)&&(u.current=e,a(e)),(isElement(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!isElement(e))&&p.refs.setReference(e)},[p.refs]),m=reactExports.useMemo(()=>({...p.refs,setReference:h,setPositionReference:f,domReference:u}),[p.refs,h,f]),g=reactExports.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),v=reactExports.useMemo(()=>({...p,...r,refs:m,elements:g,nodeId:t}),[p,m,g,t,r]);return index$2(()=>{r.dataRef.current.floatingContext=v;const e=null==d?void 0:d.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),reactExports.useMemo(()=>({...p,context:v,refs:m,elements:g}),[p,m,g,v])}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$1(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,[f,h]=reactExports.useState(p?0:e),[m,g]=reactExports.useState(r?"entered":"exited"),v=reactExports.useRef(-1),y=reactExports.useRef(-1),b=reactExports.useRef(-1),x=n=>{const r=n?o:i,l=n?a:s;window.clearTimeout(v.current);const c=p?0:n?e:t;h(c),0===c?("function"==typeof r&&r(),"function"==typeof l&&l(),g(n?"entered":"exited")):b.current=requestAnimationFrame(()=>{ReactDOM.flushSync(()=>{g(n?"pre-entering":"pre-exiting")}),b.current=requestAnimationFrame(()=>{"function"==typeof r&&r(),g(n?"entering":"exiting"),v.current=window.setTimeout(()=>{"function"==typeof l&&l(),g(n?"entered":"exited")},c)})})};return useDidUpdate(()=>{var e;e=r,window.clearTimeout(y.current),"number"==typeof(e?l:c)?y.current=window.setTimeout(()=>{x(e)},e?l:c):x(e)},[r]),reactExports.useEffect(()=>()=>{window.clearTimeout(v.current),cancelAnimationFrame(b.current)},[]),{transitionDuration:f,transitionStatus:m,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:f,transitionStatus:h,transitionTimingFunction:m}=useTransition({mounted:o,exitDuration:r,duration:n,timingFunction:a,onExit:s,onEntered:l,onEnter:c,onExited:u,enterDelay:d,exitDelay:p});return 0===f?o?factory$1(Fragment,{children:i({})}):e?i({display:"none"}):null:"exited"===h?e?i({display:"none"}):null:factory$1(Fragment,{children:i(getTransitionStyles({transition:t,duration:f,state:h,timingFunction:m}))})}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:f,styles:h,...m}=a,g=usePopoverContext(),v=useFocusReturn({opened:g.opened,shouldReturnFocus:g.returnFocus}),y=g.withRoles?{"aria-labelledby":g.getTargetId(),id:g.getDropdownId(),role:"dialog",tabIndex:-1}:{},b=useMergedRef(t,g.floating);return g.disabled?null:factory$1(OptionalPortal,{...g.portalProps,withinPortal:g.withinPortal,children:factory$1(Transition,{mounted:g.opened,...g.transitionProps,transition:(null==(n=g.transitionProps)?void 0:n.transition)||"fade",duration:(null==(r=g.transitionProps)?void 0:r.duration)??150,keepMounted:g.keepMounted,exitDuration:"number"==typeof(null==(o=g.transitionProps)?void 0:o.exitDuration)?g.transitionProps.exitDuration:null==(i=g.transitionProps)?void 0:i.duration,children:e=>factory$1(FocusTrap,{active:g.trapFocus&&g.opened,innerRef:b,children:factory$1(Box,{...y,...m,variant:p,onKeyDownCapture:closeOnEscape(g.onClose,{active:g.closeOnEscape,onTrigger:v,onKeyDown:d}),"data-position":g.placement,"data-fixed":"fixed"===g.floatingStrategy||void 0,...g.getStyles("dropdown",{className:s,props:a,classNames:f,styles:h,style:[{...e,zIndex:g.zIndex,top:g.y??0,left:g.x??0,width:"target"===g.width?void 0:rem(g.width)},l]}),children:[u,factory$1(FloatingArrow,{ref:g.arrowRef,arrowX:g.arrowX,arrowY:g.arrowY,visible:g.withArrow,position:g.placement,arrowSize:g.arrowSize,arrowRadius:g.arrowRadius,arrowOffset:g.arrowOffset,arrowPosition:g.arrowPosition,...g.getStyles("arrow",{props:a,classNames:f,styles:h})})]})})})})});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$1(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():inline(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:f,transitionProps:h,width:m,middlewares:g,withArrow:v,arrowSize:y,arrowOffset:b,arrowRadius:x,arrowPosition:$,unstyled:_,classNames:C,styles:w,closeOnClickOutside:S,withinPortal:E,portalProps:k,closeOnEscape:T,clickOutsideEvents:P,trapFocus:M,onClose:L,onOpen:I,onChange:R,zIndex:O,radius:A,shadow:D,id:N,defaultOpened:F,__staticSelector:z,withRoles:B,disabled:j,returnFocus:H,variant:V,keepMounted:U,vars:W,floatingStrategy:Y,...q}=s,G=useStyles$j({name:z,props:s,classes:classes$m,classNames:C,styles:w,unstyled:_,rootSelector:"dropdown",vars:W,varsResolver:varsResolver$m}),K=reactExports.useRef(null),[X,Z]=reactExports.useState(null),[J,Q]=reactExports.useState(null),{dir:ee}=useDirection(),te=useId$1(N),ne=usePopover({middlewares:g,width:m,position:getFloatingPosition(ee,c),offset:"number"==typeof u?u+(v?y/2:0):u,arrowRef:K,arrowOffset:b,onPositionChange:d,positionDependencies:p,opened:f,defaultOpened:F,onChange:R,onOpen:I,onClose:L,strategy:Y});useClickOutside(()=>S&&ne.onClose(),P,[X,J]);const re=reactExports.useCallback(e=>{Z(e),ne.floating.refs.setReference(e)},[ne.floating.refs.setReference]),oe=reactExports.useCallback(e=>{Q(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:h,width:m,withArrow:v,arrowSize:y,arrowOffset:b,arrowRadius:x,arrowPosition:$,placement:ne.floating.placement,trapFocus:M,withinPortal:E,portalProps:k,zIndex:O,radius:A,shadow:D,closeOnEscape:T,onClose:ne.onClose,onToggle:ne.onToggle,getTargetId:()=>`${te}-target`,getDropdownId:()=>`${te}-dropdown`,withRoles:B,targetProps:q,__staticSelector:z,classNames:C,styles:w,unstyled:_,variant:V,keepMounted:U,getStyles:G,floatingStrategy:Y},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:f,variant:h,icon:m,mod:g,...v}=n,y=useStyles$j({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,...v,unstyled:d,variant:h,disabled:f,mod:[{disabled:f||p},g],...y("root",{variant:h,active:!f&&!p}),children:[m||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,...f}=useProps("InputDescription",defaultProps$S,n),h=useInputWrapperContext(),m=useStyles$j({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}),g=d&&(null==h?void 0:h.getStyles)||m;return factory$1(Box,{component:"p",ref:t,variant:p,size:c,...g("description",(null==h?void 0:h.getStyles)?{className:o,style:i}:void 0),...f})});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,...f}=n,h=useStyles$j({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}),m=useInputWrapperContext(),g=d&&(null==m?void 0:m.getStyles)||h;return factory$1(Box,{component:"p",ref:t,variant:p,size:c,...g("error",(null==m?void 0:m.getStyles)?{className:o,style:i}:void 0),...f})});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:f,children:h,__staticSelector:m,variant:g,mod:v,...y}=useProps("InputLabel",defaultProps$Q,n),b=useStyles$j({name:["InputWrapper",m],props:n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"label",vars:l,varsResolver:varsResolver$i}),x=useInputWrapperContext(),$=(null==x?void 0:x.getStyles)||b;return factory$1(Box,{...$("label",(null==x?void 0:x.getStyles)?{className:o,style:i}:void 0),component:c,variant:g,size:u,ref:t,htmlFor:"label"===c?p:void 0,mod:[{required:d},v],onMouseDown:e=>{null==f||f(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()},...y,children:[h,d&&factory$1("span",{...$("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,...f}=useProps("InputPlaceholder",defaultProps$P,n),h=useStyles$j({name:["InputPlaceholder",c],props:n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"placeholder"});return factory$1(Box,{...h("placeholder"),mod:[{error:!!d},p],component:"span",variant:u,ref:t,...f})});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:f,label:h,error:m,description:g,labelProps:v,descriptionProps:y,errorProps:b,labelElement:x,children:$,withAsterisk:_,id:C,required:w,__stylesApiProps:S,mod:E,...k}=n,T=useStyles$j({name:["InputWrapper",d],props:S||n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$h}),P={size:c,variant:u,__staticSelector:d},M=useId$1(C),L="boolean"==typeof _?_:w,I=(null==b?void 0:b.id)||`${M}-error`,R=(null==y?void 0:y.id)||`${M}-description`,O=M,A=!!m&&"boolean"!=typeof m,D=!!g,N=`${A?I:""} ${D?R:""}`,F=N.trim().length>0?N.trim():void 0,z=(null==v?void 0:v.id)||`${M}-label`,B=h&&factory$1(InputLabel,{labelElement:x,id:z,htmlFor:O,required:L,...P,...v,children:h}),j=D&&factory$1(InputDescription,{...y,...P,size:(null==y?void 0:y.size)||P.size,id:(null==y?void 0:y.id)||R,children:g}),H=factory$1(reactExports.Fragment,{children:p($)}),V=A&&reactExports.createElement(InputError,{...b,...P,size:(null==b?void 0:b.size)||P.size,key:"error",id:(null==b?void 0:b.id)||I},m),U=f.map(e=>{switch(e){case"label":return B;case"input":return H;case"description":return j;case"error":return V;default:return null}});return factory$1(InputWrapperProvider,{value:{getStyles:T,describedBy:F,inputId:O,labelId:z,...getInputOffsets(f,{hasDescription:D,hasError:A})},children:factory$1(Box,{ref:t,variant:u,size:c,mod:[{error:!!m},E],...T("root"),...k,children:U})})});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=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:f,disabled:h,leftSection:m,leftSectionProps:g,leftSectionWidth:v,rightSection:y,rightSectionProps:b,rightSectionWidth:x,rightSectionPointerEvents:$,leftSectionPointerEvents:_,variant:C,vars:w,pointer:S,multiline:E,radius:k,id:T,withAria:P,withErrorStyles:M,mod:L,inputSize:I,...R}=n,{styleProps:O,rest:A}=extractStyleProps(R),D=useInputWrapperContext(),N={offsetBottom:null==D?void 0:D.offsetBottom,offsetTop:null==D?void 0:D.offsetTop},F=useStyles$j({name:["Input",c],props:u||n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,stylesCtx:N,rootSelector:"wrapper",vars:w,varsResolver:varsResolver$g}),z=P?{required:l,disabled:h,"aria-invalid":!!f,"aria-describedby":null==D?void 0:D.describedBy,id:(null==D?void 0:D.inputId)||T}:{};return factory$1(Box,{...F("wrapper"),...O,...p,mod:[{error:!!f&&M,pointer:S,disabled:h,multiline:E,"data-with-right-section":!!y,"data-with-left-section":!!m},L],variant:C,size:d,children:[m&&factory$1("div",{...g,"data-position":"left",...F("section",{className:null==g?void 0:g.className,style:null==g?void 0:g.style}),children:m}),factory$1(Box,{component:"input",...A,...z,ref:t,required:l,mod:{disabled:h,error:!!f&&M},variant:C,__size:I,...F("input")}),y&&factory$1("div",{...b,"data-position":"right",...F("section",{className:null==b?void 0:b.className,style:null==b?void 0:b.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:f,errorProps:h,labelProps:m,descriptionProps:g,wrapperProps:v,id:y,size:b,style:x,inputContainer:$,inputWrapperOrder:_,withAsterisk:C,variant:w,vars:S,mod:E,...k}=r,{styleProps:T,rest:P}=extractStyleProps(k);return{...P,classNames:l,styles:c,unstyled:d,wrapperProps:{...{label:o,description:i,error:a,required:s,classNames:l,className:u,__staticSelector:p,__stylesApiProps:f||r,errorProps:h,labelProps:m,descriptionProps:g,unstyled:d,styles:c,size:b,style:x,inputContainer:$,inputWrapperOrder:_,withAsterisk:C,variant:w,id:y,mod:E,...v},...T},inputProps:{required:s,classNames:l,styles:c,unstyled:d,size:b,__staticSelector:p,__stylesApiProps:f||r,error:a,variant:w,id:y}}}Input.classes=classes$k,Input.Wrapper=InputWrapper,Input.Label=InputLabel,Input.Error=InputError,Input.Description=InputDescription,Input.Placeholder=InputPlaceholder,Input.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.Wrapper,{...r,children:factory$1(Input,{...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.classes,...Input.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,f=useStyles$j({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,...f("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$1(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$1(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:f,selected:h,mod:m,...g}=n,v=useComboboxContext(),y=reactExports.useId(),b=c||y;return factory$1(Box,{...v.getStyles("option",{className:o,classNames:r,styles:a,style:i}),...g,ref:t,id:b,mod:["combobox-option",{"combobox-active":u,"combobox-disabled":f,"combobox-selected":h},m],role:"option",onClick:e=>{var t;f?e.preventDefault():(null==(t=v.onOptionSubmit)||t.call(v,n.value,n),null==l||l(e))},onMouseDown:e=>{e.preventDefault(),null==d||d(e)},onMouseOver:e=>{v.resetSelectionOnOptionHover&&v.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(),f=p.getStyles("search"),h=useComboboxTargetProps({targetType:"input",withAriaAttributes:s,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:l,autoComplete:"off"});return factory$1(Input,{ref:useMergedRef(t,p.store.searchRef),classNames:[{input:f.className},r],styles:[{input:f.style},o],size:u||p.size,...h,...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$1(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),f=reactExports.useRef(-1),h=reactExports.useRef(-1),m=reactExports.useRef(-1),g=reactExports.useCallback((e="unknown")=>{s||(l(!0),null==o||o(e))},[l,o,s]),v=reactExports.useCallback((e="unknown")=>{s&&(l(!1),null==r||r(e))},[l,r,s]),y=reactExports.useCallback((e="unknown")=>{s?v(e):g(e)},[v,g,s]),b=reactExports.useCallback(()=>{const e=document.querySelector(`#${c.current} [data-combobox-selected]`);null==e||e.removeAttribute("data-combobox-selected"),null==e||e.removeAttribute("aria-selected")},[]),x=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")?(b(),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,b]),$=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 x(n)}return x(0)},[x]),_=reactExports.useCallback(()=>x(getNextIndex$1(u.current,document.querySelectorAll(`#${c.current} [data-combobox-option]`),i)),[x,i]),C=reactExports.useCallback(()=>x(getPreviousIndex(u.current,document.querySelectorAll(`#${c.current} [data-combobox-option]`),i)),[x,i]),w=reactExports.useCallback(()=>x(getFirstIndex(document.querySelectorAll(`#${c.current} [data-combobox-option]`))),[x]),S=reactExports.useCallback((e="selected",t)=>{m.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)},[]),E=reactExports.useCallback(()=>{u.current=-1,b()},[b]),k=reactExports.useCallback(()=>{const e=document.querySelectorAll(`#${c.current} [data-combobox-option]`),t=null==e?void 0:e[u.current];null==t||t.click()},[]),T=reactExports.useCallback(e=>{c.current=e},[]),P=reactExports.useCallback(()=>{f.current=window.setTimeout(()=>d.current.focus(),0)},[]),M=reactExports.useCallback(()=>{h.current=window.setTimeout(()=>p.current.focus(),0)},[]),L=reactExports.useCallback(()=>u.current,[]);return reactExports.useEffect(()=>()=>{window.clearTimeout(f.current),window.clearTimeout(h.current),window.clearTimeout(m.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:v,toggleDropdown:y,selectedOptionIndex:u.current,getSelectedOptionIndex:L,selectOption:x,selectFirstOption:w,selectActiveOption:$,selectNextOption:_,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:S,listId:c.current,setListId:T,clickSelectedOption:k,searchRef:d,focusSearchInput:P,targetRef:p,focusTarget:M}}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:f,readOnly:h,...m}=t,g=useCombobox(),v=a||g,y=useStyles$j({name:f||"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:v,onOptionSubmit:l,size:u,resetSelectionOnOptionHover:p,readOnly:h},children:factory$1(Popover,{opened:v.dropdownOpened,...m,onClose:()=>{null==c||c(),v.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:f="left",bodyElement:h="div",labelElement:m="label",variant:g,style:v,vars:y,mod:b,...x},$)=>{const _=useStyles$j({name:e,props:t,className:n,style:v,classes:classes$i,classNames:r,styles:o,unstyled:i});return factory$1(Box,{..._("root"),ref:$,__vars:{"--label-fz":getFontSize(p),"--label-lh":getSize(p,"label-lh")},mod:[{"label-position":f},b],variant:g,size:p,...x,children:factory$1(Box,{component:h,htmlFor:"label"===h?c:void 0,..._("body"),children:[a,factory$1("div",{..._("labelWrapper"),"data-disabled":u||void 0,children:[s&&factory$1(Box,{component:m,htmlFor:"label"===m?c:void 0,..._("label"),"data-disabled":u||void 0,children:s}),l&&factory$1(Input.Description,{size:p,__inheritStyles:!1,..._("description"),children:l}),d&&"boolean"!=typeof d&&factory$1(Input.Error,{size:p,__inheritStyles:!1,..._("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:f,...h}=n,m=useStyles$j({name:"CheckboxCard",classes:classes$h,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$d,rootSelector:"card"}),g=useCheckboxGroupContext(),v="boolean"==typeof c?c:(null==g?void 0:g.value.includes(p||""))||!1;return factory$1(CheckboxCardProvider,{value:{checked:v},children:factory$1(UnstyledButton,{ref:t,mod:[{"with-border":d,checked:v},u],...m("card"),...h,role:"checkbox","aria-checked":v,onClick:e=>{null==f||f(e),null==g||g.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.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.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:f,autoContrast:h,checked:m,mod:g,variant:v,disabled:y,...b}=n,x=c,$=useStyles$j({name:"CheckboxIndicator",classes:classes$g,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$c,rootSelector:"indicator"}),_=useCheckboxCardContext(),C="boolean"==typeof m||"boolean"==typeof u?m||u:(null==_?void 0:_.checked)||!1;return factory$1(Box,{ref:t,...$("indicator",{variant:v}),variant:v,mod:[{checked:C,disabled:y},g],...b,children:factory$1(x,{indeterminate:u,...$("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:f,wrapperProps:h,checked:m,labelPosition:g,description:v,error:y,disabled:b,variant:x,indeterminate:$,icon:_,rootRef:C,iconColor:w,onChange:S,autoContrast:E,mod:k,...T}=n,P=useCheckboxGroupContext(),M=p||(null==P?void 0:P.size),L=_,I=useStyles$j({name:"Checkbox",props:n,classes:classes$f,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$b}),{styleProps:R,rest:O}=extractStyleProps(T),A=useId$1(d),D=P?{checked:P.value.includes(O.value),onChange:e=>{P.onChange(e),null==S||S(e)}}:{};return factory$1(InlineInput,{...I("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:A,size:M,labelPosition:g,label:u,description:v,error:y,disabled:b,classNames:r,styles:a,unstyled:s,"data-checked":D.checked||m||void 0,variant:x,ref:C,mod:k,...R,...h,children:factory$1(Box,{...I("inner"),mod:{"data-label-position":g},children:[factory$1(Box,{component:"input",id:A,ref:t,checked:m,disabled:b,mod:{error:!!y,indeterminate:$},...I("input",{focusable:!0,variant:x}),onChange:S,...O,...D,type:"checkbox"}),factory$1(L,{indeterminate:$,...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:f,labelId:h,renderOption:m,scrollAreaProps:g,"aria-label":v}){validateOptions(e);const y="string"==typeof o?(r||defaultOptionsFilter)({options:e,search:l?o:"",limit:i??1/0}):e,b=isEmptyComboboxData(y),x=y.map(e=>factory$1(Option,{data:e,withCheckIcon:c,value:u,checkIconPosition:d,unstyled:f,renderOption:m},isOptionsGroup(e)?e.group:e.value));return factory$1(Combobox.Dropdown,{hidden:t||n&&b,children:factory$1(Combobox.Options,{labelledBy:h,"aria-label":v,children:[s?factory$1(ScrollArea.Autosize,{mah:a??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...g,children:x}):x,b&&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),f=reactExports.useRef(0),h=reactExports.useRef(),m=function(){var e=d.current,t=n&&h.current?h.current:getSizingData$1(e);if(t){h.current=t;var i=calculateNodeHeight(t,e.value||e.placeholder||"x",o,r),a=i[0],s=i[1];f.current!==a&&(f.current=a,e.style.setProperty("height",a+"px","important"),l(a,{rowHeight:s}))}};return reactExports.useLayoutEffect(m),useWindowResizeListener(m),useFontsLoadedListener(m),reactExports.createElement("textarea",_extends({},c,{onChange:function(e){u||m(),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(),f=(null==p?void 0:p.size)||c||void 0,h=useStyles$j({name:"PillGroup",classes:classes$e,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$a,stylesCtx:{size:f},rootSelector:"group"});return factory$1(PillGroupProvider,{value:{size:f,disabled:u},children:factory$1(Box,{ref:t,size:f,...h("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:f,radius:h,size:m,disabled:g,mod:v,...y}=n,b=usePillGroupContext(),x=usePillsInputContext(),$=m||(null==b?void 0:b.size)||void 0,_="filled"===(null==x?void 0:x.variant)?"contrast":c||"default",C=useStyles$j({name:"Pill",classes:classes$e,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$9,stylesCtx:{size:$}});return factory$1(Box,{component:"span",ref:t,variant:_,size:$,...C("root",{variant:_}),mod:[{"with-remove":d&&!g,disabled:g||(null==b?void 0:b.disabled)},v],...y,children:[factory$1("span",{...C("label"),children:u}),d&&factory$1(CloseButton,{variant:"transparent",radius:h,tabIndex:-1,"aria-hidden":!0,unstyled:s,...f,...C("remove",{className:null==f?void 0:f.className,style:null==f?void 0:f.style}),onMouseDown:e=>{var t;e.preventDefault(),e.stopPropagation(),null==(t=null==f?void 0:f.onMouseDown)||t.call(f,e)},onClick:e=>{var t;e.stopPropagation(),null==p||p(),null==(t=null==f?void 0:f.onClick)||t.call(f,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:f,...h}=n,m=usePillsInputContext(),g=useInputWrapperContext(),v=useStyles$j({name:"PillsInputField",classes:classes$d,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"field"}),y=u||(null==m?void 0:m.disabled);return factory$1(Box,{component:"input",ref:useMergedRef(t,null==m?void 0:m.fieldRef),"data-type":c,disabled:y,mod:[{disabled:y,pointer:p},f],...v("field"),...h,id:(null==g?void 0:g.inputId)||d,"aria-invalid":null==m?void 0:m.hasError,"aria-describedby":null==g?void 0:g.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:f,variant:h,data:m,dropdownOpened:g,defaultDropdownOpened:v,onDropdownOpen:y,onDropdownClose:b,selectFirstOptionOnChange:x,onOptionSubmit:$,comboboxProps:_,filter:C,limit:w,withScrollArea:S,maxDropdownHeight:E,searchValue:k,defaultSearchValue:T,onSearchChange:P,readOnly:M,disabled:L,onFocus:I,onBlur:R,onPaste:O,radius:A,rightSection:D,rightSectionWidth:N,rightSectionPointerEvents:F,rightSectionProps:z,leftSection:B,leftSectionWidth:j,leftSectionPointerEvents:H,leftSectionProps:V,inputContainer:U,inputWrapperOrder:W,withAsterisk:Y,labelProps:q,descriptionProps:G,errorProps:K,wrapperProps:X,description:Z,label:J,error:Q,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:fe,hiddenInputValuesDivider:he,required:me,mod:ge,renderOption:ve,onRemove:ye,onClear:be,scrollAreaProps:xe,...$e}=n,_e=useId$1(ce),Ce=getParsedComboboxData(m),we=getOptionsLockup(Ce),Se=useCombobox({opened:g,defaultOpened:v,onDropdownOpen:y,onDropdownClose:()=>{null==b||b(),Se.resetSelectedOption()}}),{styleProps:Ee,rest:{type:ke,autoComplete:Te,...Pe}}=extractStyleProps($e),[Me,Le]=useUncontrolled({value:u,defaultValue:d,finalValue:[],onChange:p}),[Ie,Re]=useUncontrolled({value:k,defaultValue:T,finalValue:"",onChange:P}),Oe=useStyles$j({name:"MultiSelect",classes:{},props:n,classNames:r,styles:a,unstyled:s}),{resolvedClassNames:Ae,resolvedStyles:De}=useResolvedStylesApi({props:n,styles:a,classNames:r}),Ne=Me.map((e,t)=>{var n,r;return factory$1(Pill,{withRemoveButton:!M&&!(null==(n=we[e])?void 0:n.disabled),onRemove:()=>{Le(Me.filter(t=>e!==t)),null==ye||ye(e)},unstyled:s,disabled:L,...Oe("pill"),children:(null==(r=we[e])?void 0:r.label)||e})});reactExports.useEffect(()=>{x&&Se.selectFirstOption()},[x,Me]);const Fe=ue&&Me.length>0&&!L&&!M&&factory$1(Combobox.ClearButton,{size:c,...de,onClear:()=>{null==be||be(),Le([]),Re("")}}),ze=filterPickedValues({data:Ce,value:Me});return factory$1(Fragment,{children:[factory$1(Combobox,{store:Se,classNames:Ae,styles:De,unstyled:s,size:c,readOnly:M,__staticSelector:"MultiSelect",onOptionSubmit:e=>{null==$||$(e),Re(""),Se.updateSelectedOptionIndex("selected"),Me.includes(we[e].value)?(Le(Me.filter(t=>t!==we[e].value)),null==ye||ye(we[e].value)):Me.length<ee&&Le([...Me,we[e].value])},..._,children:[factory$1(Combobox.DropdownTarget,{children:factory$1(PillsInput,{...Ee,__staticSelector:"MultiSelect",classNames:Ae,styles:De,unstyled:s,size:c,className:o,style:i,variant:h,disabled:L,radius:A,rightSection:D||Fe||factory$1(Combobox.Chevron,{size:c,error:Q,unstyled:s}),rightSectionPointerEvents:F||(Fe?"all":"none"),rightSectionWidth:N,rightSectionProps:z,leftSection:B,leftSectionWidth:j,leftSectionPointerEvents:H,leftSectionProps:V,inputContainer:U,inputWrapperOrder:W,withAsterisk:Y,labelProps:q,descriptionProps:G,errorProps:K,wrapperProps:X,description:Z,label:J,error:Q,multiline:!0,withErrorStyles:ae,__stylesApiProps:{...n,rightSectionPointerEvents:F||(Fe?"all":"none"),multiline:!0},pointer:!te,onClick:()=>te?Se.openDropdown():Se.toggleDropdown(),"data-expanded":Se.dropdownOpened||void 0,id:_e,required:me,mod:ge,children:factory$1(Pill.Group,{disabled:L,unstyled:s,...Oe("pillsList"),children:[Ne,factory$1(Combobox.EventsTarget,{autoComplete:Te,children:factory$1(PillsInput.Field,{...Pe,ref:t,id:_e,placeholder:fe,type:te||fe?"visible":"hidden",...Oe("inputField"),unstyled:s,onFocus:e=>{null==I||I(e),te&&Se.openDropdown()},onBlur:e=>{null==R||R(e),Se.closeDropdown(),Re("")},onKeyDown:e=>{null==f||f(e)," "!==e.key||te||(e.preventDefault(),Se.toggleDropdown()),"Backspace"===e.key&&0===Ie.length&&Me.length>0&&(null==ye||ye(Me[Me.length-1]),Le(Me.slice(0,Me.length-1)))},value:Ie,onChange:e=>{Re(e.currentTarget.value),te&&Se.openDropdown(),x&&Se.selectFirstOption()},disabled:L,readOnly:M||!te,pointer:!te})})]})})}),factory$1(OptionsDropdown,{data:ie?ze:Ce,hidden:M||L,filter:C,search:Ie,limit:w,hiddenWhenEmpty:!ne,withScrollArea:S,maxDropdownHeight:E,filterOptions:te,value:Me,checkIconPosition:oe,withCheckIcon:re,nothingFoundMessage:ne,unstyled:s,labelId:J?`${_e}-label`:void 0,"aria-label":J?void 0:$e["aria-label"],renderOption:ve,scrollAreaProps:xe})]}),factory$1(Combobox.HiddenInput,{name:se,valuesDivider:he,value:Me,form:le,disabled:L,...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:f,name:h,onKeyDown:m,...g}=n,v=useStyles$j({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(),b=useRadioGroupContext(),x="boolean"==typeof c?c:(null==b?void 0:b.value)===p||!1,$=h||(null==b?void 0:b.name);return factory$1(RadioCardProvider,{value:{checked:x},children:factory$1(UnstyledButton,{ref:t,mod:[{"with-border":d,checked:x},u],...v("card"),...g,role:"radio","aria-checked":x,name:$,onClick:e=>{null==f||f(e),null==b||b.onChange(p||"")},onKeyDown:e=>{if(null==m||m(e),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(e.nativeEvent.code)){e.preventDefault();const t=Array.from(document.querySelectorAll(`[role="radio"][name="${$||"__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,f]=useUncontrolled({value:n,defaultValue:r,finalValue:"",onChange:o});return factory$1(RadioGroupProvider,{value:{value:p,onChange:e=>!c&&f("string"==typeof e?e:e.currentTarget.value),size:i,name:d},children:factory$1(Input.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.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:f,checked:h,mod:m,variant:g,disabled:v,...y}=n,b=c,x=useStyles$j({name:"RadioIndicator",classes:classes$b,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$7,rootSelector:"indicator"}),$=useRadioCardContext(),_="boolean"==typeof h?h:(null==$?void 0:$.checked)||!1;return factory$1(Box,{ref:t,...x("indicator",{variant:g}),variant:g,mod:[{checked:_,disabled:v},m],...y,children:factory$1(b,{...x("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:f,error:h,radius:m,color:g,variant:v,disabled:y,wrapperProps:b,icon:x=RadioIcon,rootRef:$,iconColor:_,onChange:C,mod:w,...S}=n,E=useStyles$j({name:"Radio",classes:classes$a,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$6}),k=useRadioGroupContext(),T=(null==k?void 0:k.size)??u,P=n.size?u:T,{styleProps:M,rest:L}=extractStyleProps(S),I=useId$1(c),R=k?{checked:k.value===L.value,name:L.name??k.name,onChange:e=>{k.onChange(e),null==C||C(e)}}:{};return factory$1(InlineInput,{...E("root"),__staticSelector:"Radio",__stylesApiProps:n,id:I,size:P,labelPosition:p,label:d,description:f,error:h,disabled:y,classNames:r,styles:a,unstyled:s,"data-checked":R.checked||void 0,variant:v,ref:$,mod:w,...M,...b,children:factory$1(Box,{...E("inner"),mod:{"label-position":p},children:[factory$1(Box,{...E("radio",{focusable:!0,variant:v}),onChange:C,...L,...R,component:"input",mod:{error:!!h},ref:t,id:I,disabled:y,type:"radio"}),factory$1(x,{...E("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:f,onChange:h,data:m,value:g,defaultValue:v,selectFirstOptionOnChange:y,onOptionSubmit:b,comboboxProps:x,readOnly:$,disabled:_,filter:C,limit:w,withScrollArea:S,maxDropdownHeight:E,size:k,searchable:T,rightSection:P,checkIconPosition:M,withCheckIcon:L,nothingFoundMessage:I,name:R,form:O,searchValue:A,defaultSearchValue:D,onSearchChange:N,allowDeselect:F,error:z,rightSectionPointerEvents:B,id:j,clearable:H,clearButtonProps:V,hiddenInputProps:U,renderOption:W,onClear:Y,autoComplete:q,scrollAreaProps:G,...K}=n,X=reactExports.useMemo(()=>getParsedComboboxData(m),[m]),Z=reactExports.useMemo(()=>getOptionsLockup(X),[X]),J=useId$1(j),[Q,ee,te]=useUncontrolled({value:g,defaultValue:v,finalValue:null,onChange:h}),ne="string"==typeof Q?Z[Q]:void 0,re=usePrevious(ne),[oe,ie]=useUncontrolled({value:A,defaultValue:D,finalValue:ne?ne.label:"",onChange:N}),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,Q]),reactExports.useEffect(()=>{null===g&&ie(""),"string"!=typeof g||!ne||(null==re?void 0:re.value)===ne.value&&(null==re?void 0:re.label)===ne.label||ie(ne.label)},[g,ne]);const ce=H&&!!Q&&!_&&!$&&factory$1(Combobox.ClearButton,{size:k,...V,onClear:()=>{ee(null,null),ie(""),null==Y||Y()}});return factory$1(Fragment,{children:[factory$1(Combobox,{store:ae,__staticSelector:"Select",classNames:se,styles:le,unstyled:i,readOnly:$,onOptionSubmit:e=>{null==b||b(e);const t=F&&Z[e].value===Q?null:Z[e],n=t?t.value:null;n!==Q&&ee(n,t),!te&&ie("string"==typeof n&&(null==t?void 0:t.label)||""),ae.closeDropdown()},size:k,...x,children:[factory$1(Combobox.Target,{targetType:T?"input":"button",autoComplete:q,children:factory$1(InputBase,{id:J,ref:t,rightSection:P||ce||factory$1(Combobox.Chevron,{size:k,error:z,unstyled:i}),rightSectionPointerEvents:B||(ce?"all":"none"),...K,size:k,__staticSelector:"Select",disabled:_,readOnly:$||!T,value:oe,onChange:e=>{ie(e.currentTarget.value),ae.openDropdown(),y&&ae.selectFirstOption()},onFocus:e=>{T&&ae.openDropdown(),null==d||d(e)},onBlur:e=>{var t;T&&ae.closeDropdown(),ie(null!=Q&&(null==(t=Z[Q])?void 0:t.label)||""),null==p||p(e)},onClick:e=>{T?ae.openDropdown():ae.toggleDropdown(),null==f||f(e)},classNames:se,styles:le,unstyled:i,pointer:!T,error:z})}),factory$1(OptionsDropdown,{data:X,hidden:$||_,filter:C,search:oe,limit:w,hiddenWhenEmpty:!I,withScrollArea:S,maxDropdownHeight:E,filterOptions:T&&(null==ne?void 0:ne.label)!==oe,value:Q,checkIconPosition:M,withCheckIcon:L,nothingFoundMessage:I,unstyled:i,labelId:K.label?`${J}-label`:void 0,"aria-label":K.label?void 0:K["aria-label"],renderOption:W,scrollAreaProps:G})]}),factory$1(Combobox.HiddenInput,{value:Q,name:R,form:O,disabled:_,...U})]})});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:f,isHovered:h,children:m=null,disabled:g},v)=>{const{getStyles:y}=useSliderContext(),[b,x]=reactExports.useState(!1),$=c||i||b||f&&h;return factory$1(Box,{tabIndex:0,role:"slider","aria-label":u,"aria-valuemax":e,"aria-valuemin":t,"aria-valuenow":n,ref:v,__vars:{"--slider-thumb-offset":`${r}%`},...y("thumb",{focusable:!0}),mod:{dragging:i,disabled:g},onFocus:()=>{x(!0),"function"==typeof d&&d()},onBlur:()=>{x(!1),"function"==typeof p&&p()},onTouchStart:a,onMouseDown:a,onKeyDownCapture:s,onClick:e=>e.stopPropagation(),children:[m,factory$1(Transition,{mounted:null!=o&&!!$,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:f,name:h,marks:m,label:g,labelTransitionProps:v,labelAlwaysOn:y,thumbLabel:b,showLabelOnHover:x,thumbChildren:$,disabled:_,unstyled:C,scale:w,inverted:S,className:E,style:k,vars:T,hiddenInputProps:P,...M}=n,L=useStyles$j({name:"Slider",props:n,classes:classes$9,classNames:r,className:E,styles:o,style:k,vars:T,varsResolver:varsResolver$5,unstyled:C}),{dir:I}=useDirection(),[R,O]=reactExports.useState(!1),[A,D]=useUncontrolled({value:"number"==typeof i?clamp$2(i,c,u):i,defaultValue:"number"==typeof f?clamp$2(f,c,u):f,finalValue:clamp$2(0,c,u),onChange:a}),N=reactExports.useRef(A),F=reactExports.useRef(),z=reactExports.useRef(),B=getPosition({value:A,min:c,max:u}),j=w(A),H="function"==typeof g?g(j):g,V=p??getPrecision(d),U=reactExports.useCallback(({x:e})=>{if(!_){const t=getChangeValue({value:e,min:c,max:u,step:d,precision:V});D(t),N.current=t}},[_,c,u,d,V,D]),{ref:W,active:Y}=useMove(U,{onScrubEnd:()=>null==s?void 0:s(N.current)},I);return factory$1(SliderProvider,{value:{getStyles:L},children:factory$1(SliderRoot,{...M,ref:useMergedRef(t,F),onKeyDownCapture:e=>{var t,n,r,o,i,a;if(!_)switch(e.key){case"ArrowUp":{e.preventDefault(),null==(t=z.current)||t.focus();const n=getFloatingValue(Math.min(Math.max(A+d,c),u),V);D(n),null==s||s(n);break}case"ArrowRight":{e.preventDefault(),null==(n=z.current)||n.focus();const t=getFloatingValue(Math.min(Math.max("rtl"===I?A-d:A+d,c),u),V);D(t),null==s||s(t);break}case"ArrowDown":{e.preventDefault(),null==(r=z.current)||r.focus();const t=getFloatingValue(Math.min(Math.max(A-d,c),u),V);D(t),null==s||s(t);break}case"ArrowLeft":{e.preventDefault(),null==(o=z.current)||o.focus();const t=getFloatingValue(Math.min(Math.max("rtl"===I?A+d:A-d,c),u),V);D(t),null==s||s(t);break}case"Home":e.preventDefault(),null==(i=z.current)||i.focus(),D(c),null==s||s(c);break;case"End":e.preventDefault(),null==(a=z.current)||a.focus(),D(u),null==s||s(u)}},onMouseDownCapture:()=>{var e;return null==(e=F.current)?void 0:e.focus()},size:l,disabled:_,children:[factory$1(Track,{inverted:S,offset:0,filled:B,marks:m,min:c,max:u,value:j,disabled:_,containerProps:{ref:W,onMouseEnter:x?()=>O(!0):void 0,onMouseLeave:x?()=>O(!1):void 0},children:factory$1(Thumb,{max:u,min:c,value:j,position:B,dragging:Y,label:H,ref:z,labelTransitionProps:v,labelAlwaysOn:y,thumbLabel:b,showLabelOnHover:x,isHovered:R,disabled:_,children:$})}),factory$1("input",{type:"hidden",name:h,value:j,...P})]})})});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.Wrapper,{size:i,ref:t,...a,...c,labelElement:"div",__staticSelector:"SwitchGroup",children:factory$1(InputsGroupFieldset,{role:"group",children:s})})})});SwitchGroup.classes=Input.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:f,size:h,radius:m,wrapperProps:g,thumbIcon:v,checked:y,defaultChecked:b,onChange:x,labelPosition:$,description:_,error:C,disabled:w,variant:S,rootRef:E,mod:k,...T}=n,P=useSwitchGroupContext(),M=h||(null==P?void 0:P.size),L=useStyles$j({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:R}=extractStyleProps(T),O=useId$1(f),A=P?{checked:P.value.includes(R.value),onChange:P.onChange}:{},[D,N]=useUncontrolled({value:A.checked??y,defaultValue:b,finalValue:!1});return factory$1(InlineInput,{...L("root"),__staticSelector:"Switch",__stylesApiProps:n,id:O,size:M,labelPosition:$,label:u,description:_,error:C,disabled:w,bodyElement:"label",labelElement:"span",classNames:r,styles:a,unstyled:s,"data-checked":A.checked||void 0,variant:S,ref:E,mod:k,...I,...g,children:[factory$1("input",{...R,disabled:w,checked:D,onChange:e=>{var t;P?null==(t=A.onChange)||t.call(A,e):null==x||x(e),N(e.currentTarget.checked)},id:O,ref:t,type:"checkbox",role:"switch",...L("input")}),factory$1(Box,{"aria-hidden":"true",mod:{error:C,"label-position":$,"without-labels":!p&&!d},...L("track"),children:[factory$1(Box,{component:"span",mod:"reduce-motion",...L("thumb"),children:v}),factory$1("span",{...L("trackLabel"),children:D?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$1=reactDomExports;createRoot=m$1.createRoot,m$1.hydrateRoot;const baseServices$1={alertService:Symbol("alertService"),errorService:Symbol("errorService"),layoutService:Symbol("layoutService"),loggerService:Symbol("loggerService"),routerService:Symbol("routerService")},globalServices$1={symbolGlobalService:Symbol("symbolGlobalService"),priceGlobalService:Symbol("priceGlobalService")},mockServices$1={exchangeMockService:Symbol("exchangeMockService"),notificationMockService:Symbol("notificationMockService"),storageMockService:Symbol("storageMockService")},viewServices$1={exchangeViewService:Symbol("exchangeViewService"),notificationViewService:Symbol("notificationViewService"),storageViewService:Symbol("storageViewService")},TYPES={...baseServices$1,...globalServices$1,...mockServices$1,...viewServices$1};class ErrorService{routerService=VS(TYPES.routerService);loggerService=VS(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;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;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());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)};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)}}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():pI("router-service-path",{allowed:e=>!basePathSet.has(e),map:e=>basePathSet.has(e)?"/":e}),DEFAULT_PATH$f="/",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$f}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 _e=0;_e<256;++_e)byteToHex.push((_e+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 ExchangeMockService{loggerService=VS(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}}class NotificationMockService{loggerService=VS(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=VS(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 ExchangeViewService{loggerService=VS(TYPES.loggerService);exchangeMockService=VS(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}}class NotificationViewService{loggerService=VS(TYPES.loggerService);notificationMockService=VS(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=VS(TYPES.loggerService);storageMockService=VS(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 SymbolGlobalService{loggerService=VS(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=VS(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}}WS(TYPES.errorService,()=>new ErrorService),WS(TYPES.alertService,()=>new AlertService),WS(TYPES.layoutService,()=>new LayoutService),WS(TYPES.loggerService,()=>new LoggerService),WS(TYPES.routerService,()=>new RouterService),WS(TYPES.symbolGlobalService,()=>new SymbolGlobalService),WS(TYPES.priceGlobalService,()=>new PriceGlobalService),WS(TYPES.exchangeMockService,()=>new ExchangeMockService),WS(TYPES.notificationMockService,()=>new NotificationMockService),WS(TYPES.storageMockService,()=>new StorageMockService),WS(TYPES.exchangeViewService,()=>new ExchangeViewService),WS(TYPES.notificationViewService,()=>new NotificationViewService),WS(TYPES.storageViewService,()=>new StorageViewService);const baseServices={errorService:VS(TYPES.errorService),layoutService:VS(TYPES.layoutService),loggerService:VS(TYPES.loggerService),routerService:VS(TYPES.routerService),alertService:VS(TYPES.alertService)},globalServices={symbolGlobalService:VS(TYPES.symbolGlobalService),priceGlobalService:VS(TYPES.priceGlobalService)},mockServices={exchangeMockService:VS(TYPES.exchangeMockService),notificationMockService:VS(TYPES.notificationMockService),storageMockService:VS(TYPES.storageMockService)},viewServices={exchangeViewService:VS(TYPES.exchangeViewService),notificationViewService:VS(TYPES.notificationViewService),storageViewService:VS(TYPES.storageViewService)},ioc={...baseServices,...globalServices,...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(fL(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]})},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)})},createRedirect=e=>()=>factory$1(Dw,{handler:async()=>{await e()},height:"calc(100vh - 80px)"}),getMainRoute=async()=>"/main",useStyles$i=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:"hidden",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$i();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,{}),baseRoutes=[{path:"/error_page",noHeader:!0,element:ErrorPage}],dashboardRoutes=[{path:"/main",element:KI(()=>__vitePreload(()=>import("./index-Bj6x7FsS.js"),__vite__mapDeps([0,1])))},{path:"/dashboard/:mode",element:KI(()=>__vitePreload(()=>import("./index-Cs9revcK.js"),__vite__mapDeps([2,1])))}],routes$f=[{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=XS(routes$f,ioc.routerService.location.pathname),e=n),t}})();window.getRouteItem=getRouteItem;const 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"),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"),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"),PlayArrow=createSvgIcon$1(factory$1("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),ReportProblem=createSvgIcon$1(factory$1("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"ReportProblem"),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"),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"),WarningIcon=createSvgIcon$1(factory$1("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning"),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={},_interopRequireDefault$1=interopRequireDefaultExports;Object.defineProperty(Warning,"__esModule",{value:!0});var default_1$1=Warning.default=void 0,_createSvgIcon$1=_interopRequireDefault$1(requireCreateSvgIcon()),_jsxRuntime$1=require$$2,_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.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,_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$h=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":return"#4CAF50";case"signal.closed":return"#2196F3";case"signal.scheduled":case"average_buy.commit":case"error.info":case"error.validation":return"#FF9800";case"signal.cancelled":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"risk.rejection":return"#F44336";case"error.critical":return"#D32F2F";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":return factory$1(Close,{sx:t});case"signal.scheduled":return factory$1(Schedule,{sx:t});case"signal.cancelled":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":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":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} (${e.totalEntries} ${t$1("entries")})`;case"trailing_stop.commit":return`${t$1("Trailing stop")} ${e.symbol}`;case"trailing_take.commit":return`${t$1("Trailing take")} ${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}`;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)}},NotificationView$1=()=>{const[e,t]=reactExports.useState(),{classes:n}=useStyles$h(),[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$1,{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$1(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."));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$1(e.timestamp).format("HH:mm DD/MM/YYYY"):"N/A"}),factory$1(IconButton,{disableRipple:!0,children:factory$1(default_1$k,{})})]})},e.id))})}})]})})})]})},LOADER_HEIGHT=4,LOGO_SRC="/logo/icon512_maskable.png",LOGO_CLASS="tradegpt-logo",LOGO_SIDE=32,useStyles$g=makeStyles()(e=>({root:{position:"sticky",top:0,zIndex:9,height:"80px",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:"10px",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),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}})),actions=[{action:"github-action",icon:()=>factory$1(IconWrapper,{icon:GitHub,color:"#6A1B9A "}),label:"Open GitHub"}],AppHeader=({loading:e})=>{const{classes:t,cx:n}=useStyles$g();return factory$1(Box$1,{className:t.root,children:factory$1(Box$1,{className:t.container,children:[factory$1(rb,{onClick:()=>ik("https://github.com/tripolskypetr/backtest-kit"),className:n(t.logo,LOGO_CLASS),children:factory$1(Avatar,{style:{height:LOGO_SIDE,width:LOGO_SIDE},src:LOGO_SRC})}),factory$1(Typography,{variant:"h4",onClick:()=>ik("https://github.com/tripolskypetr/backtest-kit"),className:n(t.title,LOGO_CLASS),sx:{display:{xs:"none",sm:"flex"}},children:"Backtest Kit"}),factory$1("div",{className:t.stretch}),factory$1(NotificationView$1,{}),factory$1(xa,{className:t.actionMenu,sx:{ml:{xs:1,md:2},mr:{xs:1,sm:2}},transparent:!0,onAction:async e=>{"github-action"===e&&ik("https://github.com/tripolskypetr/backtest-kit")},options:actions}),!!e&&factory$1(LinearProgress,{className:t.loader})]})})};var define_process_env_default={},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)?void 0:_process$env.NODE_ENV),DEFAULT_OPTIONS={hasSourceMap:!IS_PRODUCTION,isMinified:IS_PRODUCTION,isPrefixed:!0},globalOptions=Object.assign({},DEFAULT_OPTIONS),hasOwnProperty$1=Object.prototype.hasOwnProperty;function normalizeOptions(e){var t,n=Object.assign({},globalOptions);for(t in e)hasOwnProperty$1.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(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,f=0,h=e.length,m=[],g="",v=0,y=1,b=2,x=3,$=4,_=5,C=6,w=7,S=8,E=v,k=0,T=!1;function P(){for(var e=k;e>0;--e)g+=u}function M(){g=g.trimEnd(),p?g+=" {":(g+="\n",P(),g+="{"),"\n"!==r&&(g+="\n"),k+=1}function L(){var e;k-=1,(g=g.trimEnd()).length>0&&l&&";"!==(e=g.charAt(g.length-1))&&"{"!==e&&(g+=";"),g+="\n",P(),g+="}",m.push(g),g=""}for(;f<h;)if(n=e.charAt(f),r=e.charAt(f+1),++f,isQuote(i))g+=n,n===i&&(i=null),"\\"===n&&r===i&&(g+=r,++f);else if(isQuote(n))g+=n,i=n;else if(T)g+=n,"*"===n&&"/"===r&&(T=!1,g+=r,++f);else if("/"!==n||"*"!==r){if(E===v){if(0===m.length&&isWhitespace(n)&&0===g.length)continue;if(n<=" "||n.charCodeAt(0)>=128){E=v,g+=n;continue}if(isName(n)||"@"===n){if(0===(o=g.trimEnd()).length)m.length>0&&(g="\n\n");else{var I=o.charAt(o.length-1);if("}"===I||";"===I)g=o+"\n\n";else for(;" "===(r=g.charAt(g.length-1))||9===r.charCodeAt(0);)g=g.substr(0,g.length-1)}g+=n,E="@"===n?y:x;continue}}if(E!==y)if(E!==b)if(E!==x)if(E!==$)if(E!==_)if(E!==C)if(E!==w)E===S&&")"===n&&g.charAt(g.length-1!=="\\"?1:0)?(g+=n,E=w):g+=n;else{if("}"===n){L(),E=v,k>0&&(E=b);continue}if(";"===n){g=g.trimEnd(),g+=";\n",E=$;continue}if(g+=n,"("===n&&"l"===g.charAt(g.length-2)&&"r"===g.charAt(g.length-3)&&"u"===g.charAt(g.length-4)){E=S;continue}}else{if(!isWhitespace(n)){g+=n,E=w;continue}isQuote(r)&&(E=w)}else{if(":"===n){g=g.trimEnd(),g+=": ",E=w,isWhitespace(r)&&(E=C);continue}if("}"===n){L(),E=v,k>0&&(E=b);continue}g+=n}else{if("}"===n){L(),E=v,k>0&&(E=b);continue}if("\n"===n){g=g.trimEnd(),g+="\n";continue}if(!isWhitespace(n)){g=g.trimEnd(),g+="\n",P(),g+=n,E=_;continue}g+=n}else{if("{"===n){M(),E=$;continue}if("}"===n){L(),E=v;continue}g+=n}else{if(isName(n)){if(0===(o=g.trimEnd()).length)m.length>0&&(g="\n\n");else if("}"===o.charAt(o.length-1))g=o+"\n\n";else for(;" "===(r=g.charAt(g.length-1))||9===r.charCodeAt(0);)g=g.substr(0,g.length-1);P(),g+=n,E=x;continue}if("}"===n){L(),E=v;continue}g+=n}else{if(";"===n){g+=n,E=v;continue}if("{"===n){o=g.trimEnd(),M(),E="@font-face"===o?$:b;continue}g+=n}}else T=!0,g+=n,g+=r,++f;return g=m.join("")+g}function getProcessedStyles(e,t){return serialize(compile(e),t.isPrefixed?middleware([prefixer$1,stringify]):stringify)}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(Zk,{})}),Fragment2=()=>factory$1(Fragment,{}),useStyles$f=makeStyles()(e=>({switch:{paddingLeft:e.spacing(1),paddingRight:e.spacing(1)}})),handleInit=so(async()=>{await HS.waitForProvide(!0),await HS.prefetch(!0)}),handleLoadStart=()=>{ioc.layoutService.setAppbarLoader(!0)},handleLoadEnd=()=>{ioc.layoutService.setAppbarLoader(!1)},App=()=>{const{classes:e}=useStyles$f(),[t,n]=reactExports.useState(getRouteItem),[r,o]=reactExports.useState(ioc.routerService.location.pathname),[i,a]=reactExports.useState(ioc.layoutService.hasAppbarLoader),[s,l]=reactExports.useState(ioc.layoutService.hasModalLoader),c=reactExports.useMemo(()=>!(null==t?void 0:t.noHeader),[t]);return Xf(()=>ioc.routerService.reloadSubject.subscribe(()=>{n(getRouteItem()),o(ioc.routerService.location.pathname)})),Xf(()=>ioc.layoutService.appbarSubject.subscribe(()=>{a(ioc.layoutService.hasAppbarLoader)})),Xf(()=>ioc.layoutService.modalSubject.subscribe(()=>{l(ioc.layoutService.hasModalLoader)})),factory$1(Fragment,{children:[c&&factory$1(AppHeader,{loading:i}),factory$1(Gg,{className:e.switch,Loader:Fragment2,history:ioc.routerService,items:routes$f,fallback:ioc.errorService.handleGlobalError,onLoadStart:handleLoadStart,onLoadEnd:handleLoadEnd,onInit:handleInit}),s&&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)"}}},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],f=24===p?0:p,h=i[0]+"-"+i[1]+"-"+i[2]+" "+f+":"+i[4]+":"+i[5]+":000",m=+t;return(o.utc(h).valueOf()-(m-=m%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$1(e).tz(t).utcOffset()+e.getTimezoneOffset():0}J$1.extend(utcPlugin),J$1.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$1(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:f,selected:h,renderDay:m,inRange:g,firstInRange:v,lastInRange:y,hidden:b,static:x,highlightToday:$,..._}=n,C=useStyles$j({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"}),w=useDatesContext();return factory$1(UnstyledButton,{...C("day",{style:b?{display:"none"}:void 0}),component:x?"div":"button",ref:t,disabled:u,"data-today":J$1(c).isSame(shiftTimezone("add",new Date,w.getTimezone()),"day")||void 0,"data-hidden":b||void 0,"data-highlight-today":$||void 0,"data-disabled":u||void 0,"data-weekend":!u&&!f&&p||void 0,"data-outside":!u&&f||void 0,"data-selected":!u&&h||void 0,"data-in-range":g&&!u||void 0,"data-first-in-range":v&&!u||void 0,"data-last-in-range":y&&!u||void 0,"data-static":x||void 0,unstyled:s,..._,children:(null==m?void 0:m(c))||c.getDate()})});function getWeekdayNames({locale:e,format:t="dd",firstDayOfWeek:n=1}){const r=J$1().day(n),o=[];for(let i=0;i<7;i+=1)"string"==typeof t?o.push(J$1(r).add(i,"days").locale(e).format(t)):o.push(t(J$1(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:f,...h}=n,m=useStyles$j({name:f||"WeekdaysRow",classes:classes$6,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$2,rootSelector:"weekdaysRow"}),g=useDatesContext(),v=getWeekdayNames({locale:g.getLocale(c),format:d,firstDayOfWeek:g.getFirstDayOfWeek(u)}).map((e,t)=>factory$1(p,{...m("weekday"),children:e}));return factory$1(Box,{component:"tr",ref:t,...m("weekdaysRow"),...h,children:v})});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$1(e).isAfter(J$1(t).subtract(1,"day"),"day")}function isBeforeMaxDate(e,t){return!(t instanceof Date)||J$1(e).isBefore(J$1(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$1().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:f,weekendDays:h,getDayProps:m,excludeDate:g,minDate:v,maxDate:y,renderDay:b,hideOutsideDates:x,hideWeekdays:$,getDayAriaLabel:_,static:C,__getDayRef:w,__onDayKeyDown:S,__onDayClick:E,__onDayMouseEnter:k,__preventFocus:T,__stopPropagation:P,withCellSpacing:M,size:L,highlightToday:I,...R}=n,O=useStyles$j({name:c||"Month",classes:classes$5,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,rootSelector:"month"}),A=useDatesContext(),D=getMonthDays({month:f,firstDayOfWeek:A.getFirstDayOfWeek(d),consistentWeeks:A.consistentWeeks}),N=getDateInTabOrder(D,v,y,m,g,x,f),{resolvedClassNames:F,resolvedStyles:z}=useResolvedStylesApi({classNames:r,styles:a,props:n}),B=D.map((e,t)=>{const n=e.map((e,n)=>{const r=!isSameMonth(e,f),o=(null==_?void 0:_(e))||J$1(e).locale(u||A.locale).format("D MMMM YYYY"),i=null==m?void 0:m(e),a=J$1(e).isSame(N,"date");return factory$1("td",{...O("monthCell"),"data-with-spacing":M||void 0,children:factory$1(Day,{__staticSelector:c||"Month",classNames:F,styles:z,unstyled:s,"data-mantine-stop-propagation":P||void 0,highlightToday:I,renderDay:b,date:e,size:L,weekend:A.getWeekendDays(h).includes(e.getDay()),outside:r,hidden:!!x&&r,"aria-label":o,static:C,disabled:(null==g?void 0:g(e))||!isBeforeMaxDate(e,y)||!isAfterMinDate(e,v),ref:e=>null==w?void 0:w(t,n,e),...i,onKeyDown:r=>{var o;null==(o=null==i?void 0:i.onKeyDown)||o.call(i,r),null==S||S(r,{rowIndex:t,cellIndex:n,date:e})},onMouseEnter:t=>{var n;null==(n=null==i?void 0:i.onMouseEnter)||n.call(i,t),null==k||k(t,e)},onClick:t=>{var n;null==(n=null==i?void 0:i.onClick)||n.call(i,t),null==E||E(t,e)},onMouseDown:e=>{var t;null==(t=null==i?void 0:i.onMouseDown)||t.call(i,e),T&&e.preventDefault()},tabIndex:T||!a?-1:0})},e.toString())});return factory$1("tr",{...O("monthRow"),children:n})});return factory$1(Box,{component:"table",...O("month"),size:L,ref:t,...R,children:[!$&&factory$1("thead",{...O("monthThead"),children:factory$1(WeekdaysRow,{__staticSelector:c||"Month",locale:u,firstDayOfWeek:d,weekdayFormat:p,size:L,classNames:F,styles:z,unstyled:s})}),factory$1("tbody",{...O("monthTbody"),children:B})]})});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:f,disabled:h,...m}=n,g=useStyles$j({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,{...g("pickerControl"),ref:t,unstyled:s,"data-picker-control":!0,"data-selected":f&&!h||void 0,"data-disabled":h||void 0,"data-in-range":d&&!h&&!f||void 0,"data-first-in-range":c&&!h||void 0,"data-last-in-range":u&&!h||void 0,disabled:h,...m})});function isYearDisabled(e,t,n){return!(!t&&!n)&&(!(!t||!J$1(e).isBefore(t,"year"))||!(!n||!J$1(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$1().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:f,getYearControlProps:h,__staticSelector:m,__getControlRef:g,__onControlKeyDown:v,__onControlClick:y,__onControlMouseEnter:b,__preventFocus:x,__stopPropagation:$,withCellSpacing:_,size:C,...w}=n,S=useStyles$j({name:m||"YearsList",classes:classes$3,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,rootSelector:"yearsList"}),E=useDatesContext(),k=getYearsData(c),T=getYearInTabOrder(k,p,f,h),P=k.map((e,t)=>{const n=e.map((e,n)=>{const r=null==h?void 0:h(e),o=J$1(e).isSame(T,"year");return factory$1("td",{...S("yearsListCell"),"data-with-spacing":_||void 0,children:factory$1(PickerControl,{...S("yearsListControl"),size:C,unstyled:s,"data-mantine-stop-propagation":$||void 0,disabled:isYearDisabled(e,p,f),ref:e=>null==g?void 0:g(t,n,e),...r,onKeyDown:o=>{var i;null==(i=null==r?void 0:r.onKeyDown)||i.call(r,o),null==v||v(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==b||b(t,e)},onMouseDown:e=>{var t;null==(t=null==r?void 0:r.onMouseDown)||t.call(r,e),x&&e.preventDefault()},tabIndex:x||!o?-1:0,children:J$1(e).locale(E.getLocale(d)).format(u)})})});return factory$1("tr",{...S("yearsListRow"),children:n})});return factory$1(Box,{component:"table",ref:t,size:C,...S("yearsList"),...w,children:factory$1("tbody",{children:P})})});function isMonthDisabled(e,t,n){return!(!t&&!n)&&(!(!t||!J$1(e).isBefore(t,"month"))||!(!n||!J$1(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$1().isSame(e,"month"));return a||o[0]}function getMonthsData(e){const t=J$1(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$1(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:f,maxDate:h,getMonthControlProps:m,__getControlRef:g,__onControlKeyDown:v,__onControlClick:y,__onControlMouseEnter:b,__preventFocus:x,__stopPropagation:$,withCellSpacing:_,size:C,...w}=n,S=useStyles$j({name:c||"MonthsList",classes:classes$2,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,rootSelector:"monthsList"}),E=useDatesContext(),k=getMonthsData(u),T=getMonthInTabOrder(k,f,h,m),P=k.map((e,t)=>{const n=e.map((e,n)=>{const r=null==m?void 0:m(e),o=J$1(e).isSame(T,"month");return factory$1("td",{...S("monthsListCell"),"data-with-spacing":_||void 0,children:factory$1(PickerControl,{...S("monthsListControl"),size:C,unstyled:s,__staticSelector:c||"MonthsList","data-mantine-stop-propagation":$||void 0,disabled:isMonthDisabled(e,f,h),ref:e=>null==g?void 0:g(t,n,e),...r,onKeyDown:o=>{var i;null==(i=null==r?void 0:r.onKeyDown)||i.call(r,o),null==v||v(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==b||b(t,e)},onMouseDown:e=>{var t;null==(t=null==r?void 0:r.onMouseDown)||t.call(r,e),x&&e.preventDefault()},tabIndex:x||!o?-1:0,children:J$1(e).locale(E.getLocale(p)).format(d)})})});return factory$1("tr",{...S("monthsListRow"),children:n})});return factory$1(Box,{component:"table",ref:t,size:C,...S("monthsList"),...w,children:factory$1("tbody",{children:P})})});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:f,onPrevious:h,onLevelClick:m,label:g,nextDisabled:v,previousDisabled:y,hasNextLevel:b,levelControlAriaLabel:x,withNext:$,withPrevious:_,__staticSelector:C,__preventFocus:w,__stopPropagation:S,...E}=n,k=useStyles$j({name:C||"CalendarHeader",classes:classes$1,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver,rootSelector:"calendarHeader"}),T=w?e=>e.preventDefault():void 0;return factory$1(Box,{...k("calendarHeader"),ref:t,...E,children:[_&&factory$1(UnstyledButton,{...k("calendarHeaderControl"),"data-direction":"previous","aria-label":p,onClick:h,unstyled:s,onMouseDown:T,disabled:y,"data-disabled":y||void 0,tabIndex:w||y?-1:0,"data-mantine-stop-propagation":S||void 0,children:u||factory$1(AccordionChevron,{...k("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})}),factory$1(UnstyledButton,{component:b?"button":"div",...k("calendarHeaderLevel"),onClick:b?m:void 0,unstyled:s,onMouseDown:b?T:void 0,disabled:!b,"data-static":!b||void 0,"aria-label":x,tabIndex:w||!b?-1:0,"data-mantine-stop-propagation":S||void 0,children:g}),$&&factory$1(UnstyledButton,{...k("calendarHeaderControl"),"data-direction":"next","aria-label":d,onClick:f,unstyled:s,onMouseDown:T,disabled:v,"data-disabled":v||void 0,tabIndex:w||v?-1:0,"data-mantine-stop-propagation":S||void 0,children:c||factory$1(AccordionChevron,{...k("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:f,__preventFocus:h,nextIcon:m,previousIcon:g,nextLabel:v,previousLabel:y,onNext:b,onPrevious:x,nextDisabled:$,previousDisabled:_,levelControlAriaLabel:C,withNext:w,withPrevious:S,decadeLabelFormat:E,classNames:k,styles:T,unstyled:P,__staticSelector:M,__stopPropagation:L,size:I,...R}=n,O=useDatesContext(),[A,D]=getDecadeRange(r),N={__staticSelector:M||"DecadeLevel",classNames:k,styles:T,unstyled:P,size:I},F="boolean"==typeof $?$:!!a&&!J$1(D).endOf("year").isBefore(a),z="boolean"==typeof _?_:!!i&&!J$1(A).startOf("year").isAfter(i),B=(e,t)=>J$1(e).locale(o||O.locale).format(t);return factory$1(Box,{"data-decade-level":!0,size:I,ref:t,...R,children:[factory$1(CalendarHeader,{label:"function"==typeof E?E(A,D):`${B(A,E)} – ${B(D,E)}`,__preventFocus:h,__stopPropagation:L,nextIcon:m,previousIcon:g,nextLabel:v,previousLabel:y,onNext:b,onPrevious:x,nextDisabled:F,previousDisabled:z,hasNextLevel:!1,levelControlAriaLabel:C,withNext:w,withPrevious:S,...N}),factory$1(YearsList,{decade:r,locale:o,minDate:i,maxDate:a,yearsListFormat:s,getYearControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:p,__preventFocus:h,__stopPropagation:L,withCellSpacing:f,...N})]})});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:f,__preventFocus:h,nextIcon:m,previousIcon:g,nextLabel:v,previousLabel:y,onNext:b,onPrevious:x,onLevelClick:$,nextDisabled:_,previousDisabled:C,hasNextLevel:w,levelControlAriaLabel:S,withNext:E,withPrevious:k,yearLabelFormat:T,__staticSelector:P,__stopPropagation:M,size:L,classNames:I,styles:R,unstyled:O,...A}=n,D=useDatesContext(),N={__staticSelector:P||"YearLevel",classNames:I,styles:R,unstyled:O,size:L},F="boolean"==typeof _?_:!!a&&!J$1(r).endOf("year").isBefore(a),z="boolean"==typeof C?C:!!i&&!J$1(r).startOf("year").isAfter(i);return factory$1(Box,{"data-year-level":!0,size:L,ref:t,...A,children:[factory$1(CalendarHeader,{label:"function"==typeof T?T(r):J$1(r).locale(o||D.locale).format(T),__preventFocus:h,__stopPropagation:M,nextIcon:m,previousIcon:g,nextLabel:v,previousLabel:y,onNext:b,onPrevious:x,onLevelClick:$,nextDisabled:F,previousDisabled:z,hasNextLevel:w,levelControlAriaLabel:S,withNext:E,withPrevious:k,...N}),factory$1(MonthsList,{year:r,locale:o,minDate:i,maxDate:a,monthsListFormat:s,getMonthControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:p,__preventFocus:h,__stopPropagation:M,withCellSpacing:f,...N})]})});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:f,hideWeekdays:h,getDayAriaLabel:m,__getDayRef:g,__onDayKeyDown:v,__onDayClick:y,__onDayMouseEnter:b,withCellSpacing:x,highlightToday:$,__preventFocus:_,__stopPropagation:C,nextIcon:w,previousIcon:S,nextLabel:E,previousLabel:k,onNext:T,onPrevious:P,onLevelClick:M,nextDisabled:L,previousDisabled:I,hasNextLevel:R,levelControlAriaLabel:O,withNext:A,withPrevious:D,monthLabelFormat:N,classNames:F,styles:z,unstyled:B,__staticSelector:j,size:H,static:V,...U}=n,W=useDatesContext(),Y={__staticSelector:j||"MonthLevel",classNames:F,styles:z,unstyled:B,size:H},q="boolean"==typeof L?L:!!d&&!J$1(r).endOf("month").isBefore(d),G="boolean"==typeof I?I:!!u&&!J$1(r).startOf("month").isAfter(u);return factory$1(Box,{"data-month-level":!0,size:H,ref:t,...U,children:[factory$1(CalendarHeader,{label:"function"==typeof N?N(r):J$1(r).locale(o||W.locale).format(N),__preventFocus:_,__stopPropagation:C,nextIcon:w,previousIcon:S,nextLabel:E,previousLabel:k,onNext:T,onPrevious:P,onLevelClick:M,nextDisabled:q,previousDisabled:G,hasNextLevel:R,levelControlAriaLabel:O,withNext:A,withPrevious:D,...Y}),factory$1(Month,{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:a,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:d,renderDay:p,hideOutsideDates:f,hideWeekdays:h,getDayAriaLabel:m,__getDayRef:g,__onDayKeyDown:v,__onDayClick:y,__onDayMouseEnter:b,__preventFocus:_,__stopPropagation:C,static:V,withCellSpacing:x,highlightToday:$,...Y})]})});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$j({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:f,previousIcon:h,nextLabel:m,previousLabel:g,onNext:v,onPrevious:y,nextDisabled:b,previousDisabled:x,classNames:$,styles:_,unstyled:C,__staticSelector:w,__stopPropagation:S,numberOfColumns:E,levelControlAriaLabel:k,decadeLabelFormat:T,size:P,vars:M,...L}=n,I=reactExports.useRef([]),R=Array(E).fill(0).map((e,t)=>{const n=J$1(r).add(10*t,"years").toDate();return factory$1(DecadeLevel,{size:P,yearsListFormat:s,decade:n,withNext:t===E-1,withPrevious:0===t,decadeLabelFormat:T,__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 k?k(n):k,locale:o,minDate:i,maxDate:a,__preventFocus:p,__stopPropagation:S,nextIcon:f,previousIcon:h,nextLabel:m,previousLabel:g,onNext:v,onPrevious:y,nextDisabled:b,previousDisabled:x,getYearControlProps:l,__staticSelector:w||"DecadeLevelGroup",classNames:$,styles:_,unstyled:C,withCellSpacing:d})});return factory$1(LevelsGroup,{classNames:$,styles:_,__staticSelector:w||"DecadeLevelGroup",ref:t,size:P,unstyled:C,...L,children:R})});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:f,previousIcon:h,nextLabel:m,previousLabel:g,onNext:v,onPrevious:y,onLevelClick:b,nextDisabled:x,previousDisabled:$,hasNextLevel:_,classNames:C,styles:w,unstyled:S,__staticSelector:E,__stopPropagation:k,numberOfColumns:T,levelControlAriaLabel:P,yearLabelFormat:M,size:L,vars:I,...R}=n,O=reactExports.useRef([]),A=Array(T).fill(0).map((e,t)=>{const n=J$1(r).add(t,"years").toDate();return factory$1(YearLevel,{size:L,monthsListFormat:s,year:n,withNext:t===T-1,withPrevious:0===t,yearLabelFormat:M,__stopPropagation:k,__onControlClick:c,__onControlMouseEnter:u,__onControlKeyDown:(e,n)=>handleControlKeyDown({levelIndex:t,rowIndex:n.rowIndex,cellIndex:n.cellIndex,event:e,controlsRef:O}),__getControlRef:(e,n,r)=>{Array.isArray(O.current[t])||(O.current[t]=[]),Array.isArray(O.current[t][e])||(O.current[t][e]=[]),O.current[t][e][n]=r},levelControlAriaLabel:"function"==typeof P?P(n):P,locale:o,minDate:i,maxDate:a,__preventFocus:p,nextIcon:f,previousIcon:h,nextLabel:m,previousLabel:g,onNext:v,onPrevious:y,onLevelClick:b,nextDisabled:x,previousDisabled:$,hasNextLevel:_,getMonthControlProps:l,classNames:C,styles:w,unstyled:S,__staticSelector:E||"YearLevelGroup",withCellSpacing:d})});return factory$1(LevelsGroup,{classNames:C,styles:w,__staticSelector:E||"YearLevelGroup",ref:t,size:L,unstyled:S,...R,children:A})});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:f,hideWeekdays:h,getDayAriaLabel:m,__onDayClick:g,__onDayMouseEnter:v,withCellSpacing:y,highlightToday:b,__preventFocus:x,nextIcon:$,previousIcon:_,nextLabel:C,previousLabel:w,onNext:S,onPrevious:E,onLevelClick:k,nextDisabled:T,previousDisabled:P,hasNextLevel:M,classNames:L,styles:I,unstyled:R,numberOfColumns:O,levelControlAriaLabel:A,monthLabelFormat:D,__staticSelector:N,__stopPropagation:F,size:z,static:B,vars:j,...H}=n,V=reactExports.useRef([]),U=Array(O).fill(0).map((e,t)=>{const n=J$1(r).add(t,"months").toDate();return factory$1(MonthLevel,{month:n,withNext:t===O-1,withPrevious:0===t,monthLabelFormat:D,__stopPropagation:F,__onDayClick:g,__onDayMouseEnter:v,__onDayKeyDown:(e,n)=>handleControlKeyDown({levelIndex:t,rowIndex:n.rowIndex,cellIndex:n.cellIndex,event:e,controlsRef:V}),__getDayRef:(e,n,r)=>{Array.isArray(V.current[t])||(V.current[t]=[]),Array.isArray(V.current[t][e])||(V.current[t][e]=[]),V.current[t][e][n]=r},levelControlAriaLabel:"function"==typeof A?A(n):A,locale:o,firstDayOfWeek:i,weekdayFormat:a,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:d,renderDay:p,hideOutsideDates:f,hideWeekdays:h,getDayAriaLabel:m,__preventFocus:x,nextIcon:$,previousIcon:_,nextLabel:C,previousLabel:w,onNext:S,onPrevious:E,onLevelClick:k,nextDisabled:T,previousDisabled:P,hasNextLevel:M,classNames:L,styles:I,unstyled:R,__staticSelector:N||"MonthLevelGroup",size:z,static:B,withCellSpacing:y,highlightToday:b})});return factory$1(LevelsGroup,{classNames:L,styles:I,__staticSelector:N||"MonthLevelGroup",ref:t,size:z,...H,children:U})});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:f,ariaLabels:h,onYearSelect:m,onMonthSelect:g,onYearMouseEnter:v,onMonthMouseEnter:y,__updateDateOnYearSelect:b,__updateDateOnMonthSelect:x,firstDayOfWeek:$,weekdayFormat:_,weekendDays:C,getDayProps:w,excludeDate:S,renderDay:E,hideOutsideDates:k,hideWeekdays:T,getDayAriaLabel:P,monthLabelFormat:M,nextIcon:L,previousIcon:I,__onDayClick:R,__onDayMouseEnter:O,withCellSpacing:A,highlightToday:D,monthsListFormat:N,getMonthControlProps:F,yearLabelFormat:z,yearsListFormat:B,getYearControlProps:j,decadeLabelFormat:H,classNames:V,styles:U,unstyled:W,minDate:Y,maxDate:q,locale:G,__staticSelector:K,size:X,__preventFocus:Z,__stopPropagation:J,onNextDecade:Q,onPreviousDecade:ee,onNextYear:te,onPreviousYear:ne,onNextMonth:re,onPreviousMonth:oe,static:ie,__timezoneApplied:ae,...se}=n,{resolvedClassNames:le,resolvedStyles:ce}=useResolvedStylesApi({classNames:V,styles:U,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,fe]=useUncontrolledDates({type:"default",value:c,defaultValue:u,onChange:d,applyTimezone:!ae}),he={__staticSelector:K||"Calendar",styles:ce,classNames:le,unstyled:W,size:X},me=useDatesContext(),ge=f||p||1,ve=new Date,ye=pe||shiftTimezone("add",Y&&Y>ve?Y:ve,me.getTimezone());return factory$1(Box,{ref:t,size:X,"data-calendar":!0,...se,children:["month"===ue&&factory$1(MonthLevelGroup,{month:ye,minDate:Y,maxDate:q,firstDayOfWeek:$,weekdayFormat:_,weekendDays:C,getDayProps:w,excludeDate:S,renderDay:E,hideOutsideDates:k,hideWeekdays:T,getDayAriaLabel:P,onNext:()=>{const e=J$1(ye).add(ge,"month").toDate();null==re||re(e),fe(e)},onPrevious:()=>{const e=J$1(ye).subtract(ge,"month").toDate();null==oe||oe(e),fe(e)},hasNextLevel:"month"!==o,onLevelClick:()=>de("year"),numberOfColumns:p,locale:G,levelControlAriaLabel:null==h?void 0:h.monthLevelControl,nextLabel:null==h?void 0:h.nextMonth,nextIcon:L,previousLabel:null==h?void 0:h.previousMonth,previousIcon:I,monthLabelFormat:M,__onDayClick:R,__onDayMouseEnter:O,__preventFocus:Z,__stopPropagation:J,static:ie,withCellSpacing:A,highlightToday:D,...he}),"year"===ue&&factory$1(YearLevelGroup,{year:ye,numberOfColumns:p,minDate:Y,maxDate:q,monthsListFormat:N,getMonthControlProps:F,locale:G,onNext:()=>{const e=J$1(ye).add(ge,"year").toDate();null==te||te(e),fe(e)},onPrevious:()=>{const e=J$1(ye).subtract(ge,"year").toDate();null==ne||ne(e),fe(e)},hasNextLevel:"month"!==o&&"year"!==o,onLevelClick:()=>de("decade"),levelControlAriaLabel:null==h?void 0:h.yearLevelControl,nextLabel:null==h?void 0:h.nextYear,nextIcon:L,previousLabel:null==h?void 0:h.previousYear,previousIcon:I,yearLabelFormat:z,__onControlMouseEnter:y,__onControlClick:(e,t)=>{x&&fe(t),de(clampLevel("month",i,o)),null==g||g(t)},__preventFocus:Z,__stopPropagation:J,withCellSpacing:A,...he}),"decade"===ue&&factory$1(DecadeLevelGroup,{decade:ye,minDate:Y,maxDate:q,yearsListFormat:B,getYearControlProps:j,locale:G,onNext:()=>{const e=J$1(ye).add(10*ge,"year").toDate();null==Q||Q(e),fe(e)},onPrevious:()=>{const e=J$1(ye).subtract(10*ge,"year").toDate();null==ee||ee(e),fe(e)},numberOfColumns:p,nextLabel:null==h?void 0:h.nextDecade,nextIcon:L,previousLabel:null==h?void 0:h.previousDecade,previousIcon:I,decadeLabelFormat:H,__onControlMouseEnter:v,__onControlClick:(e,t)=>{b&&fe(t),de(clampLevel("year",i,o)),null==m||m(t)},__preventFocus:Z,__stopPropagation:J,withCellSpacing:A,...he})]})});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:f,onYearSelect:h,onMonthSelect:m,onYearMouseEnter:g,onMonthMouseEnter:v,onNextMonth:y,onPreviousMonth:b,onNextYear:x,onPreviousYear:$,onNextDecade:_,onPreviousDecade:C,withCellSpacing:w,highlightToday:S,__updateDateOnYearSelect:E,__updateDateOnMonthSelect:k,firstDayOfWeek:T,weekdayFormat:P,weekendDays:M,getDayProps:L,excludeDate:I,renderDay:R,hideOutsideDates:O,hideWeekdays:A,getDayAriaLabel:D,monthLabelFormat:N,monthsListFormat:F,getMonthControlProps:z,yearLabelFormat:B,yearsListFormat:j,getYearControlProps:H,decadeLabelFormat:V,allowSingleDateInRange:U,allowDeselect:W,minDate:Y,maxDate:q,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:f,onYearSelect:h,onMonthSelect:m,onYearMouseEnter:g,onMonthMouseEnter:v,onNextMonth:y,onPreviousMonth:b,onNextYear:x,onPreviousYear:$,onNextDecade:_,onPreviousDecade:C,withCellSpacing:w,highlightToday:S,__updateDateOnYearSelect:E,__updateDateOnMonthSelect:k,firstDayOfWeek:T,weekdayFormat:P,weekendDays:M,getDayProps:L,excludeDate:I,renderDay:R,hideOutsideDates:O,hideWeekdays:A,getDayAriaLabel:D,monthLabelFormat:N,monthsListFormat:F,getMonthControlProps:z,yearLabelFormat:B,yearsListFormat:j,getYearControlProps:H,decadeLabelFormat:V,allowSingleDateInRange:U,allowDeselect:W,minDate:Y,maxDate:q,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$1(e).isAfter(t,"date"))&&(!n||!J$1(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:f,dateParser:h,minDate:m,maxDate:g,fixOnBlur:v,onFocus:y,onBlur:b,onClick:x,readOnly:$,name:_,form:C,rightSection:w,unstyled:S,classNames:E,styles:k,allowDeselect:T,preserveTime:P,date:M,defaultDate:L,onDateChange:I,...R}=n,[O,A]=reactExports.useState(!1),{calendarProps:D,others:N}=pickCalendarProps(R),F=useDatesContext(),z=h||(e=>{const t=J$1(e,f,F.getLocale(p)).toDate();return Number.isNaN(t.getTime())?dateStringParser(e,F.getTimezone()):t}),B=void 0!==T?T:l,j=e=>e?J$1(e).locale(F.getLocale(p)).format(f):"",[H,V,U]=useUncontrolledDates({type:"default",value:i,defaultValue:a,onChange:s}),[W,Y]=useUncontrolledDates({type:"default",value:M,defaultValue:a||L,onChange:I});reactExports.useEffect(()=>{U&&Y(i)},[U,i]);const[q,G]=reactExports.useState(j(H));reactExports.useEffect(()=>{G(j(H))},[F.getLocale(p)]);const K=w||(l&&H&&!$?factory$1(CloseButton,{variant:"transparent",onMouseDown:e=>e.preventDefault(),tabIndex:-1,onClick:()=>{V(null),!U&&G(""),A(!1)},unstyled:S,size:r.size||"sm",...c}):null);return useDidUpdate(()=>{void 0!==H&&!O&&G(j(H))},[H]),factory$1(Fragment,{children:[factory$1(Input.Wrapper,{...o,__staticSelector:"DateInput",children:factory$1(Popover,{opened:O,trapFocus:!1,position:"bottom-start",disabled:$,withRoles:!1,unstyled:S,...u,children:[factory$1(Popover.Target,{children:factory$1(Input,{"data-dates-input":!0,"data-read-only":$||void 0,autoComplete:"off",ref:t,value:q,onChange:e=>{const t=e.currentTarget.value;if(G(t),A(!0),""===t.trim()&&l)V(null);else{const e=z(t);isDateValid({date:e,minDate:m,maxDate:g})&&(V(e),Y(e))}},onBlur:e=>{null==b||b(e),A(!1),v&&G(j(H))},onFocus:e=>{null==y||y(e),A(!0)},onClick:e=>{null==x||x(e),A(!0)},readOnly:$,rightSection:K,...r,...N,__staticSelector:"DateInput"})}),factory$1(Popover.Dropdown,{onMouseDown:e=>e.preventDefault(),"data-dates-dropdown":!0,children:factory$1(Calendar,{__staticSelector:"DateInput",__timezoneApplied:!0,...D,classNames:E,styles:k,unstyled:S,__preventFocus:!0,minDate:m,maxDate:g,locale:p,getDayProps:e=>({...null==d?void 0:d(e),selected:J$1(H).isSame(e,"day"),onClick:()=>{const t=P?assignTime(H,e):e,n=l&&B&&J$1(H).isSame(e,"day")?null:t;V(n),!U&&G(j(n)),A(!1)}}),size:r.size,date:W,onDateChange:Y})})]})}),factory$1(HiddenDatesInput,{name:_,form:C,value:H,type:"default"})]})});DateInput.classes={...Input.classes,...Calendar.classes},DateInput.displayName="@mantine/dates/DateInput";
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([e.to,r,o,e.from]);const i=resolve([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([e.to,t,r,e.from]),this._from=resolve([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$2(e))return;const t=Object.keys(defaults.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{const o=e[r];if(!isObject$2(o))return;const i={};for(const e of t)i[e]=o[e];(isArray(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$2(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(t)===sign(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 f=0;f<d;++f){const e=t[f],{[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$2(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(r[e])?this.parseArrayData(n,r,e,t):isObject$2(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,f;for(d=0,p=r;d<p;++d)f=d+n,u[d]={[a]:c||o.parse(l[f],f),[s]:i.parse(t[f],f)};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 f(){p=r[d];const t=p[a.axis];return!isNumberFinite(p[e.axis])||c>t||u<t}for(d=0;d<i&&(f()||(this.updateRangeFromParsed(l,e,p,s),!o));++d);if(o)for(d=i-1;d>=0;--d)if(!f()){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.elements[e]),f=l.resolveNamedOptions(d,p,()=>this.getContext(n,r,t),u);return f.$shared&&(f.$shared=s,o[i]=Object.freeze(cloneIfNotShared(f,s))),f}_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 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 f=s(t,p);f<l?(a=[{element:n,datasetIndex:c,index:u}],l=f):f===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$2(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(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 f=Object.assign({maxPadding:p,w:i,h:a,x:o.left,y:o.top},o),h=setLayoutDims(l.concat(c),d);fitBoxes(s.fullSize,f,d,h),fitBoxes(l,f,d,h),fitBoxes(c,f,d,h)&&fitBoxes(l,f,d,h),handleMaxPadding(f),placeBoxes(s.leftAndTop,f,d,h),f.x+=f.w,f.y+=f.h,placeBoxes(s.rightAndBottom,f,d,h),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},each(s.chartArea,t=>{const n=t.box;Object.assign(n,e.chartArea),n.update(f.w,f.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$1=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$1(this.x)&&isNumber$1(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(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(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,f,h=0;const m=a-o,g=s-i;if(e.isHorizontal()){if(p=_alignStartEnd(r,i,s),isObject$2(n)){const e=Object.keys(n)[0],r=n[e];f=u[e].getPixelForValue(r)+m-t}else f="center"===n?(c.bottom+c.top)/2+m-t:offsetFromEdge(e,n,t);d=s-i}else{if(isObject$2(n)){const e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)-g+t}else p="center"===n?(c.left+c.right)/2-g+t:offsetFromEdge(e,n,t);f=_alignStartEnd(r,a,o),h="left"===n?-HALF_PI:HALF_PI}return{titleX:p,titleY:f,maxWidth:d,rotation:h}}class Scale extends Element$1{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,f,h,m,g,v,y,b=0,x=0;for(l=0;l<t;l+=s){if(d=e[l].label,p=this._resolveTickFontOptions(l),r.font=f=p.string,h=o[f]=o[f]||{data:{},gc:[]},m=p.lineHeight,g=v=0,isNullOrUndef(d)||isArray(d)){if(isArray(d))for(c=0,u=d.length;c<u;++c)y=d[c],isNullOrUndef(y)||isArray(y)||(g=_measureText(r,h.data,h.gc,g,y),v+=m)}else g=_measureText(r,h.data,h.gc,g,d),v=m;i.push(g),a.push(v),b=Math.max(g,b),x=Math.max(v,x)}garbageCollect(o,t);const $=i.indexOf(b),_=a.indexOf(x),C=e=>({width:i[e]||0,height:a[e]||0});return{first:C(0),last:C(t-1),widest:C($),highest:C(_),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()),f=p.display?p.width:0,h=f/2,m=function(e){return _alignPixel(n,e,f)};let g,v,y,b,x,$,_,C,w,S,E,k;if("top"===i)g=m(this.bottom),$=this.bottom-u,C=g-h,S=m(e.top)+h,k=e.bottom;else if("bottom"===i)g=m(this.top),S=e.top,k=m(e.bottom)-h,$=g+h,C=this.top+u;else if("left"===i)g=m(this.right),x=this.right-u,_=g-h,w=m(e.left)+h,E=e.right;else if("right"===i)g=m(this.left),w=e.left,E=m(e.right)-h,x=g+h,_=this.left+u;else if("x"===t){if("center"===i)g=m((e.top+e.bottom)/2+.5);else if(isObject$2(i)){const e=Object.keys(i)[0],t=i[e];g=m(this.chart.scales[e].getPixelForValue(t))}S=e.top,k=e.bottom,$=g+h,C=$+u}else if("y"===t){if("center"===i)g=m((e.left+e.right)/2);else if(isObject$2(i)){const e=Object.keys(i)[0],t=i[e];g=m(this.chart.scales[e].getPixelForValue(t))}x=g-h,_=x-u,w=e.left,E=e.right}const T=valueOrDefault(r.ticks.maxTicksLimit,c),P=Math.max(1,Math.ceil(c/T));for(v=0;v<c;v+=P){const e=this.getContext(v),t=o.setContext(e),r=a.setContext(e),i=t.lineWidth,c=t.color,u=r.dash||[],p=r.dashOffset,f=t.tickWidth,h=t.tickColor,m=t.tickBorderDash||[],g=t.tickBorderDashOffset;y=getPixelForGridLine(this,v,s),void 0!==y&&(b=_alignPixel(n,y,i),l?x=_=w=E=b:$=C=S=k=b,d.push({tx1:x,ty1:$,tx2:_,ty2:C,x1:w,y1:S,x2:E,y2:k,width:i,color:c,borderDash:u,borderDashOffset:p,tickWidth:f,tickColor:h,tickBorderDash:m,tickBorderDashOffset:g}))}return this._ticksLength=c,this._borderValue=g,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,f=u?-c:p,h=-toRadians(this.labelRotation),m=[];let g,v,y,b,x,$,_,C,w,S,E,k,T="middle";if("top"===r)$=this.bottom-f,_=this._getXAxisLabelAlignment();else if("bottom"===r)$=this.top+f,_=this._getXAxisLabelAlignment();else if("left"===r){const e=this._getYAxisLabelAlignment(d);_=e.textAlign,x=e.x}else if("right"===r){const e=this._getYAxisLabelAlignment(d);_=e.textAlign,x=e.x}else if("x"===t){if("center"===r)$=(e.top+e.bottom)/2+p;else if(isObject$2(r)){const e=Object.keys(r)[0],t=r[e];$=this.chart.scales[e].getPixelForValue(t)+p}_=this._getXAxisLabelAlignment()}else if("y"===t){if("center"===r)x=(e.left+e.right)/2-p;else if(isObject$2(r)){const e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)}_=this._getYAxisLabelAlignment(d).textAlign}"y"===t&&("start"===s?T="top":"end"===s&&(T="bottom"));const P=this._getLabelSizes();for(g=0,v=a.length;g<v;++g){y=a[g],b=y.label;const e=o.setContext(this.getContext(g));C=this.getPixelForTick(g)+o.labelOffset,w=this._resolveTickFontOptions(g),S=w.lineHeight,E=isArray(b)?b.length:1;const t=E/2,n=e.color,s=e.textStrokeColor,c=e.textStrokeWidth;let d,p=_;if(i?(x=C,"inner"===_&&(p=g===v-1?this.options.reverse?"left":"right":0===g?this.options.reverse?"right":"left":"center"),k="top"===r?"near"===l||0!==h?-E*S+S/2:"center"===l?-P.highest.height/2-t*S+S:-P.highest.height+S/2:"near"===l||0!==h?S/2:"center"===l?P.highest.height/2-t*S:P.highest.height-E*S,u&&(k*=-1),0===h||e.showLabelBackdrop||(x+=S/2*Math.sin(h))):($=C,k=(1-E)*S/2),e.showLabelBackdrop){const t=toPadding(e.backdropPadding),n=P.heights[g],r=P.widths[g];let o=k-t.top,i=0-t.left;switch(T){case"middle":o-=n/2;break;case"bottom":o-=n}switch(_){case"center":i-=r/2;break;case"right":i-=r;break;case"inner":g===v-1?i-=r:g>0&&(i-=r/2)}d={left:i,top:o,width:r+t.width,height:n+t.height,color:e.backdropColor}}m.push({label:b,font:w,textOffset:k,options:{rotation:h,color:n,strokeColor:s,strokeWidth:c,textAlign:p,textBaseline:T,translation:[x,$],backdrop:d}})}return m}_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(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$2(t)?(s+=i.bottom,isArray(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(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.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[r]&&(delete defaults[r][n],this.override&&delete overrides[n])}}function registerDefaults(e,t,n){const r=merge(Object.create(null),[n?defaults.get(n):{},defaults.get(t),e.defaults]);defaults.set(t,r),e.defaultRoutes&&routeDefaults(t,e.defaultRoutes),e.descriptors&&defaults.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.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$1,"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(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.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$2(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.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.scales[t.type],defaults.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,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.datasets[t]||{},{type:t},defaults,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(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$2(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$2(e)&&Object.getOwnPropertyNames(e).some(t=>isFunction(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(a)||hasFunction(a))||i&&isArray(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}class Chart{static defaults=defaults;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(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(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(r,(e,t)=>{e||delete n[t]}),each(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.datasets[i];Object.assign(t,{dataElementType:registry.getElement(a),datasetElementType:r&&registry.getElement(r)}),o.controller=new t(this,n),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){each(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(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(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(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(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(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(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},each(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(Chart.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 f=0;const h=o-l;if(r){const e=((u>0?u-r:0)+(d>0?d-r:0))/2;f=(h-(0!==e?h*e/(e+r):h))/2}const m=(h-Math.max(.001,h*d-n/PI)/d)/2,g=l+m+f,v=o-m-f,{outerStart:y,outerEnd:b,innerStart:x,innerEnd:$}=parseBorderRadius$1(t,p,d,v-g),_=d-y,C=d-b,w=g+y/_,S=v-b/C,E=p+x,k=p+$,T=g+x/E,P=v-$/k;if(e.beginPath(),i){const t=(w+S)/2;if(e.arc(a,s,d,w,t),e.arc(a,s,d,t,S),b>0){const t=rThetaToXY(C,S,a,s);e.arc(t.x,t.y,b,S,v+HALF_PI)}const n=rThetaToXY(k,v,a,s);if(e.lineTo(n.x,n.y),$>0){const t=rThetaToXY(k,P,a,s);e.arc(t.x,t.y,$,v+HALF_PI,P+Math.PI)}const r=(v-$/p+(g+x/p))/2;if(e.arc(a,s,p,v-$/p,r,!0),e.arc(a,s,p,r,g+x/p,!0),x>0){const t=rThetaToXY(E,T,a,s);e.arc(t.x,t.y,x,T+Math.PI,g-HALF_PI)}const o=rThetaToXY(_,g,a,s);if(e.lineTo(o.x,o.y),y>0){const t=rThetaToXY(_,w,a,s);e.arc(t.x,t.y,y,g-HALF_PI,w)}}else{e.moveTo(a,s);const t=Math.cos(w)*d+a,n=Math.sin(w)*d+s;e.lineTo(t,n);const r=Math.cos(S)*d+a,o=Math.sin(S)*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,f="inner"===l.borderAlign;if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=p,f?(e.lineWidth=2*c,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let h=t.endAngle;if(i){pathArc(e,t,n,r,h,o);for(let t=0;t<i;++t)e.stroke();isNaN(s)||(h=a+(s%TAU||TAU))}f&&clipArc(e,t,h),i||(pathArc(e,t,n,r,h,o),e.stroke())}class ArcElement extends Element$1{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),f=_isBetween(i,l+d,c+d);return p&&f}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 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$2(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$1{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$1{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,f)=>{const h=n+t/2+o.measureText(e.text).width;(0===f||l[l.length-1]+h+2*a>i)&&(u+=c,l[l.length-(f>0?0:1)]=0,p+=c,d++),s[f]={left:0,top:p,row:d,width:h,height:r},l[l.length-1]+=h+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,f=0,h=0;return this.legendItems.forEach((e,i)=>{const{itemWidth:m,itemHeight:g}=calculateItemSize(n,t,o,e,r);i>0&&p+g+2*a>c&&(u+=d+a,l.push({width:d,height:p}),f+=d+a,h++,d=p=0),s[i]={left:f,top:p,col:h,width:m,height:g},d=Math.max(d,m),p+=g+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.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:f,boxHeight:h,itemHeight:m}=getBoxSize(i,u),g=this.isHorizontal(),v=this._computeTitleHeight();p=g?{x:_alignStartEnd(o,this.left+c,this.right-n[0]),y:this.top+c+v,line:0}:{x:this.left+c,y:_alignStartEnd(o,this.top+v+c,this.bottom-t[0].height),line:0},overrideTextDirection(this.ctx,e.textDirection);const y=m+c;this.legendItems.forEach((b,x)=>{r.strokeStyle=b.fontColor,r.fillStyle=b.fontColor;const $=r.measureText(b.text).width,_=s.textAlign(b.textAlign||(b.textAlign=i.textAlign)),C=f+d+$;let w=p.x,S=p.y;s.setWidth(this.width),g?x>0&&w+C+c>this.right&&(S=p.y+=y,p.line++,w=p.x=_alignStartEnd(o,this.left+c,this.right-n[p.line])):x>0&&S+y>this.bottom&&(w=p.x=w+t[p.line].width+c,p.line++,S=p.y=_alignStartEnd(o,this.top+v+c,this.bottom-t[p.line].height));if(function(e,t,n){if(isNaN(f)||f<=0||isNaN(h)||h<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:h*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:o},l=s.xPlus(e,f/2);drawPointLegend(r,a,l,t+d,i.pointStyleWidth&&f)}else{const i=t+Math.max((u-h)/2,0),a=s.leftForLtr(e,f),l=toTRBLCorners(n.borderRadius);r.beginPath(),Object.values(l).some(e=>0!==e)?addRoundedRectPath(r,{x:a,y:i,w:f,h:h,radius:l}):r.rect(a,i,f,h),r.fill(),0!==o&&r.stroke()}r.restore()}(s.x(w),S,b),w=_textX(_,w+f+d,g?w+C:this.right,e.rtl),function(e,t,n){renderText(r,n.text,e,t+m/2,l,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})}(s.x(w),S,b),g)p.x+=C+c;else if("string"!=typeof b.text){const e=l.lineHeight;p.y+=calculateLegendItemHeight(b,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(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$1{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(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(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(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,f=r.length,h=toPadding(t.padding);let m=h.height,g=0,v=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){m+=f*(t.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(v-f)*l.lineHeight+(v-1)*t.bodySpacing}p&&(m+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let y=0;const b=function(e){g=Math.max(g,n.measureText(e).width+y)};return n.save(),n.font=c.string,each(e.title,b),n.font=l.string,each(e.beforeBody.concat(e.afterBody),b),y=t.displayColors?a+2+t.boxPadding:0,each(r,e=>{each(e.before,b),each(e.lines,b),each(e.after,b)}),y=0,n.font=u.string,each(e.footer,b),n.restore(),g+=h.width,{width:g,height:m}}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:f}=toTRBLCorners(a);let h=alignX(t,s);const m=alignY(t,l,c);return"center"===l?"left"===s?h+=c:"right"===s&&(h-=c):"left"===s?h-=Math.max(u,p)+o:"right"===s&&(h+=Math.max(d,f)+o),{x:_limitValue(h,0,r.width-t.width),y:_limitValue(m,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}class Tooltip extends Element$1{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(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(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:f,height:h}=t;let m,g,v,y,b,x;return"center"===o?(b=p+h/2,"left"===r?(m=d,g=m-i,y=b+i,x=b-i):(m=d+f,g=m+i,y=b-i,x=b+i),v=m):(g="left"===r?d+Math.max(s,c)+i:"right"===r?d+f-Math.max(l,u)-i:this.caretX,"top"===o?(y=p,b=y-i,m=g-i,v=g+i):(y=p+h,b=y+i,m=g+i,v=g-i),x=y),{x1:m,x2:g,x3:v,y1:y,y2:b,y3:x}}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,f=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=f+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$2(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:f,w:l,h:s,radius:a}),e.fill(),e.stroke(),e.fillStyle=i.backgroundColor,e.beginPath(),addRoundedRectPath(e,{x:n,y:f+1,w:l-2,h:s-2,radius:a}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(t,f,l,s),e.strokeRect(t,f,l,s),e.fillStyle=i.backgroundColor,e.fillRect(n,f+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 f=getRtlAdapter(n.rtl,this.x,this.width),h=function(n){t.fillText(n,f.x(e.x+p),e.y+d/2),e.y+=d+o},m=f.textAlign(i);let g,v,y,b,x,$,_;for(t.textAlign=i,t.textBaseline="middle",t.font=u.string,e.x=getAlignedX(this,m,n),t.fillStyle=n.bodyColor,each(this.beforeBody,h),p=a&&"right"!==m?"center"===i?l/2+c:l+2+c:0,b=0,$=r.length;b<$;++b){for(g=r[b],v=this.labelTextColors[b],t.fillStyle=v,each(g.before,h),y=g.lines,a&&y.length&&(this._drawColorBox(t,e,b,f,n),d=Math.max(u.lineHeight,s)),x=0,_=y.length;x<_;++x)h(y[x]),d=u.lineHeight;each(g.after,h)}p=0,d=u.lineHeight,each(this.afterBody,h),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:f}=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-f),t.quadraticCurveTo(a+l,s+c,a+l-f,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,positioners:positioners,afterInit(e,t,n){n&&(e.tooltip=new Tooltip({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,f=c-1,{min:h,max:m}=t,g=!isNullOrUndef(i),v=!isNullOrUndef(a),y=!isNullOrUndef(l),b=(m-h)/(u+1);let x,$,_,C,w=niceNum((m-h)/f/p)*p;if(w<1e-14&&!g&&!v)return[{value:h},{value:m}];C=Math.ceil(m/w)-Math.floor(h/w),C>f&&(w=niceNum(C*w/f/p)*p),isNullOrUndef(s)||(x=Math.pow(10,s),w=Math.ceil(w*x)/x),"ticks"===r?($=Math.floor(h/w)*w,_=Math.ceil(m/w)*w):($=h,_=m),g&&v&&o&&almostWhole((a-i)/o,w/1e3)?(C=Math.round(Math.min((a-i)/w,c)),w=(a-i)/C,$=i,_=a):y?($=g?i:$,_=v?a:_,C=l-1,w=(_-$)/C):(C=(_-$)/w,C=almostEquals(C,Math.round(C),w/1e3)?Math.round(C):Math.ceil(C));const S=Math.max(_decimalPlaces(w),_decimalPlaces($));x=Math.pow(10,isNullOrUndef(s)?S:s),$=Math.round($*x)/x,_=Math.round(_*x)/x;let E=0;for(g&&(d&&$!==i?(n.push({value:i}),$<i&&E++,almostEquals(Math.round(($+E*w)*x)/x,i,relativeLabelSize(i,b,e))&&E++):$<i&&E++);E<C;++E){const e=Math.round(($+E*w)*x)/x;if(v&&e>a)break;n.push({value:e})}return v&&d&&_!==a?n.length&&almostEquals(n[n.length-1].value,a,relativeLabelSize(a,b,e))?n[n.length-1].value=a:n.push({value:a}):v&&_!==a||n.push({value:_}),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(r),t=sign(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$2(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$1(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$2(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$1(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 f="data"===r.ticks.source&&this.getDataTimestamps();for(u=p,d=0;u<n;u=+e.add(u,a,i),d++)addTick(c,u,f);return u!==n&&"ticks"!==r.bounds&&1!==d||addTick(c,u,f),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$2(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)}}const{makeStyles:makeStyles}=createMakeAndWithStyles({useTheme:useTheme}),useStyles$m=makeStyles()({root:{position:"relative",width:48,maxWidth:48}}),MobileCheckboxBodyCell=e=>{const{classes:t}=useStyles$m();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$l=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:"hidden",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$l(),{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:`${eM.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$k=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:"hidden"},row:{"& .MuiTableCell-root":{padding:"6px",overflow:"hidden"},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$k(),c=fm(),u=Zm(),{selection:d,setSelection:p}=pm(),{onRowClick:f,onRowAction:h,rowColor:m=()=>"inherit"}=c,g=e=>{s(e)},v=t=>{h&&h(t,e,u)},[y,b,x]=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:v,withLabel:a,disableGutters:s,onMenuToggle:g}),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]),$=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:$},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)):f&&f(e,u))},children:factory$1(TableCell,{padding:"none",sx:{background:m(e),maxWidth:$},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,b]}),x.map((e,t)=>factory$1(TableRow,{className:clsx$2(t===x.length-1&&l.noBorder),children:e},t))]})})})})};function keys(e){return Object.keys(e)}function isObject$1(e){return e&&"object"==typeof e&&!Array.isArray(e)}function deepMerge(e,t){const n={...e},r=t;return isObject$1(e)&&isObject$1(t)&&Object.keys(t).forEach(t=>{isObject$1(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$1(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",h),document.addEventListener("mouseup",p),document.addEventListener("touchmove",g),document.addEventListener("touchend",p))},p=()=>{i.current&&o.current&&(i.current=!1,l(!1),document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",p),document.removeEventListener("touchmove",g),document.removeEventListener("touchend",p),setTimeout(()=>{"function"==typeof(null==t?void 0:t.onScrubEnd)&&t.onScrubEnd()},0))},f=e=>{d(),e.preventDefault(),h(e)},h=e=>u({x:e.clientX,y:e.clientY}),m=e=>{e.cancelable&&e.preventDefault(),d(),g(e)},g=e=>{e.cancelable&&e.preventDefault(),u({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY})};return null==(s=r.current)||s.addEventListener("mousedown",f),null==(c=r.current)||c.addEventListener("touchstart",m,{passive:!1}),()=>{r.current&&(r.current.removeEventListener("mousedown",f),r.current.removeEventListener("touchstart",m))}},[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&&currentQueue&&(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&&currentQueue[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$1={};function getEnv(){return void 0!==process$1&&define_process_env_default$1?"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(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("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("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("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(e,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${i}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:a,isLight:isLightColor(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:f,stylesTransform:h}){const{colorScheme:m,setColorScheme:g,clearColorScheme:v}=useProviderColorScheme({defaultColorScheme:u,forceColorScheme:f,manager:c,getRootElement:d});return useRespectReduceMotion({respectReducedMotion:(null==e?void 0:e.respectReducedMotion)||!1,getRootElement:d}),factory$1(MantineContext.Provider,{value:{colorScheme:m,setColorScheme:g,clearColorScheme:v,getRootElement:d,classNamesPrefix:l,getStyleNonce:n,cssVariablesResolver:p,cssVariablesSelector:s,withStaticClasses:r,stylesTransform:h},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:f,transformedStyles:h}){return clsx$2(getGlobalClassNames({theme:e,options:t,unstyled:s||f}),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:h,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||f}),p&&!f&&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$j({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(),f=useMantineClassNamesPrefix(),h=useMantineWithStaticClasses(),m=useMantineIsHeadless(),g=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:v,getTransformedStyles:y}=useStylesTransform({props:n,stylesCtx:r,themeName:g});return(e,b)=>({className:getClassName({theme:p,options:b,themeName:g,selector:e,classNamesPrefix:f,classNames:l,classes:t,unstyled:s,className:o,rootSelector:a,props:n,stylesCtx:r,withStaticClasses:h,headless:m,transformedStyles:y([null==b?void 0:b.styles,c])}),style:getStyle({theme:p,themeName:g,selector:e,options:b,props:n,stylesCtx:r,rootSelector:a,styles:c,style:i,vars:u,varsResolver:d,headless:m,withStylesTransform:v})})}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:f,pb:h,pl:m,pr:g,pe:v,ps:y,bd:b,bg:x,c:$,opacity:_,ff:C,fz:w,fw:S,lts:E,ta:k,lh:T,fs:P,tt:M,td:L,w:I,miw:R,maw:O,h:A,mih:D,mah:N,bgsz:F,bgp:z,bgr:B,bga:j,pos:H,top:V,left:U,bottom:W,right:Y,inset:q,display:G,flex:K,hiddenFrom:X,visibleFrom:Z,lightHidden:J,darkHidden:Q,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:f,pb:h,pl:m,pr:g,pe:v,ps:y,bd:b,bg:x,c:$,opacity:_,ff:C,fz:w,fw:S,lts:E,ta:k,lh:T,fs:P,tt:M,td:L,w:I,miw:R,maw:O,h:A,mih:D,mah:N,bgsz:F,bgp:z,bgr:B,bga:j,pos:H,top:V,left:U,bottom:W,right:Y,inset:q,display:G,flex:K,hiddenFrom:X,visibleFrom:Z,lightHidden:J,darkHidden:Q,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,...f},h)=>{var m;const g=useMantineTheme(),v=e||"div",{styleProps:y,rest:b}=extractStyleProps(f),x=useMantineSxTransform(),$=null==(m=null==x?void 0:x())?void 0:m(y.sx),_=useRandomClassName(),C=parseStyleProps({styleProps:y,theme:g,data:STYlE_PROPS_DATA}),w={ref:h,style:getBoxStyle({theme:g,style:t,vars:n,styleProps:C.inlineStyles}),className:clsx$2(r,$,{[_]: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),...b};return factory$1(Fragment,{children:[C.hasResponsiveStyles&&factory$1(InlineStyles,{selector:`.${_}`,styles:C.styles,media:C.media}),"function"==typeof d?d(w):factory$1(v,{...w})]})});_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),[f,h]=reactExports.useState(null),[m,g]=reactExports.useState(null),[v,y]=reactExports.useState(0),[b,x]=reactExports.useState(0),[$,_]=reactExports.useState(!1),[C,w]=reactExports.useState(!1),S=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:f,onScrollbarXChange:h,scrollbarXEnabled:$,onScrollbarXEnabledChange:_,scrollbarY:m,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:y,onCornerHeightChange:x},children:factory$1(Box,{...a,ref:S,__vars:{"--sa-corner-width":"xy"!==i?"0px":`${v}px`,"--sa-corner-height":"xy"!==i?"0px":`${b}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(),[f,h]=reactExports.useState(null),m=useMergedRef(t,e=>h(e)),g=reactExports.useRef(null),v=reactExports.useRef(""),{viewport:y}=p,b=n.content-n.viewport,x=useCallbackRef(c),$=useCallbackRef(s),_=useDebouncedCallback(u,10),C=e=>{if(g.current){const t=e.clientX-g.current.left,n=e.clientY-g.current.top;l({x:t,y:n})}};return reactExports.useEffect(()=>{const e=e=>{const t=e.target;(null==f?void 0:f.contains(t))&&x(e,b)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[y,f,b,x]),reactExports.useEffect($,[n,$]),useResizeObserver(f,_),useResizeObserver(p.content,_),factory$1(ScrollbarProvider,{value:{scrollbar:f,hasThumb:r,onThumbChange:useCallbackRef(o),onThumbPointerUp:useCallbackRef(i),onThumbPositionChange:$,onThumbPointerDown:useCallbackRef(a)},children:factory$1("div",{...d,ref:m,"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),g.current=f.getBoundingClientRect(),v.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=v.current,g.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:f,onScrollPositionChange:h,children:m,offsetScrollbars:g,scrollbars:v,onBottomReached:y,onTopReached:b,...x}=n,[$,_]=reactExports.useState(!1),C=useStyles$j({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:v,...C("root"),...x,children:[factory$1(ScrollAreaViewport,{...p,...C("viewport",{style:null==p?void 0:p.style}),ref:f,"data-offset-scrollbars":!0===g?"xy":g||void 0,"data-scrollbars":v||void 0,onScroll:e=>{var t;null==(t=null==p?void 0:p.onScroll)||t.call(p,e),null==h||h({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==b||b())},children:m}),("xy"===v||"x"===v)&&factory$1(ScrollAreaScrollbar,{...C("scrollbar"),orientation:"horizontal","data-hidden":"never"===u||void 0,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:factory$1(ScrollAreaThumb,{...C("thumb")})}),("xy"===v||"y"===v)&&factory$1(ScrollAreaScrollbar,{...C("scrollbar"),orientation:"vertical","data-hidden":"never"===u||void 0,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:factory$1(ScrollAreaThumb,{...C("thumb")})}),factory$1(ScrollAreaCorner,{...C("corner"),"data-hovered":$||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:f,viewportProps:h,scrollbars:m,style:g,vars:v,onBottomReached:y,...b}=useProps("ScrollAreaAutosize",defaultProps$_,e);return factory$1(Box,{...b,ref:t,style:[{display:"flex",overflow:"auto"},g],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:f,viewportProps:h,vars:v,scrollbars:m,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$j({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$j({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(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(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(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=Math.min,max=Math.max,round=Math.round,floor=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(e,min(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 f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(getAlignment(t)){case"start":f[a]-=p*(n&&c?-1:1);break;case"end":f[a]+=p*(n&&c?-1:1)}return f}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:f=0}=evaluate(t,e),h=getPaddingObject(f),m=s[p?"floating"===d?"reference":"floating":d],g=rectToClientRect(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="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)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=rectToClientRect(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+h.top)/b.y,bottom:(x.bottom-g.bottom+h.bottom)/b.y,left:(g.left-x.left+h.left)/b.x,right:(x.right-g.right+h.right)/b.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,f={},h=0;for(let g=0;g<s.length;g++){var m;const{name:n,fn:i}=s[g],{x:v,y:y,data:b,reset:x}=await i({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:{...a,detectOverflow:null!=(m=a.detectOverflow)?m:detectOverflow},elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=y?y:d,f={...f,[n]:{...f[n],...b}},x&&h<=50&&(h++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(c=!0===x.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:u,y:d}=computeCoordsFromPlacement(c,p,l))),g=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}},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},f=getAlignmentAxis(o),h=getAxisLength(f),m=await a.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[f]-p[f]-i.floating[h],$=p[f]-i.reference[f],_=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let C=_?_[b]:0;C&&await(null==a.isElement?void 0:a.isElement(_))||(C=s.floating[b]||i.floating[h]);const w=x/2-$/2,S=C/2-m[h]/2-1,E=min(d[v],S),k=min(d[y],S),T=E,P=C-m[h]-k,M=C/2-m[h]/2+w,L=clamp(T,M,P),I=!l.arrow&&null!=getAlignment(o)&&M!==L&&i.reference[h]/2-(M<T?E:k)-m[h]/2<0,R=I?M<T?M-T:M-P:0;return{[f]:p[f]+R,data:{[f]:L,centerOffset:M-L-R,...I&&{alignmentOffset:R}},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:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=evaluate(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=getSide(o),y=getSideAxis(s),b=getSide(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),$=p||(b||!m?[getOppositePlacement(s)]:getExpandedPlacements(s)),_="none"!==h;!p&&_&&$.push(...getOppositeAxisPlacements(s,m,h,x));const C=[s,...$],w=await l.detectOverflow(t,g),S=[];let E=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&S.push(w[v]),d){const e=getAlignmentSides(o,a,x);S.push(w[e[0]],w[e[1]])}if(E=[...E,{placement:o,overflows:S}],!S.every(e=>e<=0)){var k,T;const e=((null==(k=i.flip)?void 0:k.index)||0)+1,t=C[e];if(t){if(!("alignment"===d&&y!==getSideAxis(t))||E.every(e=>getSideAxis(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:E},reset:{placement:t}}}let n=null==(T=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:T.placement;if(!n)switch(f){case"bestFit":{var P;const e=null==(P=E.filter(e=>{if(_){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:P[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}};function getBoundingRect(e){const t=min(...e.map(e=>e.left)),n=min(...e.map(e=>e.top));return{x:t,y:n,width:max(...e.map(e=>e.right))-t,height:max(...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$2=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)),f=getPaddingObject(s);const h=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-f.left&&l<e.right+f.right&&c>e.top-f.top&&c<e.bottom+f.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(...d.map(e=>e.right)),r=min(...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!==h.reference.x||o.reference.y!==h.reference.y||o.reference.width!==h.reference.width||o.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},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:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*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)),f=getOppositeAxis(p);let h=u[f],m=u[p];if(a){const e="y"===f?"bottom":"right";h=clamp(h+d["y"===f?"top":"left"],h,h-d[e])}if(s){const e="y"===p?"bottom":"right";m=clamp(m+d["y"===p?"top":"left"],m,m-d[e])}const g=l.fn({...t,[f]:h,[p]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[f]: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 f=u[p],h=u[d];const m=evaluate(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+g.mainAxis,n=i.reference[p]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var v,y;const e="y"===p?"width":"height",t=originSides.has(getSide(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=a.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:f,[d]:h}}}},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),f="y"===getSideAxis(o),{width:h,height:m}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,g="end"===p?"top":"bottom");const y=m-u.top-u.bottom,b=h-u.left-u.right,x=min(m-u[g],y),$=min(h-u[v],b),_=!t.middlewareData.shift;let C=x,w=$;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(w=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(C=y),_&&!p){const e=max(u.left,0),t=max(u.right,0),n=max(u.top,0),r=max(u.bottom,0);f?w=h-2*(0!==e||0!==t?e+t:max(u.left,u.right)):C=m-2*(0!==n||0!==r?n+r:max(u.top,u.bottom))}await l({...t,availableWidth:w,availableHeight:C});const S=await a.getDimensions(s.floating);return h!==S.width||m!==S.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(n)!==i||round(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function unwrapElement(e){return isElement(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(n.width):n.width)/r,s=(i?round(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(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(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(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=max(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(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(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(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(e)&&"body"!==getNodeName(e)),o=null;const i="fixed"===getComputedStyle$1(e).position;let a=i?getParentNode(e):e;for(;isElement(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(r.top,e.top),e.right=min(r.right,e.right),e.bottom=min(r.bottom,e.bottom),e.left=max(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(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,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:f}=c;if(s||t(),!p||!f)return;const h={rootMargin:-floor(d)+"px "+-floor(o.clientWidth-(u+p))+"px "+-floor(o.clientHeight-(d+f))+"px "+-floor(u)+"px",threshold:max(0,min(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||rectsAreEqual(c,e.getBoundingClientRect())||a(),m=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(v){r=new IntersectionObserver(g,h)}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,f=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m=l?getBoundingClientRect(e):null;return l&&function t(){const r=getBoundingClientRect(e);m&&!rectsAreEqual(m,r)&&n();m=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=h)||e.disconnect(),h=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$1=inline$2,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,f]=reactExports.useState(r);deepEqual(p,r)||f(r);const[h,m]=reactExports.useState(null),[g,v]=reactExports.useState(null),y=reactExports.useCallback(e=>{e!==_.current&&(_.current=e,m(e))},[]),b=reactExports.useCallback(e=>{e!==C.current&&(C.current=e,v(e))},[]),x=i||h,$=a||g,_=reactExports.useRef(null),C=reactExports.useRef(null),w=reactExports.useRef(u),S=null!=l,E=useLatestRef(l),k=useLatestRef(o),T=useLatestRef(c),P=reactExports.useCallback(()=>{if(!_.current||!C.current)return;const e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),computePosition(_.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==T.current};M.current&&!deepEqual(w.current,t)&&(w.current=t,reactDomExports.flushSync(()=>{d(t)}))})},[p,t,n,k,T]);index$3(()=>{!1===c&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);const M=reactExports.useRef(!1);index$3(()=>(M.current=!0,()=>{M.current=!1}),[]),index$3(()=>{if(x&&(_.current=x),$&&(C.current=$),x&&$){if(E.current)return E.current(x,$,P);P()}},[x,$,P,E,S]);const L=reactExports.useMemo(()=>({reference:_,floating:C,setReference:y,setFloating:b}),[y,b]),I=reactExports.useMemo(()=>({reference:x,floating:$}),[x,$]),R=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:P,refs:L,elements:I,floatingStyles:R}),[u,P,L,I,R])}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=(e,t)=>({...inline$1(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}}}),f=reactExports.useCallback(e=>{const t=isElement(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),p.refs.setReference(t)},[p.refs]),h=reactExports.useCallback(e=>{(isElement(e)||null===e)&&(u.current=e,a(e)),(isElement(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!isElement(e))&&p.refs.setReference(e)},[p.refs]),m=reactExports.useMemo(()=>({...p.refs,setReference:h,setPositionReference:f,domReference:u}),[p.refs,h,f]),g=reactExports.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),v=reactExports.useMemo(()=>({...p,...r,refs:m,elements:g,nodeId:t}),[p,m,g,t,r]);return index$2(()=>{r.dataRef.current.floatingContext=v;const e=null==d?void 0:d.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),reactExports.useMemo(()=>({...p,context:v,refs:m,elements:g}),[p,m,g,v])}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$1(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,[f,h]=reactExports.useState(p?0:e),[m,g]=reactExports.useState(r?"entered":"exited"),v=reactExports.useRef(-1),y=reactExports.useRef(-1),b=reactExports.useRef(-1),x=n=>{const r=n?o:i,l=n?a:s;window.clearTimeout(v.current);const c=p?0:n?e:t;h(c),0===c?("function"==typeof r&&r(),"function"==typeof l&&l(),g(n?"entered":"exited")):b.current=requestAnimationFrame(()=>{ReactDOM.flushSync(()=>{g(n?"pre-entering":"pre-exiting")}),b.current=requestAnimationFrame(()=>{"function"==typeof r&&r(),g(n?"entering":"exiting"),v.current=window.setTimeout(()=>{"function"==typeof l&&l(),g(n?"entered":"exited")},c)})})};return useDidUpdate(()=>{var e;e=r,window.clearTimeout(y.current),"number"==typeof(e?l:c)?y.current=window.setTimeout(()=>{x(e)},e?l:c):x(e)},[r]),reactExports.useEffect(()=>()=>{window.clearTimeout(v.current),cancelAnimationFrame(b.current)},[]),{transitionDuration:f,transitionStatus:m,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:f,transitionStatus:h,transitionTimingFunction:m}=useTransition({mounted:o,exitDuration:r,duration:n,timingFunction:a,onExit:s,onEntered:l,onEnter:c,onExited:u,enterDelay:d,exitDelay:p});return 0===f?o?factory$1(Fragment,{children:i({})}):e?i({display:"none"}):null:"exited"===h?e?i({display:"none"}):null:factory$1(Fragment,{children:i(getTransitionStyles({transition:t,duration:f,state:h,timingFunction:m}))})}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:f,styles:h,...m}=a,g=usePopoverContext(),v=useFocusReturn({opened:g.opened,shouldReturnFocus:g.returnFocus}),y=g.withRoles?{"aria-labelledby":g.getTargetId(),id:g.getDropdownId(),role:"dialog",tabIndex:-1}:{},b=useMergedRef(t,g.floating);return g.disabled?null:factory$1(OptionalPortal,{...g.portalProps,withinPortal:g.withinPortal,children:factory$1(Transition,{mounted:g.opened,...g.transitionProps,transition:(null==(n=g.transitionProps)?void 0:n.transition)||"fade",duration:(null==(r=g.transitionProps)?void 0:r.duration)??150,keepMounted:g.keepMounted,exitDuration:"number"==typeof(null==(o=g.transitionProps)?void 0:o.exitDuration)?g.transitionProps.exitDuration:null==(i=g.transitionProps)?void 0:i.duration,children:e=>factory$1(FocusTrap,{active:g.trapFocus&&g.opened,innerRef:b,children:factory$1(Box,{...y,...m,variant:p,onKeyDownCapture:closeOnEscape(g.onClose,{active:g.closeOnEscape,onTrigger:v,onKeyDown:d}),"data-position":g.placement,"data-fixed":"fixed"===g.floatingStrategy||void 0,...g.getStyles("dropdown",{className:s,props:a,classNames:f,styles:h,style:[{...e,zIndex:g.zIndex,top:g.y??0,left:g.x??0,width:"target"===g.width?void 0:rem(g.width)},l]}),children:[u,factory$1(FloatingArrow,{ref:g.arrowRef,arrowX:g.arrowX,arrowY:g.arrowY,visible:g.withArrow,position:g.placement,arrowSize:g.arrowSize,arrowRadius:g.arrowRadius,arrowOffset:g.arrowOffset,arrowPosition:g.arrowPosition,...g.getStyles("arrow",{props:a,classNames:f,styles:h})})]})})})})});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$1(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():inline(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:f,transitionProps:h,width:m,middlewares:g,withArrow:v,arrowSize:y,arrowOffset:b,arrowRadius:x,arrowPosition:$,unstyled:_,classNames:C,styles:w,closeOnClickOutside:S,withinPortal:E,portalProps:k,closeOnEscape:T,clickOutsideEvents:P,trapFocus:M,onClose:L,onOpen:I,onChange:R,zIndex:O,radius:A,shadow:D,id:N,defaultOpened:F,__staticSelector:z,withRoles:B,disabled:j,returnFocus:H,variant:V,keepMounted:U,vars:W,floatingStrategy:Y,...q}=s,G=useStyles$j({name:z,props:s,classes:classes$m,classNames:C,styles:w,unstyled:_,rootSelector:"dropdown",vars:W,varsResolver:varsResolver$m}),K=reactExports.useRef(null),[X,Z]=reactExports.useState(null),[J,Q]=reactExports.useState(null),{dir:ee}=useDirection(),te=useId$1(N),ne=usePopover({middlewares:g,width:m,position:getFloatingPosition(ee,c),offset:"number"==typeof u?u+(v?y/2:0):u,arrowRef:K,arrowOffset:b,onPositionChange:d,positionDependencies:p,opened:f,defaultOpened:F,onChange:R,onOpen:I,onClose:L,strategy:Y});useClickOutside(()=>S&&ne.onClose(),P,[X,J]);const re=reactExports.useCallback(e=>{Z(e),ne.floating.refs.setReference(e)},[ne.floating.refs.setReference]),oe=reactExports.useCallback(e=>{Q(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:h,width:m,withArrow:v,arrowSize:y,arrowOffset:b,arrowRadius:x,arrowPosition:$,placement:ne.floating.placement,trapFocus:M,withinPortal:E,portalProps:k,zIndex:O,radius:A,shadow:D,closeOnEscape:T,onClose:ne.onClose,onToggle:ne.onToggle,getTargetId:()=>`${te}-target`,getDropdownId:()=>`${te}-dropdown`,withRoles:B,targetProps:q,__staticSelector:z,classNames:C,styles:w,unstyled:_,variant:V,keepMounted:U,getStyles:G,floatingStrategy:Y},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:f,variant:h,icon:m,mod:g,...v}=n,y=useStyles$j({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,...v,unstyled:d,variant:h,disabled:f,mod:[{disabled:f||p},g],...y("root",{variant:h,active:!f&&!p}),children:[m||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,...f}=useProps("InputDescription",defaultProps$S,n),h=useInputWrapperContext(),m=useStyles$j({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}),g=d&&(null==h?void 0:h.getStyles)||m;return factory$1(Box,{component:"p",ref:t,variant:p,size:c,...g("description",(null==h?void 0:h.getStyles)?{className:o,style:i}:void 0),...f})});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,...f}=n,h=useStyles$j({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}),m=useInputWrapperContext(),g=d&&(null==m?void 0:m.getStyles)||h;return factory$1(Box,{component:"p",ref:t,variant:p,size:c,...g("error",(null==m?void 0:m.getStyles)?{className:o,style:i}:void 0),...f})});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:f,children:h,__staticSelector:m,variant:g,mod:v,...y}=useProps("InputLabel",defaultProps$Q,n),b=useStyles$j({name:["InputWrapper",m],props:n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"label",vars:l,varsResolver:varsResolver$i}),x=useInputWrapperContext(),$=(null==x?void 0:x.getStyles)||b;return factory$1(Box,{...$("label",(null==x?void 0:x.getStyles)?{className:o,style:i}:void 0),component:c,variant:g,size:u,ref:t,htmlFor:"label"===c?p:void 0,mod:[{required:d},v],onMouseDown:e=>{null==f||f(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()},...y,children:[h,d&&factory$1("span",{...$("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,...f}=useProps("InputPlaceholder",defaultProps$P,n),h=useStyles$j({name:["InputPlaceholder",c],props:n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"placeholder"});return factory$1(Box,{...h("placeholder"),mod:[{error:!!d},p],component:"span",variant:u,ref:t,...f})});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:f,label:h,error:m,description:g,labelProps:v,descriptionProps:y,errorProps:b,labelElement:x,children:$,withAsterisk:_,id:C,required:w,__stylesApiProps:S,mod:E,...k}=n,T=useStyles$j({name:["InputWrapper",d],props:S||n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$h}),P={size:c,variant:u,__staticSelector:d},M=useId$1(C),L="boolean"==typeof _?_:w,I=(null==b?void 0:b.id)||`${M}-error`,R=(null==y?void 0:y.id)||`${M}-description`,O=M,A=!!m&&"boolean"!=typeof m,D=!!g,N=`${A?I:""} ${D?R:""}`,F=N.trim().length>0?N.trim():void 0,z=(null==v?void 0:v.id)||`${M}-label`,B=h&&factory$1(InputLabel,{labelElement:x,id:z,htmlFor:O,required:L,...P,...v,children:h}),j=D&&factory$1(InputDescription,{...y,...P,size:(null==y?void 0:y.size)||P.size,id:(null==y?void 0:y.id)||R,children:g}),H=factory$1(reactExports.Fragment,{children:p($)}),V=A&&reactExports.createElement(InputError,{...b,...P,size:(null==b?void 0:b.size)||P.size,key:"error",id:(null==b?void 0:b.id)||I},m),U=f.map(e=>{switch(e){case"label":return B;case"input":return H;case"description":return j;case"error":return V;default:return null}});return factory$1(InputWrapperProvider,{value:{getStyles:T,describedBy:F,inputId:O,labelId:z,...getInputOffsets(f,{hasDescription:D,hasError:A})},children:factory$1(Box,{ref:t,variant:u,size:c,mod:[{error:!!m},E],...T("root"),...k,children:U})})});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=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:f,disabled:h,leftSection:m,leftSectionProps:g,leftSectionWidth:v,rightSection:y,rightSectionProps:b,rightSectionWidth:x,rightSectionPointerEvents:$,leftSectionPointerEvents:_,variant:C,vars:w,pointer:S,multiline:E,radius:k,id:T,withAria:P,withErrorStyles:M,mod:L,inputSize:I,...R}=n,{styleProps:O,rest:A}=extractStyleProps(R),D=useInputWrapperContext(),N={offsetBottom:null==D?void 0:D.offsetBottom,offsetTop:null==D?void 0:D.offsetTop},F=useStyles$j({name:["Input",c],props:u||n,classes:classes$k,className:o,style:i,classNames:r,styles:a,unstyled:s,stylesCtx:N,rootSelector:"wrapper",vars:w,varsResolver:varsResolver$g}),z=P?{required:l,disabled:h,"aria-invalid":!!f,"aria-describedby":null==D?void 0:D.describedBy,id:(null==D?void 0:D.inputId)||T}:{};return factory$1(Box,{...F("wrapper"),...O,...p,mod:[{error:!!f&&M,pointer:S,disabled:h,multiline:E,"data-with-right-section":!!y,"data-with-left-section":!!m},L],variant:C,size:d,children:[m&&factory$1("div",{...g,"data-position":"left",...F("section",{className:null==g?void 0:g.className,style:null==g?void 0:g.style}),children:m}),factory$1(Box,{component:"input",...A,...z,ref:t,required:l,mod:{disabled:h,error:!!f&&M},variant:C,__size:I,...F("input")}),y&&factory$1("div",{...b,"data-position":"right",...F("section",{className:null==b?void 0:b.className,style:null==b?void 0:b.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:f,errorProps:h,labelProps:m,descriptionProps:g,wrapperProps:v,id:y,size:b,style:x,inputContainer:$,inputWrapperOrder:_,withAsterisk:C,variant:w,vars:S,mod:E,...k}=r,{styleProps:T,rest:P}=extractStyleProps(k);return{...P,classNames:l,styles:c,unstyled:d,wrapperProps:{...{label:o,description:i,error:a,required:s,classNames:l,className:u,__staticSelector:p,__stylesApiProps:f||r,errorProps:h,labelProps:m,descriptionProps:g,unstyled:d,styles:c,size:b,style:x,inputContainer:$,inputWrapperOrder:_,withAsterisk:C,variant:w,id:y,mod:E,...v},...T},inputProps:{required:s,classNames:l,styles:c,unstyled:d,size:b,__staticSelector:p,__stylesApiProps:f||r,error:a,variant:w,id:y}}}Input.classes=classes$k,Input.Wrapper=InputWrapper,Input.Label=InputLabel,Input.Error=InputError,Input.Description=InputDescription,Input.Placeholder=InputPlaceholder,Input.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.Wrapper,{...r,children:factory$1(Input,{...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.classes,...Input.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,f=useStyles$j({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,...f("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$1(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$1(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:f,selected:h,mod:m,...g}=n,v=useComboboxContext(),y=reactExports.useId(),b=c||y;return factory$1(Box,{...v.getStyles("option",{className:o,classNames:r,styles:a,style:i}),...g,ref:t,id:b,mod:["combobox-option",{"combobox-active":u,"combobox-disabled":f,"combobox-selected":h},m],role:"option",onClick:e=>{var t;f?e.preventDefault():(null==(t=v.onOptionSubmit)||t.call(v,n.value,n),null==l||l(e))},onMouseDown:e=>{e.preventDefault(),null==d||d(e)},onMouseOver:e=>{v.resetSelectionOnOptionHover&&v.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(),f=p.getStyles("search"),h=useComboboxTargetProps({targetType:"input",withAriaAttributes:s,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:l,autoComplete:"off"});return factory$1(Input,{ref:useMergedRef(t,p.store.searchRef),classNames:[{input:f.className},r],styles:[{input:f.style},o],size:u||p.size,...h,...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$1(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),f=reactExports.useRef(-1),h=reactExports.useRef(-1),m=reactExports.useRef(-1),g=reactExports.useCallback((e="unknown")=>{s||(l(!0),null==o||o(e))},[l,o,s]),v=reactExports.useCallback((e="unknown")=>{s&&(l(!1),null==r||r(e))},[l,r,s]),y=reactExports.useCallback((e="unknown")=>{s?v(e):g(e)},[v,g,s]),b=reactExports.useCallback(()=>{const e=document.querySelector(`#${c.current} [data-combobox-selected]`);null==e||e.removeAttribute("data-combobox-selected"),null==e||e.removeAttribute("aria-selected")},[]),x=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")?(b(),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,b]),$=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 x(n)}return x(0)},[x]),_=reactExports.useCallback(()=>x(getNextIndex$1(u.current,document.querySelectorAll(`#${c.current} [data-combobox-option]`),i)),[x,i]),C=reactExports.useCallback(()=>x(getPreviousIndex(u.current,document.querySelectorAll(`#${c.current} [data-combobox-option]`),i)),[x,i]),w=reactExports.useCallback(()=>x(getFirstIndex(document.querySelectorAll(`#${c.current} [data-combobox-option]`))),[x]),S=reactExports.useCallback((e="selected",t)=>{m.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)},[]),E=reactExports.useCallback(()=>{u.current=-1,b()},[b]),k=reactExports.useCallback(()=>{const e=document.querySelectorAll(`#${c.current} [data-combobox-option]`),t=null==e?void 0:e[u.current];null==t||t.click()},[]),T=reactExports.useCallback(e=>{c.current=e},[]),P=reactExports.useCallback(()=>{f.current=window.setTimeout(()=>d.current.focus(),0)},[]),M=reactExports.useCallback(()=>{h.current=window.setTimeout(()=>p.current.focus(),0)},[]),L=reactExports.useCallback(()=>u.current,[]);return reactExports.useEffect(()=>()=>{window.clearTimeout(f.current),window.clearTimeout(h.current),window.clearTimeout(m.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:v,toggleDropdown:y,selectedOptionIndex:u.current,getSelectedOptionIndex:L,selectOption:x,selectFirstOption:w,selectActiveOption:$,selectNextOption:_,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:S,listId:c.current,setListId:T,clickSelectedOption:k,searchRef:d,focusSearchInput:P,targetRef:p,focusTarget:M}}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:f,readOnly:h,...m}=t,g=useCombobox(),v=a||g,y=useStyles$j({name:f||"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:v,onOptionSubmit:l,size:u,resetSelectionOnOptionHover:p,readOnly:h},children:factory$1(Popover,{opened:v.dropdownOpened,...m,onClose:()=>{null==c||c(),v.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:f="left",bodyElement:h="div",labelElement:m="label",variant:g,style:v,vars:y,mod:b,...x},$)=>{const _=useStyles$j({name:e,props:t,className:n,style:v,classes:classes$i,classNames:r,styles:o,unstyled:i});return factory$1(Box,{..._("root"),ref:$,__vars:{"--label-fz":getFontSize(p),"--label-lh":getSize(p,"label-lh")},mod:[{"label-position":f},b],variant:g,size:p,...x,children:factory$1(Box,{component:h,htmlFor:"label"===h?c:void 0,..._("body"),children:[a,factory$1("div",{..._("labelWrapper"),"data-disabled":u||void 0,children:[s&&factory$1(Box,{component:m,htmlFor:"label"===m?c:void 0,..._("label"),"data-disabled":u||void 0,children:s}),l&&factory$1(Input.Description,{size:p,__inheritStyles:!1,..._("description"),children:l}),d&&"boolean"!=typeof d&&factory$1(Input.Error,{size:p,__inheritStyles:!1,..._("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:f,...h}=n,m=useStyles$j({name:"CheckboxCard",classes:classes$h,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$d,rootSelector:"card"}),g=useCheckboxGroupContext(),v="boolean"==typeof c?c:(null==g?void 0:g.value.includes(p||""))||!1;return factory$1(CheckboxCardProvider,{value:{checked:v},children:factory$1(UnstyledButton,{ref:t,mod:[{"with-border":d,checked:v},u],...m("card"),...h,role:"checkbox","aria-checked":v,onClick:e=>{null==f||f(e),null==g||g.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.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.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:f,autoContrast:h,checked:m,mod:g,variant:v,disabled:y,...b}=n,x=c,$=useStyles$j({name:"CheckboxIndicator",classes:classes$g,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$c,rootSelector:"indicator"}),_=useCheckboxCardContext(),C="boolean"==typeof m||"boolean"==typeof u?m||u:(null==_?void 0:_.checked)||!1;return factory$1(Box,{ref:t,...$("indicator",{variant:v}),variant:v,mod:[{checked:C,disabled:y},g],...b,children:factory$1(x,{indeterminate:u,...$("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:f,wrapperProps:h,checked:m,labelPosition:g,description:v,error:y,disabled:b,variant:x,indeterminate:$,icon:_,rootRef:C,iconColor:w,onChange:S,autoContrast:E,mod:k,...T}=n,P=useCheckboxGroupContext(),M=p||(null==P?void 0:P.size),L=_,I=useStyles$j({name:"Checkbox",props:n,classes:classes$f,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$b}),{styleProps:R,rest:O}=extractStyleProps(T),A=useId$1(d),D=P?{checked:P.value.includes(O.value),onChange:e=>{P.onChange(e),null==S||S(e)}}:{};return factory$1(InlineInput,{...I("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:A,size:M,labelPosition:g,label:u,description:v,error:y,disabled:b,classNames:r,styles:a,unstyled:s,"data-checked":D.checked||m||void 0,variant:x,ref:C,mod:k,...R,...h,children:factory$1(Box,{...I("inner"),mod:{"data-label-position":g},children:[factory$1(Box,{component:"input",id:A,ref:t,checked:m,disabled:b,mod:{error:!!y,indeterminate:$},...I("input",{focusable:!0,variant:x}),onChange:S,...O,...D,type:"checkbox"}),factory$1(L,{indeterminate:$,...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:f,labelId:h,renderOption:m,scrollAreaProps:g,"aria-label":v}){validateOptions(e);const y="string"==typeof o?(r||defaultOptionsFilter)({options:e,search:l?o:"",limit:i??1/0}):e,b=isEmptyComboboxData(y),x=y.map(e=>factory$1(Option,{data:e,withCheckIcon:c,value:u,checkIconPosition:d,unstyled:f,renderOption:m},isOptionsGroup(e)?e.group:e.value));return factory$1(Combobox.Dropdown,{hidden:t||n&&b,children:factory$1(Combobox.Options,{labelledBy:h,"aria-label":v,children:[s?factory$1(ScrollArea.Autosize,{mah:a??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...g,children:x}):x,b&&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),f=reactExports.useRef(0),h=reactExports.useRef(),m=function(){var e=d.current,t=n&&h.current?h.current:getSizingData$1(e);if(t){h.current=t;var i=calculateNodeHeight(t,e.value||e.placeholder||"x",o,r),a=i[0],s=i[1];f.current!==a&&(f.current=a,e.style.setProperty("height",a+"px","important"),l(a,{rowHeight:s}))}};return reactExports.useLayoutEffect(m),useWindowResizeListener(m),useFontsLoadedListener(m),reactExports.createElement("textarea",_extends({},c,{onChange:function(e){u||m(),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(),f=(null==p?void 0:p.size)||c||void 0,h=useStyles$j({name:"PillGroup",classes:classes$e,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$a,stylesCtx:{size:f},rootSelector:"group"});return factory$1(PillGroupProvider,{value:{size:f,disabled:u},children:factory$1(Box,{ref:t,size:f,...h("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:f,radius:h,size:m,disabled:g,mod:v,...y}=n,b=usePillGroupContext(),x=usePillsInputContext(),$=m||(null==b?void 0:b.size)||void 0,_="filled"===(null==x?void 0:x.variant)?"contrast":c||"default",C=useStyles$j({name:"Pill",classes:classes$e,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$9,stylesCtx:{size:$}});return factory$1(Box,{component:"span",ref:t,variant:_,size:$,...C("root",{variant:_}),mod:[{"with-remove":d&&!g,disabled:g||(null==b?void 0:b.disabled)},v],...y,children:[factory$1("span",{...C("label"),children:u}),d&&factory$1(CloseButton,{variant:"transparent",radius:h,tabIndex:-1,"aria-hidden":!0,unstyled:s,...f,...C("remove",{className:null==f?void 0:f.className,style:null==f?void 0:f.style}),onMouseDown:e=>{var t;e.preventDefault(),e.stopPropagation(),null==(t=null==f?void 0:f.onMouseDown)||t.call(f,e)},onClick:e=>{var t;e.stopPropagation(),null==p||p(),null==(t=null==f?void 0:f.onClick)||t.call(f,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:f,...h}=n,m=usePillsInputContext(),g=useInputWrapperContext(),v=useStyles$j({name:"PillsInputField",classes:classes$d,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,rootSelector:"field"}),y=u||(null==m?void 0:m.disabled);return factory$1(Box,{component:"input",ref:useMergedRef(t,null==m?void 0:m.fieldRef),"data-type":c,disabled:y,mod:[{disabled:y,pointer:p},f],...v("field"),...h,id:(null==g?void 0:g.inputId)||d,"aria-invalid":null==m?void 0:m.hasError,"aria-describedby":null==g?void 0:g.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:f,variant:h,data:m,dropdownOpened:g,defaultDropdownOpened:v,onDropdownOpen:y,onDropdownClose:b,selectFirstOptionOnChange:x,onOptionSubmit:$,comboboxProps:_,filter:C,limit:w,withScrollArea:S,maxDropdownHeight:E,searchValue:k,defaultSearchValue:T,onSearchChange:P,readOnly:M,disabled:L,onFocus:I,onBlur:R,onPaste:O,radius:A,rightSection:D,rightSectionWidth:N,rightSectionPointerEvents:F,rightSectionProps:z,leftSection:B,leftSectionWidth:j,leftSectionPointerEvents:H,leftSectionProps:V,inputContainer:U,inputWrapperOrder:W,withAsterisk:Y,labelProps:q,descriptionProps:G,errorProps:K,wrapperProps:X,description:Z,label:J,error:Q,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:fe,hiddenInputValuesDivider:he,required:me,mod:ge,renderOption:ve,onRemove:ye,onClear:be,scrollAreaProps:xe,...$e}=n,_e=useId$1(ce),Ce=getParsedComboboxData(m),we=getOptionsLockup(Ce),Se=useCombobox({opened:g,defaultOpened:v,onDropdownOpen:y,onDropdownClose:()=>{null==b||b(),Se.resetSelectedOption()}}),{styleProps:Ee,rest:{type:ke,autoComplete:Te,...Pe}}=extractStyleProps($e),[Me,Le]=useUncontrolled({value:u,defaultValue:d,finalValue:[],onChange:p}),[Ie,Re]=useUncontrolled({value:k,defaultValue:T,finalValue:"",onChange:P}),Oe=useStyles$j({name:"MultiSelect",classes:{},props:n,classNames:r,styles:a,unstyled:s}),{resolvedClassNames:Ae,resolvedStyles:De}=useResolvedStylesApi({props:n,styles:a,classNames:r}),Ne=Me.map((e,t)=>{var n,r;return factory$1(Pill,{withRemoveButton:!M&&!(null==(n=we[e])?void 0:n.disabled),onRemove:()=>{Le(Me.filter(t=>e!==t)),null==ye||ye(e)},unstyled:s,disabled:L,...Oe("pill"),children:(null==(r=we[e])?void 0:r.label)||e})});reactExports.useEffect(()=>{x&&Se.selectFirstOption()},[x,Me]);const Fe=ue&&Me.length>0&&!L&&!M&&factory$1(Combobox.ClearButton,{size:c,...de,onClear:()=>{null==be||be(),Le([]),Re("")}}),ze=filterPickedValues({data:Ce,value:Me});return factory$1(Fragment,{children:[factory$1(Combobox,{store:Se,classNames:Ae,styles:De,unstyled:s,size:c,readOnly:M,__staticSelector:"MultiSelect",onOptionSubmit:e=>{null==$||$(e),Re(""),Se.updateSelectedOptionIndex("selected"),Me.includes(we[e].value)?(Le(Me.filter(t=>t!==we[e].value)),null==ye||ye(we[e].value)):Me.length<ee&&Le([...Me,we[e].value])},..._,children:[factory$1(Combobox.DropdownTarget,{children:factory$1(PillsInput,{...Ee,__staticSelector:"MultiSelect",classNames:Ae,styles:De,unstyled:s,size:c,className:o,style:i,variant:h,disabled:L,radius:A,rightSection:D||Fe||factory$1(Combobox.Chevron,{size:c,error:Q,unstyled:s}),rightSectionPointerEvents:F||(Fe?"all":"none"),rightSectionWidth:N,rightSectionProps:z,leftSection:B,leftSectionWidth:j,leftSectionPointerEvents:H,leftSectionProps:V,inputContainer:U,inputWrapperOrder:W,withAsterisk:Y,labelProps:q,descriptionProps:G,errorProps:K,wrapperProps:X,description:Z,label:J,error:Q,multiline:!0,withErrorStyles:ae,__stylesApiProps:{...n,rightSectionPointerEvents:F||(Fe?"all":"none"),multiline:!0},pointer:!te,onClick:()=>te?Se.openDropdown():Se.toggleDropdown(),"data-expanded":Se.dropdownOpened||void 0,id:_e,required:me,mod:ge,children:factory$1(Pill.Group,{disabled:L,unstyled:s,...Oe("pillsList"),children:[Ne,factory$1(Combobox.EventsTarget,{autoComplete:Te,children:factory$1(PillsInput.Field,{...Pe,ref:t,id:_e,placeholder:fe,type:te||fe?"visible":"hidden",...Oe("inputField"),unstyled:s,onFocus:e=>{null==I||I(e),te&&Se.openDropdown()},onBlur:e=>{null==R||R(e),Se.closeDropdown(),Re("")},onKeyDown:e=>{null==f||f(e)," "!==e.key||te||(e.preventDefault(),Se.toggleDropdown()),"Backspace"===e.key&&0===Ie.length&&Me.length>0&&(null==ye||ye(Me[Me.length-1]),Le(Me.slice(0,Me.length-1)))},value:Ie,onChange:e=>{Re(e.currentTarget.value),te&&Se.openDropdown(),x&&Se.selectFirstOption()},disabled:L,readOnly:M||!te,pointer:!te})})]})})}),factory$1(OptionsDropdown,{data:ie?ze:Ce,hidden:M||L,filter:C,search:Ie,limit:w,hiddenWhenEmpty:!ne,withScrollArea:S,maxDropdownHeight:E,filterOptions:te,value:Me,checkIconPosition:oe,withCheckIcon:re,nothingFoundMessage:ne,unstyled:s,labelId:J?`${_e}-label`:void 0,"aria-label":J?void 0:$e["aria-label"],renderOption:ve,scrollAreaProps:xe})]}),factory$1(Combobox.HiddenInput,{name:se,valuesDivider:he,value:Me,form:le,disabled:L,...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:f,name:h,onKeyDown:m,...g}=n,v=useStyles$j({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(),b=useRadioGroupContext(),x="boolean"==typeof c?c:(null==b?void 0:b.value)===p||!1,$=h||(null==b?void 0:b.name);return factory$1(RadioCardProvider,{value:{checked:x},children:factory$1(UnstyledButton,{ref:t,mod:[{"with-border":d,checked:x},u],...v("card"),...g,role:"radio","aria-checked":x,name:$,onClick:e=>{null==f||f(e),null==b||b.onChange(p||"")},onKeyDown:e=>{if(null==m||m(e),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(e.nativeEvent.code)){e.preventDefault();const t=Array.from(document.querySelectorAll(`[role="radio"][name="${$||"__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,f]=useUncontrolled({value:n,defaultValue:r,finalValue:"",onChange:o});return factory$1(RadioGroupProvider,{value:{value:p,onChange:e=>!c&&f("string"==typeof e?e:e.currentTarget.value),size:i,name:d},children:factory$1(Input.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.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:f,checked:h,mod:m,variant:g,disabled:v,...y}=n,b=c,x=useStyles$j({name:"RadioIndicator",classes:classes$b,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$7,rootSelector:"indicator"}),$=useRadioCardContext(),_="boolean"==typeof h?h:(null==$?void 0:$.checked)||!1;return factory$1(Box,{ref:t,...x("indicator",{variant:g}),variant:g,mod:[{checked:_,disabled:v},m],...y,children:factory$1(b,{...x("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:f,error:h,radius:m,color:g,variant:v,disabled:y,wrapperProps:b,icon:x=RadioIcon,rootRef:$,iconColor:_,onChange:C,mod:w,...S}=n,E=useStyles$j({name:"Radio",classes:classes$a,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$6}),k=useRadioGroupContext(),T=(null==k?void 0:k.size)??u,P=n.size?u:T,{styleProps:M,rest:L}=extractStyleProps(S),I=useId$1(c),R=k?{checked:k.value===L.value,name:L.name??k.name,onChange:e=>{k.onChange(e),null==C||C(e)}}:{};return factory$1(InlineInput,{...E("root"),__staticSelector:"Radio",__stylesApiProps:n,id:I,size:P,labelPosition:p,label:d,description:f,error:h,disabled:y,classNames:r,styles:a,unstyled:s,"data-checked":R.checked||void 0,variant:v,ref:$,mod:w,...M,...b,children:factory$1(Box,{...E("inner"),mod:{"label-position":p},children:[factory$1(Box,{...E("radio",{focusable:!0,variant:v}),onChange:C,...L,...R,component:"input",mod:{error:!!h},ref:t,id:I,disabled:y,type:"radio"}),factory$1(x,{...E("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:f,onChange:h,data:m,value:g,defaultValue:v,selectFirstOptionOnChange:y,onOptionSubmit:b,comboboxProps:x,readOnly:$,disabled:_,filter:C,limit:w,withScrollArea:S,maxDropdownHeight:E,size:k,searchable:T,rightSection:P,checkIconPosition:M,withCheckIcon:L,nothingFoundMessage:I,name:R,form:O,searchValue:A,defaultSearchValue:D,onSearchChange:N,allowDeselect:F,error:z,rightSectionPointerEvents:B,id:j,clearable:H,clearButtonProps:V,hiddenInputProps:U,renderOption:W,onClear:Y,autoComplete:q,scrollAreaProps:G,...K}=n,X=reactExports.useMemo(()=>getParsedComboboxData(m),[m]),Z=reactExports.useMemo(()=>getOptionsLockup(X),[X]),J=useId$1(j),[Q,ee,te]=useUncontrolled({value:g,defaultValue:v,finalValue:null,onChange:h}),ne="string"==typeof Q?Z[Q]:void 0,re=usePrevious(ne),[oe,ie]=useUncontrolled({value:A,defaultValue:D,finalValue:ne?ne.label:"",onChange:N}),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,Q]),reactExports.useEffect(()=>{null===g&&ie(""),"string"!=typeof g||!ne||(null==re?void 0:re.value)===ne.value&&(null==re?void 0:re.label)===ne.label||ie(ne.label)},[g,ne]);const ce=H&&!!Q&&!_&&!$&&factory$1(Combobox.ClearButton,{size:k,...V,onClear:()=>{ee(null,null),ie(""),null==Y||Y()}});return factory$1(Fragment,{children:[factory$1(Combobox,{store:ae,__staticSelector:"Select",classNames:se,styles:le,unstyled:i,readOnly:$,onOptionSubmit:e=>{null==b||b(e);const t=F&&Z[e].value===Q?null:Z[e],n=t?t.value:null;n!==Q&&ee(n,t),!te&&ie("string"==typeof n&&(null==t?void 0:t.label)||""),ae.closeDropdown()},size:k,...x,children:[factory$1(Combobox.Target,{targetType:T?"input":"button",autoComplete:q,children:factory$1(InputBase,{id:J,ref:t,rightSection:P||ce||factory$1(Combobox.Chevron,{size:k,error:z,unstyled:i}),rightSectionPointerEvents:B||(ce?"all":"none"),...K,size:k,__staticSelector:"Select",disabled:_,readOnly:$||!T,value:oe,onChange:e=>{ie(e.currentTarget.value),ae.openDropdown(),y&&ae.selectFirstOption()},onFocus:e=>{T&&ae.openDropdown(),null==d||d(e)},onBlur:e=>{var t;T&&ae.closeDropdown(),ie(null!=Q&&(null==(t=Z[Q])?void 0:t.label)||""),null==p||p(e)},onClick:e=>{T?ae.openDropdown():ae.toggleDropdown(),null==f||f(e)},classNames:se,styles:le,unstyled:i,pointer:!T,error:z})}),factory$1(OptionsDropdown,{data:X,hidden:$||_,filter:C,search:oe,limit:w,hiddenWhenEmpty:!I,withScrollArea:S,maxDropdownHeight:E,filterOptions:T&&(null==ne?void 0:ne.label)!==oe,value:Q,checkIconPosition:M,withCheckIcon:L,nothingFoundMessage:I,unstyled:i,labelId:K.label?`${J}-label`:void 0,"aria-label":K.label?void 0:K["aria-label"],renderOption:W,scrollAreaProps:G})]}),factory$1(Combobox.HiddenInput,{value:Q,name:R,form:O,disabled:_,...U})]})});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:f,isHovered:h,children:m=null,disabled:g},v)=>{const{getStyles:y}=useSliderContext(),[b,x]=reactExports.useState(!1),$=c||i||b||f&&h;return factory$1(Box,{tabIndex:0,role:"slider","aria-label":u,"aria-valuemax":e,"aria-valuemin":t,"aria-valuenow":n,ref:v,__vars:{"--slider-thumb-offset":`${r}%`},...y("thumb",{focusable:!0}),mod:{dragging:i,disabled:g},onFocus:()=>{x(!0),"function"==typeof d&&d()},onBlur:()=>{x(!1),"function"==typeof p&&p()},onTouchStart:a,onMouseDown:a,onKeyDownCapture:s,onClick:e=>e.stopPropagation(),children:[m,factory$1(Transition,{mounted:null!=o&&!!$,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:f,name:h,marks:m,label:g,labelTransitionProps:v,labelAlwaysOn:y,thumbLabel:b,showLabelOnHover:x,thumbChildren:$,disabled:_,unstyled:C,scale:w,inverted:S,className:E,style:k,vars:T,hiddenInputProps:P,...M}=n,L=useStyles$j({name:"Slider",props:n,classes:classes$9,classNames:r,className:E,styles:o,style:k,vars:T,varsResolver:varsResolver$5,unstyled:C}),{dir:I}=useDirection(),[R,O]=reactExports.useState(!1),[A,D]=useUncontrolled({value:"number"==typeof i?clamp$2(i,c,u):i,defaultValue:"number"==typeof f?clamp$2(f,c,u):f,finalValue:clamp$2(0,c,u),onChange:a}),N=reactExports.useRef(A),F=reactExports.useRef(),z=reactExports.useRef(),B=getPosition({value:A,min:c,max:u}),j=w(A),H="function"==typeof g?g(j):g,V=p??getPrecision(d),U=reactExports.useCallback(({x:e})=>{if(!_){const t=getChangeValue({value:e,min:c,max:u,step:d,precision:V});D(t),N.current=t}},[_,c,u,d,V,D]),{ref:W,active:Y}=useMove(U,{onScrubEnd:()=>null==s?void 0:s(N.current)},I);return factory$1(SliderProvider,{value:{getStyles:L},children:factory$1(SliderRoot,{...M,ref:useMergedRef(t,F),onKeyDownCapture:e=>{var t,n,r,o,i,a;if(!_)switch(e.key){case"ArrowUp":{e.preventDefault(),null==(t=z.current)||t.focus();const n=getFloatingValue(Math.min(Math.max(A+d,c),u),V);D(n),null==s||s(n);break}case"ArrowRight":{e.preventDefault(),null==(n=z.current)||n.focus();const t=getFloatingValue(Math.min(Math.max("rtl"===I?A-d:A+d,c),u),V);D(t),null==s||s(t);break}case"ArrowDown":{e.preventDefault(),null==(r=z.current)||r.focus();const t=getFloatingValue(Math.min(Math.max(A-d,c),u),V);D(t),null==s||s(t);break}case"ArrowLeft":{e.preventDefault(),null==(o=z.current)||o.focus();const t=getFloatingValue(Math.min(Math.max("rtl"===I?A+d:A-d,c),u),V);D(t),null==s||s(t);break}case"Home":e.preventDefault(),null==(i=z.current)||i.focus(),D(c),null==s||s(c);break;case"End":e.preventDefault(),null==(a=z.current)||a.focus(),D(u),null==s||s(u)}},onMouseDownCapture:()=>{var e;return null==(e=F.current)?void 0:e.focus()},size:l,disabled:_,children:[factory$1(Track,{inverted:S,offset:0,filled:B,marks:m,min:c,max:u,value:j,disabled:_,containerProps:{ref:W,onMouseEnter:x?()=>O(!0):void 0,onMouseLeave:x?()=>O(!1):void 0},children:factory$1(Thumb,{max:u,min:c,value:j,position:B,dragging:Y,label:H,ref:z,labelTransitionProps:v,labelAlwaysOn:y,thumbLabel:b,showLabelOnHover:x,isHovered:R,disabled:_,children:$})}),factory$1("input",{type:"hidden",name:h,value:j,...P})]})})});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.Wrapper,{size:i,ref:t,...a,...c,labelElement:"div",__staticSelector:"SwitchGroup",children:factory$1(InputsGroupFieldset,{role:"group",children:s})})})});SwitchGroup.classes=Input.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:f,size:h,radius:m,wrapperProps:g,thumbIcon:v,checked:y,defaultChecked:b,onChange:x,labelPosition:$,description:_,error:C,disabled:w,variant:S,rootRef:E,mod:k,...T}=n,P=useSwitchGroupContext(),M=h||(null==P?void 0:P.size),L=useStyles$j({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:R}=extractStyleProps(T),O=useId$1(f),A=P?{checked:P.value.includes(R.value),onChange:P.onChange}:{},[D,N]=useUncontrolled({value:A.checked??y,defaultValue:b,finalValue:!1});return factory$1(InlineInput,{...L("root"),__staticSelector:"Switch",__stylesApiProps:n,id:O,size:M,labelPosition:$,label:u,description:_,error:C,disabled:w,bodyElement:"label",labelElement:"span",classNames:r,styles:a,unstyled:s,"data-checked":A.checked||void 0,variant:S,ref:E,mod:k,...I,...g,children:[factory$1("input",{...R,disabled:w,checked:D,onChange:e=>{var t;P?null==(t=A.onChange)||t.call(A,e):null==x||x(e),N(e.currentTarget.checked)},id:O,ref:t,type:"checkbox",role:"switch",...L("input")}),factory$1(Box,{"aria-hidden":"true",mod:{error:C,"label-position":$,"without-labels":!p&&!d},...L("track"),children:[factory$1(Box,{component:"span",mod:"reduce-motion",...L("thumb"),children:v}),factory$1("span",{...L("trackLabel"),children:D?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$1=reactDomExports;createRoot=m$1.createRoot,m$1.hydrateRoot;const baseServices$1={alertService:Symbol("alertService"),errorService:Symbol("errorService"),layoutService:Symbol("layoutService"),loggerService:Symbol("loggerService"),routerService:Symbol("routerService")},globalServices$1={symbolGlobalService:Symbol("symbolGlobalService"),priceGlobalService:Symbol("priceGlobalService")},mockServices$1={exchangeMockService:Symbol("exchangeMockService"),notificationMockService:Symbol("notificationMockService"),storageMockService:Symbol("storageMockService")},viewServices$1={exchangeViewService:Symbol("exchangeViewService"),notificationViewService:Symbol("notificationViewService"),storageViewService:Symbol("storageViewService")},TYPES={...baseServices$1,...globalServices$1,...mockServices$1,...viewServices$1};class ErrorService{routerService=VS(TYPES.routerService);loggerService=VS(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;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;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());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)};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)}}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():pI("router-service-path",{allowed:e=>!basePathSet.has(e),map:e=>basePathSet.has(e)?"/":e}),DEFAULT_PATH$f="/",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$f}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 _e=0;_e<256;++_e)byteToHex.push((_e+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 ExchangeMockService{loggerService=VS(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}}class NotificationMockService{loggerService=VS(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=VS(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 ExchangeViewService{loggerService=VS(TYPES.loggerService);exchangeMockService=VS(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}}class NotificationViewService{loggerService=VS(TYPES.loggerService);notificationMockService=VS(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=VS(TYPES.loggerService);storageMockService=VS(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 SymbolGlobalService{loggerService=VS(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=VS(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}}WS(TYPES.errorService,()=>new ErrorService),WS(TYPES.alertService,()=>new AlertService),WS(TYPES.layoutService,()=>new LayoutService),WS(TYPES.loggerService,()=>new LoggerService),WS(TYPES.routerService,()=>new RouterService),WS(TYPES.symbolGlobalService,()=>new SymbolGlobalService),WS(TYPES.priceGlobalService,()=>new PriceGlobalService),WS(TYPES.exchangeMockService,()=>new ExchangeMockService),WS(TYPES.notificationMockService,()=>new NotificationMockService),WS(TYPES.storageMockService,()=>new StorageMockService),WS(TYPES.exchangeViewService,()=>new ExchangeViewService),WS(TYPES.notificationViewService,()=>new NotificationViewService),WS(TYPES.storageViewService,()=>new StorageViewService);const baseServices={errorService:VS(TYPES.errorService),layoutService:VS(TYPES.layoutService),loggerService:VS(TYPES.loggerService),routerService:VS(TYPES.routerService),alertService:VS(TYPES.alertService)},globalServices={symbolGlobalService:VS(TYPES.symbolGlobalService),priceGlobalService:VS(TYPES.priceGlobalService)},mockServices={exchangeMockService:VS(TYPES.exchangeMockService),notificationMockService:VS(TYPES.notificationMockService),storageMockService:VS(TYPES.storageMockService)},viewServices={exchangeViewService:VS(TYPES.exchangeViewService),notificationViewService:VS(TYPES.notificationViewService),storageViewService:VS(TYPES.storageViewService)},ioc={...baseServices,...globalServices,...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(fL(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]})},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)})},createRedirect=e=>()=>factory$1(Dw,{handler:async()=>{await e()},height:"calc(100vh - 80px)"}),getMainRoute=async()=>"/main",useStyles$i=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:"hidden",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$i();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,{}),baseRoutes=[{path:"/error_page",noHeader:!0,element:ErrorPage}],dashboardRoutes=[{path:"/main",element:KI(()=>__vitePreload(()=>import("./index-D8ltdovC.js"),__vite__mapDeps([0,1])))},{path:"/dashboard/:mode",element:KI(()=>__vitePreload(()=>import("./index-Bl1jm8QD.js"),__vite__mapDeps([2,1])))}],routes$f=[{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=XS(routes$f,ioc.routerService.location.pathname),e=n),t}})();window.getRouteItem=getRouteItem;const 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"),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"),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"),PlayArrow=createSvgIcon$1(factory$1("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),ReportProblem=createSvgIcon$1(factory$1("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"ReportProblem"),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"),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"),WarningIcon=createSvgIcon$1(factory$1("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning"),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={},_interopRequireDefault$1=interopRequireDefaultExports;Object.defineProperty(Warning,"__esModule",{value:!0});var default_1$1=Warning.default=void 0,_createSvgIcon$1=_interopRequireDefault$1(requireCreateSvgIcon()),_jsxRuntime$1=require$$2,_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.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,_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$h=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":return"#4CAF50";case"signal.closed":return"#2196F3";case"signal.scheduled":case"average_buy.commit":case"error.info":case"error.validation":return"#FF9800";case"signal.cancelled":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"risk.rejection":return"#F44336";case"error.critical":return"#D32F2F";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":return factory$1(Close,{sx:t});case"signal.scheduled":return factory$1(Schedule,{sx:t});case"signal.cancelled":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":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":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} (${e.totalEntries} ${t$1("entries")})`;case"trailing_stop.commit":return`${t$1("Trailing stop")} ${e.symbol}`;case"trailing_take.commit":return`${t$1("Trailing take")} ${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}`;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)}},NotificationView$1=()=>{const[e,t]=reactExports.useState(),{classes:n}=useStyles$h(),[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$1,{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$1(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."));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$1(e.timestamp).format("HH:mm DD/MM/YYYY"):"N/A"}),factory$1(IconButton,{disableRipple:!0,children:factory$1(default_1$k,{})})]})},e.id))})}})]})})})]})},LOADER_HEIGHT=4,LOGO_SRC="/logo/icon512_maskable.png",LOGO_CLASS="tradegpt-logo",LOGO_SIDE=32,useStyles$g=makeStyles()(e=>({root:{position:"sticky",top:0,zIndex:9,height:"80px",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:"10px",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),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}})),actions=[{action:"github-action",icon:()=>factory$1(IconWrapper,{icon:GitHub,color:"#6A1B9A "}),label:"Open GitHub"}],AppHeader=({loading:e})=>{const{classes:t,cx:n}=useStyles$g();return factory$1(Box$1,{className:t.root,children:factory$1(Box$1,{className:t.container,children:[factory$1(rb,{onClick:()=>ik("https://github.com/tripolskypetr/backtest-kit"),className:n(t.logo,LOGO_CLASS),children:factory$1(Avatar,{style:{height:LOGO_SIDE,width:LOGO_SIDE},src:LOGO_SRC})}),factory$1(Typography,{variant:"h4",onClick:()=>ik("https://github.com/tripolskypetr/backtest-kit"),className:n(t.title,LOGO_CLASS),sx:{display:{xs:"none",sm:"flex"}},children:"Backtest Kit"}),factory$1("div",{className:t.stretch}),factory$1(NotificationView$1,{}),factory$1(xa,{className:t.actionMenu,sx:{ml:{xs:1,md:2},mr:{xs:1,sm:2}},transparent:!0,onAction:async e=>{"github-action"===e&&ik("https://github.com/tripolskypetr/backtest-kit")},options:actions}),!!e&&factory$1(LinearProgress,{className:t.loader})]})})};var define_process_env_default={},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)?void 0:_process$env.NODE_ENV),DEFAULT_OPTIONS={hasSourceMap:!IS_PRODUCTION,isMinified:IS_PRODUCTION,isPrefixed:!0},globalOptions=Object.assign({},DEFAULT_OPTIONS),hasOwnProperty$1=Object.prototype.hasOwnProperty;function normalizeOptions(e){var t,n=Object.assign({},globalOptions);for(t in e)hasOwnProperty$1.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(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,f=0,h=e.length,m=[],g="",v=0,y=1,b=2,x=3,$=4,_=5,C=6,w=7,S=8,E=v,k=0,T=!1;function P(){for(var e=k;e>0;--e)g+=u}function M(){g=g.trimEnd(),p?g+=" {":(g+="\n",P(),g+="{"),"\n"!==r&&(g+="\n"),k+=1}function L(){var e;k-=1,(g=g.trimEnd()).length>0&&l&&";"!==(e=g.charAt(g.length-1))&&"{"!==e&&(g+=";"),g+="\n",P(),g+="}",m.push(g),g=""}for(;f<h;)if(n=e.charAt(f),r=e.charAt(f+1),++f,isQuote(i))g+=n,n===i&&(i=null),"\\"===n&&r===i&&(g+=r,++f);else if(isQuote(n))g+=n,i=n;else if(T)g+=n,"*"===n&&"/"===r&&(T=!1,g+=r,++f);else if("/"!==n||"*"!==r){if(E===v){if(0===m.length&&isWhitespace(n)&&0===g.length)continue;if(n<=" "||n.charCodeAt(0)>=128){E=v,g+=n;continue}if(isName(n)||"@"===n){if(0===(o=g.trimEnd()).length)m.length>0&&(g="\n\n");else{var I=o.charAt(o.length-1);if("}"===I||";"===I)g=o+"\n\n";else for(;" "===(r=g.charAt(g.length-1))||9===r.charCodeAt(0);)g=g.substr(0,g.length-1)}g+=n,E="@"===n?y:x;continue}}if(E!==y)if(E!==b)if(E!==x)if(E!==$)if(E!==_)if(E!==C)if(E!==w)E===S&&")"===n&&g.charAt(g.length-1!=="\\"?1:0)?(g+=n,E=w):g+=n;else{if("}"===n){L(),E=v,k>0&&(E=b);continue}if(";"===n){g=g.trimEnd(),g+=";\n",E=$;continue}if(g+=n,"("===n&&"l"===g.charAt(g.length-2)&&"r"===g.charAt(g.length-3)&&"u"===g.charAt(g.length-4)){E=S;continue}}else{if(!isWhitespace(n)){g+=n,E=w;continue}isQuote(r)&&(E=w)}else{if(":"===n){g=g.trimEnd(),g+=": ",E=w,isWhitespace(r)&&(E=C);continue}if("}"===n){L(),E=v,k>0&&(E=b);continue}g+=n}else{if("}"===n){L(),E=v,k>0&&(E=b);continue}if("\n"===n){g=g.trimEnd(),g+="\n";continue}if(!isWhitespace(n)){g=g.trimEnd(),g+="\n",P(),g+=n,E=_;continue}g+=n}else{if("{"===n){M(),E=$;continue}if("}"===n){L(),E=v;continue}g+=n}else{if(isName(n)){if(0===(o=g.trimEnd()).length)m.length>0&&(g="\n\n");else if("}"===o.charAt(o.length-1))g=o+"\n\n";else for(;" "===(r=g.charAt(g.length-1))||9===r.charCodeAt(0);)g=g.substr(0,g.length-1);P(),g+=n,E=x;continue}if("}"===n){L(),E=v;continue}g+=n}else{if(";"===n){g+=n,E=v;continue}if("{"===n){o=g.trimEnd(),M(),E="@font-face"===o?$:b;continue}g+=n}}else T=!0,g+=n,g+=r,++f;return g=m.join("")+g}function getProcessedStyles(e,t){return serialize(compile(e),t.isPrefixed?middleware([prefixer$1,stringify]):stringify)}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(Zk,{})}),Fragment2=()=>factory$1(Fragment,{}),useStyles$f=makeStyles()(e=>({switch:{paddingLeft:e.spacing(1),paddingRight:e.spacing(1)}})),handleInit=so(async()=>{await HS.waitForProvide(!0),await HS.prefetch(!0)}),handleLoadStart=()=>{ioc.layoutService.setAppbarLoader(!0)},handleLoadEnd=()=>{ioc.layoutService.setAppbarLoader(!1)},App=()=>{const{classes:e}=useStyles$f(),[t,n]=reactExports.useState(getRouteItem),[r,o]=reactExports.useState(ioc.routerService.location.pathname),[i,a]=reactExports.useState(ioc.layoutService.hasAppbarLoader),[s,l]=reactExports.useState(ioc.layoutService.hasModalLoader),c=reactExports.useMemo(()=>!(null==t?void 0:t.noHeader),[t]);return Xf(()=>ioc.routerService.reloadSubject.subscribe(()=>{n(getRouteItem()),o(ioc.routerService.location.pathname)})),Xf(()=>ioc.layoutService.appbarSubject.subscribe(()=>{a(ioc.layoutService.hasAppbarLoader)})),Xf(()=>ioc.layoutService.modalSubject.subscribe(()=>{l(ioc.layoutService.hasModalLoader)})),factory$1(Fragment,{children:[c&&factory$1(AppHeader,{loading:i}),factory$1(Gg,{className:e.switch,Loader:Fragment2,history:ioc.routerService,items:routes$f,fallback:ioc.errorService.handleGlobalError,onLoadStart:handleLoadStart,onLoadEnd:handleLoadEnd,onInit:handleInit}),s&&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)"}}},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],f=24===p?0:p,h=i[0]+"-"+i[1]+"-"+i[2]+" "+f+":"+i[4]+":"+i[5]+":000",m=+t;return(o.utc(h).valueOf()-(m-=m%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$1(e).tz(t).utcOffset()+e.getTimezoneOffset():0}J$1.extend(utcPlugin),J$1.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$1(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:f,selected:h,renderDay:m,inRange:g,firstInRange:v,lastInRange:y,hidden:b,static:x,highlightToday:$,..._}=n,C=useStyles$j({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"}),w=useDatesContext();return factory$1(UnstyledButton,{...C("day",{style:b?{display:"none"}:void 0}),component:x?"div":"button",ref:t,disabled:u,"data-today":J$1(c).isSame(shiftTimezone("add",new Date,w.getTimezone()),"day")||void 0,"data-hidden":b||void 0,"data-highlight-today":$||void 0,"data-disabled":u||void 0,"data-weekend":!u&&!f&&p||void 0,"data-outside":!u&&f||void 0,"data-selected":!u&&h||void 0,"data-in-range":g&&!u||void 0,"data-first-in-range":v&&!u||void 0,"data-last-in-range":y&&!u||void 0,"data-static":x||void 0,unstyled:s,..._,children:(null==m?void 0:m(c))||c.getDate()})});function getWeekdayNames({locale:e,format:t="dd",firstDayOfWeek:n=1}){const r=J$1().day(n),o=[];for(let i=0;i<7;i+=1)"string"==typeof t?o.push(J$1(r).add(i,"days").locale(e).format(t)):o.push(t(J$1(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:f,...h}=n,m=useStyles$j({name:f||"WeekdaysRow",classes:classes$6,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver$2,rootSelector:"weekdaysRow"}),g=useDatesContext(),v=getWeekdayNames({locale:g.getLocale(c),format:d,firstDayOfWeek:g.getFirstDayOfWeek(u)}).map((e,t)=>factory$1(p,{...m("weekday"),children:e}));return factory$1(Box,{component:"tr",ref:t,...m("weekdaysRow"),...h,children:v})});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$1(e).isAfter(J$1(t).subtract(1,"day"),"day")}function isBeforeMaxDate(e,t){return!(t instanceof Date)||J$1(e).isBefore(J$1(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$1().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:f,weekendDays:h,getDayProps:m,excludeDate:g,minDate:v,maxDate:y,renderDay:b,hideOutsideDates:x,hideWeekdays:$,getDayAriaLabel:_,static:C,__getDayRef:w,__onDayKeyDown:S,__onDayClick:E,__onDayMouseEnter:k,__preventFocus:T,__stopPropagation:P,withCellSpacing:M,size:L,highlightToday:I,...R}=n,O=useStyles$j({name:c||"Month",classes:classes$5,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,rootSelector:"month"}),A=useDatesContext(),D=getMonthDays({month:f,firstDayOfWeek:A.getFirstDayOfWeek(d),consistentWeeks:A.consistentWeeks}),N=getDateInTabOrder(D,v,y,m,g,x,f),{resolvedClassNames:F,resolvedStyles:z}=useResolvedStylesApi({classNames:r,styles:a,props:n}),B=D.map((e,t)=>{const n=e.map((e,n)=>{const r=!isSameMonth(e,f),o=(null==_?void 0:_(e))||J$1(e).locale(u||A.locale).format("D MMMM YYYY"),i=null==m?void 0:m(e),a=J$1(e).isSame(N,"date");return factory$1("td",{...O("monthCell"),"data-with-spacing":M||void 0,children:factory$1(Day,{__staticSelector:c||"Month",classNames:F,styles:z,unstyled:s,"data-mantine-stop-propagation":P||void 0,highlightToday:I,renderDay:b,date:e,size:L,weekend:A.getWeekendDays(h).includes(e.getDay()),outside:r,hidden:!!x&&r,"aria-label":o,static:C,disabled:(null==g?void 0:g(e))||!isBeforeMaxDate(e,y)||!isAfterMinDate(e,v),ref:e=>null==w?void 0:w(t,n,e),...i,onKeyDown:r=>{var o;null==(o=null==i?void 0:i.onKeyDown)||o.call(i,r),null==S||S(r,{rowIndex:t,cellIndex:n,date:e})},onMouseEnter:t=>{var n;null==(n=null==i?void 0:i.onMouseEnter)||n.call(i,t),null==k||k(t,e)},onClick:t=>{var n;null==(n=null==i?void 0:i.onClick)||n.call(i,t),null==E||E(t,e)},onMouseDown:e=>{var t;null==(t=null==i?void 0:i.onMouseDown)||t.call(i,e),T&&e.preventDefault()},tabIndex:T||!a?-1:0})},e.toString())});return factory$1("tr",{...O("monthRow"),children:n})});return factory$1(Box,{component:"table",...O("month"),size:L,ref:t,...R,children:[!$&&factory$1("thead",{...O("monthThead"),children:factory$1(WeekdaysRow,{__staticSelector:c||"Month",locale:u,firstDayOfWeek:d,weekdayFormat:p,size:L,classNames:F,styles:z,unstyled:s})}),factory$1("tbody",{...O("monthTbody"),children:B})]})});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:f,disabled:h,...m}=n,g=useStyles$j({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,{...g("pickerControl"),ref:t,unstyled:s,"data-picker-control":!0,"data-selected":f&&!h||void 0,"data-disabled":h||void 0,"data-in-range":d&&!h&&!f||void 0,"data-first-in-range":c&&!h||void 0,"data-last-in-range":u&&!h||void 0,disabled:h,...m})});function isYearDisabled(e,t,n){return!(!t&&!n)&&(!(!t||!J$1(e).isBefore(t,"year"))||!(!n||!J$1(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$1().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:f,getYearControlProps:h,__staticSelector:m,__getControlRef:g,__onControlKeyDown:v,__onControlClick:y,__onControlMouseEnter:b,__preventFocus:x,__stopPropagation:$,withCellSpacing:_,size:C,...w}=n,S=useStyles$j({name:m||"YearsList",classes:classes$3,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,rootSelector:"yearsList"}),E=useDatesContext(),k=getYearsData(c),T=getYearInTabOrder(k,p,f,h),P=k.map((e,t)=>{const n=e.map((e,n)=>{const r=null==h?void 0:h(e),o=J$1(e).isSame(T,"year");return factory$1("td",{...S("yearsListCell"),"data-with-spacing":_||void 0,children:factory$1(PickerControl,{...S("yearsListControl"),size:C,unstyled:s,"data-mantine-stop-propagation":$||void 0,disabled:isYearDisabled(e,p,f),ref:e=>null==g?void 0:g(t,n,e),...r,onKeyDown:o=>{var i;null==(i=null==r?void 0:r.onKeyDown)||i.call(r,o),null==v||v(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==b||b(t,e)},onMouseDown:e=>{var t;null==(t=null==r?void 0:r.onMouseDown)||t.call(r,e),x&&e.preventDefault()},tabIndex:x||!o?-1:0,children:J$1(e).locale(E.getLocale(d)).format(u)})})});return factory$1("tr",{...S("yearsListRow"),children:n})});return factory$1(Box,{component:"table",ref:t,size:C,...S("yearsList"),...w,children:factory$1("tbody",{children:P})})});function isMonthDisabled(e,t,n){return!(!t&&!n)&&(!(!t||!J$1(e).isBefore(t,"month"))||!(!n||!J$1(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$1().isSame(e,"month"));return a||o[0]}function getMonthsData(e){const t=J$1(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$1(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:f,maxDate:h,getMonthControlProps:m,__getControlRef:g,__onControlKeyDown:v,__onControlClick:y,__onControlMouseEnter:b,__preventFocus:x,__stopPropagation:$,withCellSpacing:_,size:C,...w}=n,S=useStyles$j({name:c||"MonthsList",classes:classes$2,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,rootSelector:"monthsList"}),E=useDatesContext(),k=getMonthsData(u),T=getMonthInTabOrder(k,f,h,m),P=k.map((e,t)=>{const n=e.map((e,n)=>{const r=null==m?void 0:m(e),o=J$1(e).isSame(T,"month");return factory$1("td",{...S("monthsListCell"),"data-with-spacing":_||void 0,children:factory$1(PickerControl,{...S("monthsListControl"),size:C,unstyled:s,__staticSelector:c||"MonthsList","data-mantine-stop-propagation":$||void 0,disabled:isMonthDisabled(e,f,h),ref:e=>null==g?void 0:g(t,n,e),...r,onKeyDown:o=>{var i;null==(i=null==r?void 0:r.onKeyDown)||i.call(r,o),null==v||v(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==b||b(t,e)},onMouseDown:e=>{var t;null==(t=null==r?void 0:r.onMouseDown)||t.call(r,e),x&&e.preventDefault()},tabIndex:x||!o?-1:0,children:J$1(e).locale(E.getLocale(p)).format(d)})})});return factory$1("tr",{...S("monthsListRow"),children:n})});return factory$1(Box,{component:"table",ref:t,size:C,...S("monthsList"),...w,children:factory$1("tbody",{children:P})})});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:f,onPrevious:h,onLevelClick:m,label:g,nextDisabled:v,previousDisabled:y,hasNextLevel:b,levelControlAriaLabel:x,withNext:$,withPrevious:_,__staticSelector:C,__preventFocus:w,__stopPropagation:S,...E}=n,k=useStyles$j({name:C||"CalendarHeader",classes:classes$1,props:n,className:o,style:i,classNames:r,styles:a,unstyled:s,vars:l,varsResolver:varsResolver,rootSelector:"calendarHeader"}),T=w?e=>e.preventDefault():void 0;return factory$1(Box,{...k("calendarHeader"),ref:t,...E,children:[_&&factory$1(UnstyledButton,{...k("calendarHeaderControl"),"data-direction":"previous","aria-label":p,onClick:h,unstyled:s,onMouseDown:T,disabled:y,"data-disabled":y||void 0,tabIndex:w||y?-1:0,"data-mantine-stop-propagation":S||void 0,children:u||factory$1(AccordionChevron,{...k("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})}),factory$1(UnstyledButton,{component:b?"button":"div",...k("calendarHeaderLevel"),onClick:b?m:void 0,unstyled:s,onMouseDown:b?T:void 0,disabled:!b,"data-static":!b||void 0,"aria-label":x,tabIndex:w||!b?-1:0,"data-mantine-stop-propagation":S||void 0,children:g}),$&&factory$1(UnstyledButton,{...k("calendarHeaderControl"),"data-direction":"next","aria-label":d,onClick:f,unstyled:s,onMouseDown:T,disabled:v,"data-disabled":v||void 0,tabIndex:w||v?-1:0,"data-mantine-stop-propagation":S||void 0,children:c||factory$1(AccordionChevron,{...k("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:f,__preventFocus:h,nextIcon:m,previousIcon:g,nextLabel:v,previousLabel:y,onNext:b,onPrevious:x,nextDisabled:$,previousDisabled:_,levelControlAriaLabel:C,withNext:w,withPrevious:S,decadeLabelFormat:E,classNames:k,styles:T,unstyled:P,__staticSelector:M,__stopPropagation:L,size:I,...R}=n,O=useDatesContext(),[A,D]=getDecadeRange(r),N={__staticSelector:M||"DecadeLevel",classNames:k,styles:T,unstyled:P,size:I},F="boolean"==typeof $?$:!!a&&!J$1(D).endOf("year").isBefore(a),z="boolean"==typeof _?_:!!i&&!J$1(A).startOf("year").isAfter(i),B=(e,t)=>J$1(e).locale(o||O.locale).format(t);return factory$1(Box,{"data-decade-level":!0,size:I,ref:t,...R,children:[factory$1(CalendarHeader,{label:"function"==typeof E?E(A,D):`${B(A,E)} – ${B(D,E)}`,__preventFocus:h,__stopPropagation:L,nextIcon:m,previousIcon:g,nextLabel:v,previousLabel:y,onNext:b,onPrevious:x,nextDisabled:F,previousDisabled:z,hasNextLevel:!1,levelControlAriaLabel:C,withNext:w,withPrevious:S,...N}),factory$1(YearsList,{decade:r,locale:o,minDate:i,maxDate:a,yearsListFormat:s,getYearControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:p,__preventFocus:h,__stopPropagation:L,withCellSpacing:f,...N})]})});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:f,__preventFocus:h,nextIcon:m,previousIcon:g,nextLabel:v,previousLabel:y,onNext:b,onPrevious:x,onLevelClick:$,nextDisabled:_,previousDisabled:C,hasNextLevel:w,levelControlAriaLabel:S,withNext:E,withPrevious:k,yearLabelFormat:T,__staticSelector:P,__stopPropagation:M,size:L,classNames:I,styles:R,unstyled:O,...A}=n,D=useDatesContext(),N={__staticSelector:P||"YearLevel",classNames:I,styles:R,unstyled:O,size:L},F="boolean"==typeof _?_:!!a&&!J$1(r).endOf("year").isBefore(a),z="boolean"==typeof C?C:!!i&&!J$1(r).startOf("year").isAfter(i);return factory$1(Box,{"data-year-level":!0,size:L,ref:t,...A,children:[factory$1(CalendarHeader,{label:"function"==typeof T?T(r):J$1(r).locale(o||D.locale).format(T),__preventFocus:h,__stopPropagation:M,nextIcon:m,previousIcon:g,nextLabel:v,previousLabel:y,onNext:b,onPrevious:x,onLevelClick:$,nextDisabled:F,previousDisabled:z,hasNextLevel:w,levelControlAriaLabel:S,withNext:E,withPrevious:k,...N}),factory$1(MonthsList,{year:r,locale:o,minDate:i,maxDate:a,monthsListFormat:s,getMonthControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:p,__preventFocus:h,__stopPropagation:M,withCellSpacing:f,...N})]})});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:f,hideWeekdays:h,getDayAriaLabel:m,__getDayRef:g,__onDayKeyDown:v,__onDayClick:y,__onDayMouseEnter:b,withCellSpacing:x,highlightToday:$,__preventFocus:_,__stopPropagation:C,nextIcon:w,previousIcon:S,nextLabel:E,previousLabel:k,onNext:T,onPrevious:P,onLevelClick:M,nextDisabled:L,previousDisabled:I,hasNextLevel:R,levelControlAriaLabel:O,withNext:A,withPrevious:D,monthLabelFormat:N,classNames:F,styles:z,unstyled:B,__staticSelector:j,size:H,static:V,...U}=n,W=useDatesContext(),Y={__staticSelector:j||"MonthLevel",classNames:F,styles:z,unstyled:B,size:H},q="boolean"==typeof L?L:!!d&&!J$1(r).endOf("month").isBefore(d),G="boolean"==typeof I?I:!!u&&!J$1(r).startOf("month").isAfter(u);return factory$1(Box,{"data-month-level":!0,size:H,ref:t,...U,children:[factory$1(CalendarHeader,{label:"function"==typeof N?N(r):J$1(r).locale(o||W.locale).format(N),__preventFocus:_,__stopPropagation:C,nextIcon:w,previousIcon:S,nextLabel:E,previousLabel:k,onNext:T,onPrevious:P,onLevelClick:M,nextDisabled:q,previousDisabled:G,hasNextLevel:R,levelControlAriaLabel:O,withNext:A,withPrevious:D,...Y}),factory$1(Month,{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:a,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:d,renderDay:p,hideOutsideDates:f,hideWeekdays:h,getDayAriaLabel:m,__getDayRef:g,__onDayKeyDown:v,__onDayClick:y,__onDayMouseEnter:b,__preventFocus:_,__stopPropagation:C,static:V,withCellSpacing:x,highlightToday:$,...Y})]})});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$j({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:f,previousIcon:h,nextLabel:m,previousLabel:g,onNext:v,onPrevious:y,nextDisabled:b,previousDisabled:x,classNames:$,styles:_,unstyled:C,__staticSelector:w,__stopPropagation:S,numberOfColumns:E,levelControlAriaLabel:k,decadeLabelFormat:T,size:P,vars:M,...L}=n,I=reactExports.useRef([]),R=Array(E).fill(0).map((e,t)=>{const n=J$1(r).add(10*t,"years").toDate();return factory$1(DecadeLevel,{size:P,yearsListFormat:s,decade:n,withNext:t===E-1,withPrevious:0===t,decadeLabelFormat:T,__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 k?k(n):k,locale:o,minDate:i,maxDate:a,__preventFocus:p,__stopPropagation:S,nextIcon:f,previousIcon:h,nextLabel:m,previousLabel:g,onNext:v,onPrevious:y,nextDisabled:b,previousDisabled:x,getYearControlProps:l,__staticSelector:w||"DecadeLevelGroup",classNames:$,styles:_,unstyled:C,withCellSpacing:d})});return factory$1(LevelsGroup,{classNames:$,styles:_,__staticSelector:w||"DecadeLevelGroup",ref:t,size:P,unstyled:C,...L,children:R})});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:f,previousIcon:h,nextLabel:m,previousLabel:g,onNext:v,onPrevious:y,onLevelClick:b,nextDisabled:x,previousDisabled:$,hasNextLevel:_,classNames:C,styles:w,unstyled:S,__staticSelector:E,__stopPropagation:k,numberOfColumns:T,levelControlAriaLabel:P,yearLabelFormat:M,size:L,vars:I,...R}=n,O=reactExports.useRef([]),A=Array(T).fill(0).map((e,t)=>{const n=J$1(r).add(t,"years").toDate();return factory$1(YearLevel,{size:L,monthsListFormat:s,year:n,withNext:t===T-1,withPrevious:0===t,yearLabelFormat:M,__stopPropagation:k,__onControlClick:c,__onControlMouseEnter:u,__onControlKeyDown:(e,n)=>handleControlKeyDown({levelIndex:t,rowIndex:n.rowIndex,cellIndex:n.cellIndex,event:e,controlsRef:O}),__getControlRef:(e,n,r)=>{Array.isArray(O.current[t])||(O.current[t]=[]),Array.isArray(O.current[t][e])||(O.current[t][e]=[]),O.current[t][e][n]=r},levelControlAriaLabel:"function"==typeof P?P(n):P,locale:o,minDate:i,maxDate:a,__preventFocus:p,nextIcon:f,previousIcon:h,nextLabel:m,previousLabel:g,onNext:v,onPrevious:y,onLevelClick:b,nextDisabled:x,previousDisabled:$,hasNextLevel:_,getMonthControlProps:l,classNames:C,styles:w,unstyled:S,__staticSelector:E||"YearLevelGroup",withCellSpacing:d})});return factory$1(LevelsGroup,{classNames:C,styles:w,__staticSelector:E||"YearLevelGroup",ref:t,size:L,unstyled:S,...R,children:A})});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:f,hideWeekdays:h,getDayAriaLabel:m,__onDayClick:g,__onDayMouseEnter:v,withCellSpacing:y,highlightToday:b,__preventFocus:x,nextIcon:$,previousIcon:_,nextLabel:C,previousLabel:w,onNext:S,onPrevious:E,onLevelClick:k,nextDisabled:T,previousDisabled:P,hasNextLevel:M,classNames:L,styles:I,unstyled:R,numberOfColumns:O,levelControlAriaLabel:A,monthLabelFormat:D,__staticSelector:N,__stopPropagation:F,size:z,static:B,vars:j,...H}=n,V=reactExports.useRef([]),U=Array(O).fill(0).map((e,t)=>{const n=J$1(r).add(t,"months").toDate();return factory$1(MonthLevel,{month:n,withNext:t===O-1,withPrevious:0===t,monthLabelFormat:D,__stopPropagation:F,__onDayClick:g,__onDayMouseEnter:v,__onDayKeyDown:(e,n)=>handleControlKeyDown({levelIndex:t,rowIndex:n.rowIndex,cellIndex:n.cellIndex,event:e,controlsRef:V}),__getDayRef:(e,n,r)=>{Array.isArray(V.current[t])||(V.current[t]=[]),Array.isArray(V.current[t][e])||(V.current[t][e]=[]),V.current[t][e][n]=r},levelControlAriaLabel:"function"==typeof A?A(n):A,locale:o,firstDayOfWeek:i,weekdayFormat:a,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:d,renderDay:p,hideOutsideDates:f,hideWeekdays:h,getDayAriaLabel:m,__preventFocus:x,nextIcon:$,previousIcon:_,nextLabel:C,previousLabel:w,onNext:S,onPrevious:E,onLevelClick:k,nextDisabled:T,previousDisabled:P,hasNextLevel:M,classNames:L,styles:I,unstyled:R,__staticSelector:N||"MonthLevelGroup",size:z,static:B,withCellSpacing:y,highlightToday:b})});return factory$1(LevelsGroup,{classNames:L,styles:I,__staticSelector:N||"MonthLevelGroup",ref:t,size:z,...H,children:U})});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:f,ariaLabels:h,onYearSelect:m,onMonthSelect:g,onYearMouseEnter:v,onMonthMouseEnter:y,__updateDateOnYearSelect:b,__updateDateOnMonthSelect:x,firstDayOfWeek:$,weekdayFormat:_,weekendDays:C,getDayProps:w,excludeDate:S,renderDay:E,hideOutsideDates:k,hideWeekdays:T,getDayAriaLabel:P,monthLabelFormat:M,nextIcon:L,previousIcon:I,__onDayClick:R,__onDayMouseEnter:O,withCellSpacing:A,highlightToday:D,monthsListFormat:N,getMonthControlProps:F,yearLabelFormat:z,yearsListFormat:B,getYearControlProps:j,decadeLabelFormat:H,classNames:V,styles:U,unstyled:W,minDate:Y,maxDate:q,locale:G,__staticSelector:K,size:X,__preventFocus:Z,__stopPropagation:J,onNextDecade:Q,onPreviousDecade:ee,onNextYear:te,onPreviousYear:ne,onNextMonth:re,onPreviousMonth:oe,static:ie,__timezoneApplied:ae,...se}=n,{resolvedClassNames:le,resolvedStyles:ce}=useResolvedStylesApi({classNames:V,styles:U,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,fe]=useUncontrolledDates({type:"default",value:c,defaultValue:u,onChange:d,applyTimezone:!ae}),he={__staticSelector:K||"Calendar",styles:ce,classNames:le,unstyled:W,size:X},me=useDatesContext(),ge=f||p||1,ve=new Date,ye=pe||shiftTimezone("add",Y&&Y>ve?Y:ve,me.getTimezone());return factory$1(Box,{ref:t,size:X,"data-calendar":!0,...se,children:["month"===ue&&factory$1(MonthLevelGroup,{month:ye,minDate:Y,maxDate:q,firstDayOfWeek:$,weekdayFormat:_,weekendDays:C,getDayProps:w,excludeDate:S,renderDay:E,hideOutsideDates:k,hideWeekdays:T,getDayAriaLabel:P,onNext:()=>{const e=J$1(ye).add(ge,"month").toDate();null==re||re(e),fe(e)},onPrevious:()=>{const e=J$1(ye).subtract(ge,"month").toDate();null==oe||oe(e),fe(e)},hasNextLevel:"month"!==o,onLevelClick:()=>de("year"),numberOfColumns:p,locale:G,levelControlAriaLabel:null==h?void 0:h.monthLevelControl,nextLabel:null==h?void 0:h.nextMonth,nextIcon:L,previousLabel:null==h?void 0:h.previousMonth,previousIcon:I,monthLabelFormat:M,__onDayClick:R,__onDayMouseEnter:O,__preventFocus:Z,__stopPropagation:J,static:ie,withCellSpacing:A,highlightToday:D,...he}),"year"===ue&&factory$1(YearLevelGroup,{year:ye,numberOfColumns:p,minDate:Y,maxDate:q,monthsListFormat:N,getMonthControlProps:F,locale:G,onNext:()=>{const e=J$1(ye).add(ge,"year").toDate();null==te||te(e),fe(e)},onPrevious:()=>{const e=J$1(ye).subtract(ge,"year").toDate();null==ne||ne(e),fe(e)},hasNextLevel:"month"!==o&&"year"!==o,onLevelClick:()=>de("decade"),levelControlAriaLabel:null==h?void 0:h.yearLevelControl,nextLabel:null==h?void 0:h.nextYear,nextIcon:L,previousLabel:null==h?void 0:h.previousYear,previousIcon:I,yearLabelFormat:z,__onControlMouseEnter:y,__onControlClick:(e,t)=>{x&&fe(t),de(clampLevel("month",i,o)),null==g||g(t)},__preventFocus:Z,__stopPropagation:J,withCellSpacing:A,...he}),"decade"===ue&&factory$1(DecadeLevelGroup,{decade:ye,minDate:Y,maxDate:q,yearsListFormat:B,getYearControlProps:j,locale:G,onNext:()=>{const e=J$1(ye).add(10*ge,"year").toDate();null==Q||Q(e),fe(e)},onPrevious:()=>{const e=J$1(ye).subtract(10*ge,"year").toDate();null==ee||ee(e),fe(e)},numberOfColumns:p,nextLabel:null==h?void 0:h.nextDecade,nextIcon:L,previousLabel:null==h?void 0:h.previousDecade,previousIcon:I,decadeLabelFormat:H,__onControlMouseEnter:v,__onControlClick:(e,t)=>{b&&fe(t),de(clampLevel("year",i,o)),null==m||m(t)},__preventFocus:Z,__stopPropagation:J,withCellSpacing:A,...he})]})});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:f,onYearSelect:h,onMonthSelect:m,onYearMouseEnter:g,onMonthMouseEnter:v,onNextMonth:y,onPreviousMonth:b,onNextYear:x,onPreviousYear:$,onNextDecade:_,onPreviousDecade:C,withCellSpacing:w,highlightToday:S,__updateDateOnYearSelect:E,__updateDateOnMonthSelect:k,firstDayOfWeek:T,weekdayFormat:P,weekendDays:M,getDayProps:L,excludeDate:I,renderDay:R,hideOutsideDates:O,hideWeekdays:A,getDayAriaLabel:D,monthLabelFormat:N,monthsListFormat:F,getMonthControlProps:z,yearLabelFormat:B,yearsListFormat:j,getYearControlProps:H,decadeLabelFormat:V,allowSingleDateInRange:U,allowDeselect:W,minDate:Y,maxDate:q,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:f,onYearSelect:h,onMonthSelect:m,onYearMouseEnter:g,onMonthMouseEnter:v,onNextMonth:y,onPreviousMonth:b,onNextYear:x,onPreviousYear:$,onNextDecade:_,onPreviousDecade:C,withCellSpacing:w,highlightToday:S,__updateDateOnYearSelect:E,__updateDateOnMonthSelect:k,firstDayOfWeek:T,weekdayFormat:P,weekendDays:M,getDayProps:L,excludeDate:I,renderDay:R,hideOutsideDates:O,hideWeekdays:A,getDayAriaLabel:D,monthLabelFormat:N,monthsListFormat:F,getMonthControlProps:z,yearLabelFormat:B,yearsListFormat:j,getYearControlProps:H,decadeLabelFormat:V,allowSingleDateInRange:U,allowDeselect:W,minDate:Y,maxDate:q,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$1(e).isAfter(t,"date"))&&(!n||!J$1(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:f,dateParser:h,minDate:m,maxDate:g,fixOnBlur:v,onFocus:y,onBlur:b,onClick:x,readOnly:$,name:_,form:C,rightSection:w,unstyled:S,classNames:E,styles:k,allowDeselect:T,preserveTime:P,date:M,defaultDate:L,onDateChange:I,...R}=n,[O,A]=reactExports.useState(!1),{calendarProps:D,others:N}=pickCalendarProps(R),F=useDatesContext(),z=h||(e=>{const t=J$1(e,f,F.getLocale(p)).toDate();return Number.isNaN(t.getTime())?dateStringParser(e,F.getTimezone()):t}),B=void 0!==T?T:l,j=e=>e?J$1(e).locale(F.getLocale(p)).format(f):"",[H,V,U]=useUncontrolledDates({type:"default",value:i,defaultValue:a,onChange:s}),[W,Y]=useUncontrolledDates({type:"default",value:M,defaultValue:a||L,onChange:I});reactExports.useEffect(()=>{U&&Y(i)},[U,i]);const[q,G]=reactExports.useState(j(H));reactExports.useEffect(()=>{G(j(H))},[F.getLocale(p)]);const K=w||(l&&H&&!$?factory$1(CloseButton,{variant:"transparent",onMouseDown:e=>e.preventDefault(),tabIndex:-1,onClick:()=>{V(null),!U&&G(""),A(!1)},unstyled:S,size:r.size||"sm",...c}):null);return useDidUpdate(()=>{void 0!==H&&!O&&G(j(H))},[H]),factory$1(Fragment,{children:[factory$1(Input.Wrapper,{...o,__staticSelector:"DateInput",children:factory$1(Popover,{opened:O,trapFocus:!1,position:"bottom-start",disabled:$,withRoles:!1,unstyled:S,...u,children:[factory$1(Popover.Target,{children:factory$1(Input,{"data-dates-input":!0,"data-read-only":$||void 0,autoComplete:"off",ref:t,value:q,onChange:e=>{const t=e.currentTarget.value;if(G(t),A(!0),""===t.trim()&&l)V(null);else{const e=z(t);isDateValid({date:e,minDate:m,maxDate:g})&&(V(e),Y(e))}},onBlur:e=>{null==b||b(e),A(!1),v&&G(j(H))},onFocus:e=>{null==y||y(e),A(!0)},onClick:e=>{null==x||x(e),A(!0)},readOnly:$,rightSection:K,...r,...N,__staticSelector:"DateInput"})}),factory$1(Popover.Dropdown,{onMouseDown:e=>e.preventDefault(),"data-dates-dropdown":!0,children:factory$1(Calendar,{__staticSelector:"DateInput",__timezoneApplied:!0,...D,classNames:E,styles:k,unstyled:S,__preventFocus:!0,minDate:m,maxDate:g,locale:p,getDayProps:e=>({...null==d?void 0:d(e),selected:J$1(H).isSame(e,"day"),onClick:()=>{const t=P?assignTime(H,e):e,n=l&&B&&J$1(H).isSame(e,"day")?null:t;V(n),!U&&G(j(n)),A(!1)}}),size:r.size,date:W,onDateChange:Y})})]})}),factory$1(HiddenDatesInput,{name:_,form:C,value:H,type:"default"})]})});DateInput.classes={...Input.classes,...Calendar.classes},DateInput.displayName="@mantine/dates/DateInput";
211
211
  /*! *****************************************************************************
212
212
  Copyright (c) Microsoft Corporation.
213
213
 
@@ -222,7 +222,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
222
222
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
223
223
  PERFORMANCE OF THIS SOFTWARE.
224
224
  ***************************************************************************** */
225
- var Z$1=function(){return Z$1=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},Z$1.apply(this,arguments)};function $$1(e,t,n,r){return new(n||(n=Promise))(function(t,o){function i(e){try{s(r.next(e))}catch(t){o(t)}}function a(e){try{s(r.throw(e))}catch(t){o(t)}}function s(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n(function(e){e(r)})).then(i,a)}s((r=r.apply(e,[])).next())})}function ee(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function te(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 ne(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))}var re={variant:"filled",size:"md",radius:"md"},ie=1e4,oe="Loading",ae=Symbol("never-pos"),le=function(e,t,n,r,o,i,a,s,l,c,u,d,p,f,h,m){return Z$1(Z$1(Z$1({},n?{leftSection:reactExports.createElement(IconButton,{disabled:c,disableRipple:!h,tabIndex:a,onClick:function(){o&&o(d,e,t,function(e){return p(e,{skipReadonly:!0})},f)}},reactExports.createElement(n,{data:e,payload:t,disabled:c,readonly:u})),leftSectionProps:{style:{width:"auto"}}}:{}),r&&!l?{rightSection:reactExports.createElement(IconButton,{disabled:c,disableRipple:!m,tabIndex:s,onClick:function(){i&&i(d,e,t,function(e){return p(e,{skipReadonly:!0})},f)}},reactExports.createElement(r,{data:e,payload:t,disabled:c,readonly:u})),rightSectionProps:{style:{width:"auto"}}}:{}),l?{rightSection:reactExports.createElement(IconButton,{disabled:c},reactExports.createElement(CircularProgress,{color:"inherit",size:20})),rightSectionProps:{style:{width:"auto"}}}:{})},ue=["Yes","No"],ce=function(e,t,n,r){return $$1(void 0,void 0,void 0,function(){return ee(this,function(o){switch(o.label){case 0:return Array.isArray(e)?[4,Promise.all(e.map(function(e){return t(e,n,r)}))]:[3,2];case 1:case 3:return[2,o.sent()];case 2:return e?[4,t(e,n,r)]:[3,4];case 4:return[2,null]}})})},de=Symbol("never-pos"),se=[],fe="##:##",ve=Symbol("never-pos"),pe={Choose:function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.description,s=void 0===a?"":a,l=e.title,c=void 0===l?"":l,u=e.placeholder,d=void 0===u?"Not chosen":u,p=e.dirty,f=e.outlined,h=e.loading,m=e.inputRef,g=e.onChange,v=e.choose,y=void 0===v?function(){return"unknown"}:v,b=e.tr,x=void 0===b?function(e){return e}:b,$=Ir(),_=Ur().object,C=te(kc(function(){return $$1(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return[4,ce(r,x,_,$)];case 1:return[2,e.sent()]}})})},{deps:[r]}),2),w=C[0],S=C[1].loading,E=no(function(){return $$1(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return r?(g(null),[2]):[4,y(_,$)];case 1:return e=t.sent(),g(Array.isArray(e)?e.length?e:null:e||null),[2]}})})}),k=E.execute,T=E.loading,P=h||S||T;return reactExports.createElement(TextInput,Z$1({},re,{variant:f?"default":"filled",readOnly:!0,ref:m,label:c,error:p&&(t||n),description:s,style:{opacity:o?.5:void 0},rightSection:reactExports.createElement(ui$1,{sx:{pointerEvents:i?"none":"all",mr:1},disabled:P||o,variant:"outlined",size:"small",color:r?"secondary":"primary",onClick:function(){return $$1(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return[4,k()];case 1:return e.sent(),[2]}})})}},r&&"Deselect",!r&&"Choose"),rightSectionProps:{style:{width:"auto"}},value:P?"Loading":String(w||""),placeholder:d,onClick:function(e){var t;null===(t=e.currentTarget)||void 0===t||t.blur(),r||k()},disabled:o}))},Combo:function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=void 0===o?"":o,a=e.placeholder,s=void 0===a?"":a,l=e.outlined,c=void 0!==l&&l,u=e.itemList,d=void 0===u?[]:u,p=e.watchItemList,f=e.noDeselect,h=e.freeSolo,m=e.title,g=void 0===m?"":m,v=e.dirty,y=e.invalid,b=e.incorrect,x=e.tr,$=void 0===x?function(e){return e.toString()}:x,_=e.onChange,C=Ur().object,w=Ir(),S=te(reactExports.useState(function(){return{options:[],labels:{}}}),2),E=S[0],k=S[1],T=reactExports.useRef(!1),P=il([E],10),M=reactExports.useMemo(function(){return Array.isArray(t)?te(t,1)[0]:t},[t]),L=ol().fallback,I=Ai$1(function(e){return $$1(void 0,void 0,void 0,function(){var t,n,r,o,i,a,s;return ee(this,function(l){switch(l.label){case 0:return t={},d=d||[],r=[[]],o=Set.bind,a=(i=Object).values,"function"!=typeof d?[3,2]:[4,Promise.resolve(d(e,w))];case 1:return s=l.sent(),[3,3];case 2:s=d,l.label=3;case 3:return n=ne.apply(void 0,r.concat([te.apply(void 0,[new(o.apply(Set,[void 0,a.apply(i,[s])]))]),!1])),[4,Promise.all(n.map(function(n){return $$1(void 0,void 0,void 0,function(){var r,o;return ee(this,function(i){switch(i.label){case 0:return r=t,o=n,[4,Promise.resolve($(n,e,w))];case 1:return[2,r[o]=i.sent()]}})})}))];case 4:return l.sent(),h&&M&&!n.includes(M)&&n.push(M),k({labels:t,options:n}),T.current=!0,[4,P()];case 5:return l.sent(),[2]}})})},{fallback:L}),R=I.loading,O=I.execute,A=function(e){return Object.values(e||{}).sort(function(e,t){return t.localeCompare(e)}).join("-")}(M),D=reactExports.useRef(null),N=reactExports.useRef(!0);reactExports.useEffect(function(){if(!N.current){if(D.current===C)return;if(!p)return}D.current=C,N.current=!1,O(C)},[A,n,v,y,b,C,r]);var F=reactExports.useMemo(function(){return E.options.map(function(e){return{value:e,label:E.labels[e]||e}})},[E]);return R||!T.current?reactExports.createElement(Select,Z$1({},re,{searchable:!0,variant:c?"default":"filled",disabled:!0,label:g,error:v&&(y||b),description:i,placeholder:"Loading",comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}})):reactExports.createElement(Select,Z$1({},re,{searchable:!0,value:M,style:{opacity:n?.5:void 0},allowDeselect:!f,variant:c?"default":"filled",onChange:function(e){_(e||null)},label:g,disabled:n,readOnly:r,error:v&&(y||b),description:i,placeholder:s,data:F,comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}}))},ComboArray:function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=void 0===o?"":o,a=e.placeholder,s=void 0===a?"":a,l=e.outlined,c=void 0!==l&&l,u=e.itemList,d=void 0===u?[]:u,p=e.watchItemList,f=e.noDeselect,h=e.freeSolo,m=e.title,g=void 0===m?"":m,v=e.dirty,y=e.invalid,b=e.incorrect,x=e.tr,$=void 0===x?function(e){return e.toString()}:x,_=e.onChange,C=Ur().object,w=Ir(),S=te(reactExports.useState(function(){return{options:[],labels:{}}}),2),E=S[0],k=S[1],T=reactExports.useRef(!1),P=il([E],10),M=reactExports.useMemo(function(){return Array.isArray(t)?te(t,1)[0]:t},[t]),L=ol().fallback,I=Ai$1(function(e){return $$1(void 0,void 0,void 0,function(){var t,n,r,o,i,a,s;return ee(this,function(l){switch(l.label){case 0:return t={},d=d||[],r=[[]],o=Set.bind,a=(i=Object).values,"function"!=typeof d?[3,2]:[4,Promise.resolve(d(e,w))];case 1:return s=l.sent(),[3,3];case 2:s=d,l.label=3;case 3:return n=ne.apply(void 0,r.concat([te.apply(void 0,[new(o.apply(Set,[void 0,a.apply(i,[s])]))]),!1])),[4,Promise.all(n.map(function(n){return $$1(void 0,void 0,void 0,function(){var r,o;return ee(this,function(i){switch(i.label){case 0:return r=t,o=n,[4,Promise.resolve($(n,e,w))];case 1:return[2,r[o]=i.sent()]}})})}))];case 4:return l.sent(),h&&M&&!n.includes(M)&&n.push(M),k({labels:t,options:n}),T.current=!0,[4,P()];case 5:return l.sent(),[2]}})})},{fallback:L}),R=I.loading,O=I.execute,A=function(e){return Object.values(e||{}).sort(function(e,t){return t.localeCompare(e)}).join("-")}(M),D=reactExports.useRef(null),N=reactExports.useRef(!0);reactExports.useEffect(function(){if(!N.current){if(D.current===C)return;if(!p)return}D.current=C,N.current=!1,O(C)},[A,n,v,y,b,C,r]);var F=reactExports.useMemo(function(){return E.options.map(function(e){return{value:e,label:E.labels[e]||e}})},[E]);return R||!T.current?reactExports.createElement(Select,Z$1({},re,{searchable:!0,variant:c?"default":"filled",disabled:!0,label:g,error:v&&(y||b),description:i,placeholder:"Loading",comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}})):reactExports.createElement(Select,Z$1({},re,{searchable:!0,value:M,allowDeselect:!f,variant:c?"default":"filled",onChange:function(e){_(e?[e]:null)},label:g,disabled:n,readOnly:r,error:v&&(y||b),description:i,placeholder:s,data:F,style:{opacity:n?.5:void 0},comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}}))},Complete:function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.inputType,s=void 0===a?"text":a,l=e.inputMode,c=void 0===l?"text":l,u=e.inputPattern,d=void 0===u?void 0:u,p=e.description,f=void 0===p?"":p,h=e.keepRaw,m=void 0!==h&&h,g=e.title,v=void 0===g?"":g,y=e.placeholder,b=void 0===y?"":y,x=e.inputAutocomplete,$=void 0===x?"off":x,_=e.dirty,C=e.loading,w=e.tip,S=void 0===w?function(){return["unset"]}:w,E=e.tipSelect,k=e.autoFocus,T=e.outlined,P=e.onChange,M=e.fieldReadonly,L=e.inputFormatterSymbol,I=void 0===L?"0":L,R=e.inputFormatterAllowed,O=e.inputFormatterReplace,A=e.inputFormatterTemplate,D=void 0===A?"":A,N=e.inputFormatter,F=void 0===N?function(e){return yl(e,D,{symbol:I,allowed:R,replace:O})}:N,z=e.withContextMenu,B=tl().isMobile,j=Ir(),H=Ur(),V=H.object,U=H.changeObject,W=uo().requestSubject,Y=ol().fallback,q=void 0===Y?function(e){throw e}:Y,G=bi$1(),K=G.elementRef,X=G.size,Z=reactExports.useRef(null),J=te(reactExports.useState(null),2),Q=J[0],oe=J[1],ie=function(){oe(null)},ae=te(reactExports.useState(-1),2),se=ae[0],le=ae[1],ce=te(reactExports.useState(!1),2),ue=ce[0],pe=ce[1],fe=te(reactExports.useState([]),2),he=fe[0],me=fe[1],ge=C||ue,ve=zr(r),ye=te(ji$1(r,500),1)[0],be=zr(S),xe=zr(V),$e=to$1(P),_e=el({data:V,payload:j,itemList:void 0,tr:void 0,tip:S,keepRaw:!1,onValueChange:P,placeholder:b,title:v,type:Mn$1.Complete,value:r}),Ce=reactExports.useMemo(function(){var e=de;return{render:function(){if("text"===s){var t=Z.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=de)}},pos:function(){var t,n=Z.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<D.length&&D[n]!==I;n++)t+=1;return t}(e)),e}}},[]);reactExports.useLayoutEffect(function(){if(D){var e=Z.current,t=function(){return Ce.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}}},[Z.current]),reactExports.useLayoutEffect(function(){(D||O||R)&&Ce.render()},[r]);var we=reactExports.useMemo(function(){return Gn$1(function(e){return $$1(void 0,void 0,void 0,function(){return ee(this,function(t){switch(t.label){case 0:return le(-1),[4,$e(e)];case 1:return t.sent(),[2]}})})})},[]),Se=reactExports.useMemo(function(){return Gn$1(function(){return $$1(void 0,void 0,void 0,function(){var e,t,n,r,o;return ee(this,function(i){switch(i.label){case 0:pe(!0),i.label=1;case 1:return i.trys.push([1,5,6,7]),"function"!=typeof be.current?[3,3]:[4,be.current(ve.current||"",xe.current,j)];case 2:return t=i.sent(),[3,4];case 3:t=be.current,i.label=4;case 4:if(e=t,!Array.isArray(e))throw new Error("CompleteField tip invalid result");return!m&&ve.current&&(n=String(ve.current||"").toLowerCase(),r=n.split(" "),e=e.filter(function(e){var t=String(e).toLowerCase().split(" "),n=!0;return r.forEach(function(e){n=n&&t.some(function(t){return t.includes(e)})}),n})),e=e.slice(0,100),le(-1),me(ne([],te(new Set(e)),!1)),[3,7];case 5:return o=i.sent(),q(o),[3,7];case 6:return pe(!1),[7];case 7:return[2]}})})})},[]);reactExports.useEffect(function(){open&&Se()},[ye,open]);var Ee=function(){var e;ie(),le(-1),null===(e=Z.current)||void 0===e||e.setSelectionRange(null,null)};return reactExports.useEffect(function(){return z&&W.subscribe(function(){Ee()})},[]),reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("div",{ref:K},reactExports.createElement(TextInput,Z$1({},re,{variant:T?"default":"filled",ref:Z,label:v,error:_&&(t||n),description:f,pattern:d,readOnly:i,style:{opacity:o?.5:void 0},rightSection:reactExports.createElement(IconButton,{onClick:function(e){var t;e.preventDefault(),e.stopPropagation(),ge||open||!r||(we(""),null===(t=Z.current)||void 0===t||t.setSelectionRange(null,null))},disabled:o},ge&&reactExports.createElement(CircularProgress,{color:"inherit",size:20}),!ge&&!open&&!!r&&reactExports.createElement(default_1$i,null)),rightSectionProps:{style:{width:"auto"}},type:s,inputMode:c,autoFocus:k,autoComplete:$,value:String(r||""),placeholder:b,onChange:function(e){var t=e.target,n=t.value;if(D||O||R){n="";for(var r=0;r<t.value.length;r++)n+=t.value[r],n=F(n);Ce.pos()}P(n)},onClick:function(e){var t=e.clientX,n=e.clientY,r=e.target;if(!M)if(B)_e();else{var o=document.elementFromPoint(t,n);oe(o||r)}},onKeyDown:function(e){(function(t){var n;if("Escape"===t)return ie(),le(-1),e.currentTarget.blur(),!0;if("ArrowDown"===t)return le(function(e){return Math.min(Math.max(e+1,0),he.length-1)}),!0;if("ArrowUp"===t)return le(function(e){return Math.min(Math.max(e-1,0),he.length-1)}),!0;if("Enter"===t){var r=he.find(function(e,t){return t===se});if(r)return we(r),null===(n=Z.current)||void 0===n||n.setSelectionRange(r.length,r.length),ie(),le(-1),!0}return!1})(e.key)&&e.preventDefault()},disabled:o}))),reactExports.createElement(Popover$1,{open:!!Q,anchorEl:Q,onClose:Ee,anchorOrigin:{vertical:"bottom",horizontal:"left"},disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0},!!Q&&reactExports.createElement(vi$1,{component:List,sx:{width:X.width,height:he.length?Math.min(36*he.length,250):36,mb:1,maxHeight:"45vh"},minRowHeight:36},!he.length&&reactExports.createElement(ListItem,{disableGutters:!0,dense:!0},reactExports.createElement(ListItemButton,{disableRipple:!0,disableTouchRipple:!0},reactExports.createElement(ListItemText,{primary:ge?"Loading":"No tips"}))),he.map(function(e,t){return reactExports.createElement(ListItem,{disableGutters:!0,dense:!0,key:"".concat(e,"-").concat(t)},reactExports.createElement(ListItemButton,{selected:t===se,onClick:function(t){t.preventDefault(),t.stopPropagation(),we(e),E&&E(e,xe.current,j,U),ie()}},reactExports.createElement(ListItemText,{primary:e})))}))))},Date:function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.outlined,i=e.disabled,a=e.readonly,s=e.description,l=void 0===s?"":s,c=e.placeholder,u=void 0===c?"DD/MM/YYYY":c,d=e.title,p=void 0===d?"Text":d,f=e.dirty,h=e.inputRef,m=e.onChange,g=reactExports.useMemo(function(){if(r){var e=tM.parseDate(r);if(!e)return null;var t=J$1();return(t=(t=(t=t.set("date",e.day)).set("month",e.month-1)).set("year",e.year)).toDate()}return null},[r]);return reactExports.createElement(DateInput,Z$1({},re,{variant:o?"default":"filled",label:p,ref:h,readOnly:a,disabled:i,valueFormat:"DD/MM/YYYY",error:f&&(t||n),description:l,value:g,placeholder:u,style:{opacity:i?.5:void 0},popoverProps:{withinPortal:!0,shadow:"xl",zIndex:ie},onChange:function(e){if(e){var t=J$1(e),n=t.get("date"),r=t.get("month")+1,o=t.get("year");m(new tM.Date(n,r,o).toString())}else m(null)}}))},Items:function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=e.placeholder,a=e.outlined,s=void 0!==a&&a,l=e.itemList,c=void 0===l?[]:l,u=e.freeSolo,d=e.watchItemList,p=e.dirty,f=e.invalid,h=e.incorrect,m=e.title,g=e.tr,v=void 0===g?function(e){return e.toString()}:g,y=e.onChange,b=Ur().object,x=Ir(),$=te(reactExports.useState(function(){return{options:[],labels:{}}}),2),_=$[0],C=$[1],w=reactExports.useRef(!1),S=il([_],10),E=reactExports.useMemo(function(){if("string"==typeof t)return[t];if(t){var e=Object.values(t);return _n$1(e)?[]:e}return[]},[t]),k=reactExports.useRef(E),T=reactExports.useMemo(function(){return sl(k.current,E)?k.current:(k.current=E,E)},[E]),P=ol().fallback,M=Ai$1(function(e){return $$1(void 0,void 0,void 0,function(){var t,n,r,o,i,a,s;return ee(this,function(l){switch(l.label){case 0:return t={},c=c||[],r=[[]],o=Set.bind,a=(i=Object).values,"function"!=typeof c?[3,2]:[4,Promise.resolve(c(e,x))];case 1:return s=l.sent(),[3,3];case 2:s=c,l.label=3;case 3:return n=ne.apply(void 0,r.concat([te.apply(void 0,[new(o.apply(Set,[void 0,a.apply(i,[s])]))]),!1])),[4,Promise.all(n.map(function(n){return $$1(void 0,void 0,void 0,function(){var r,o;return ee(this,function(i){switch(i.label){case 0:return r=t,o=n,[4,Promise.resolve(v(n,e,x))];case 1:return[2,r[o]=i.sent()]}})})}))];case 4:return l.sent(),u&&T.forEach(function(e){n.includes(e)||n.push(e)}),C({options:n,labels:t}),w.current=!0,[4,S()];case 5:return l.sent(),[2]}})})},{fallback:P}),L=M.loading,I=M.execute,R=function(e){return Object.values(e||{}).sort(function(e,t){return t.localeCompare(e)}).join("-")}(T),O=reactExports.useRef(null),A=reactExports.useRef(!0);reactExports.useEffect(function(){if(!A.current){if(O.current===b)return;if(!d)return}O.current=b,A.current=!1,I(b)},[R,n,p,f,h,b,r]);var D=reactExports.useMemo(function(){return _.options.map(function(e){return{value:e,label:_.labels[e]||e}})},[_]);return L||!w.current?reactExports.createElement(MultiSelect,Z$1({},re,{searchable:!0,variant:s?"default":"filled",disabled:!0,label:m,error:p&&(f||h),description:o,placeholder:"Loading",comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}})):reactExports.createElement(MultiSelect,Z$1({},re,{searchable:!0,value:T,variant:s?"default":"filled",onChange:function(e){y((null==e?void 0:e.length)?e:null)},label:m,disabled:n,readOnly:r,error:p&&(f||h),description:o,placeholder:i,style:{opacity:n?.5:void 0},data:D,comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}}))},Text:function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.inputType,s=void 0===a?"text":a,l=e.inputMode,c=void 0===l?"text":l,u=e.inputPattern,d=void 0===u?void 0:u,p=e.description,f=void 0===p?"":p,h=e.title,m=void 0===h?"":h,g=e.leadingIcon,v=e.trailingIcon,y=e.leadingIconClick,b=e.trailingIconClick,x=e.leadingIconTabIndex,$=e.trailingIconTabIndex,_=e.leadingIconRipple,C=void 0===_||_,w=e.trailingIconRipple,S=void 0===w||w,E=e.inputRows,k=void 0===E?1:E,T=e.placeholder,P=void 0===T?"":T,M=e.inputAutocomplete,L=void 0===M?"off":M,I=e.inputFormatterSymbol,R=void 0===I?"0":I,O=e.inputFormatterAllowed,A=e.inputFormatterReplace,D=e.inputFormatterTemplate,N=void 0===D?"":D,F=e.inputFormatter,z=void 0===F?function(e){return yl(e,N,{symbol:R,allowed:O,replace:A})}:F,B=e.dirty,j=e.outlined,H=e.loading,V=e.autoFocus,U=e.inputRef,W=e.onChange,Y=Ir(),q=Ur(),G=q.object,K=q.changeObject,X=reactExports.useRef(),Z=reactExports.useMemo(function(){var e=ae;return{render:function(){if("text"===s){var t=X.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=ae)}},pos:function(){var t,n=X.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<N.length&&N[n]!==R;n++)t+=1;return t}(e)),e}}},[]);return reactExports.useLayoutEffect(function(){if(N){var e=X.current,t=function(){return Z.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}}},[X.current]),reactExports.useLayoutEffect(function(){(N||A||O)&&Z.render()},[r]),k>1?reactExports.createElement(Textarea,Z$1({},re,{ref:function(e){X.current=e,U&&U(e)},label:m,error:B&&(t||n),autosize:!0,minRows:k,maxRows:k,description:f,inputMode:c,autoFocus:V,readOnly:i,autoComplete:L,style:{opacity:o?.5:void 0},value:H?oe:String(r||""),placeholder:P},le(G,Y,g,v,y,b,x,$,H,o,!!i,(r||"").toString(),W,K,C,S),{onChange:function(e){var t=e.target;return W(t.value)},disabled:o})):reactExports.createElement(TextInput,Z$1({},re,{variant:j?"default":"filled",ref:function(e){X.current=e,U&&U(e)},style:{opacity:o?.5:void 0},label:m,error:B&&(t||n),description:f,pattern:d,type:s,inputMode:c,autoFocus:V,autoComplete:L,readOnly:i,value:H?oe:String(r||""),placeholder:P},le(G,Y,g,v,y,b,x,$,H,o,!!i,(r||"").toString(),W,K,C,S),{onChange:function(e){var t=e.target,n=t.value;if(N||A||O){n="";for(var r=0;r<t.value.length;r++)n+=t.value[r],n=z(n);Z.pos()}W(n)},disabled:o}))},Time:function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.description,s=void 0===a?"":a,l=e.title,c=void 0===l?"Text":l,u=e.placeholder,d=void 0===u?tM.TIME_PLACEHOLDER:u,p=e.dirty,f=e.outlined,h=e.inputRef,m=e.onChange,g=e.withContextMenu,v=uo().requestSubject,y=reactExports.useRef(),b=reactExports.useRef(!1),x=reactExports.useRef(!1),$=te(reactExports.useState(null),2),_=$[0],C=$[1],w=function(){C(null)},S=te(reactExports.useState(tM.parseTime(r||"")?r:""),2),E=S[0],k=S[1],T=zr(E);reactExports.useEffect(function(){x.current?x.current=!1:tM.parseTime(r||"")?(b.current=!0,k(r)):T.current&&(b.current=!0,k(""))},[r]);var P=zr(r);reactExports.useEffect(function(){if(b.current)b.current=!1;else{var e=tM.parseTime(E||"");e?(x.current=!0,m(tM.serializeTime(e))):P.current&&(x.current=!0,m(""))}},[E]);var M=reactExports.useMemo(function(){if(E){var e=tM.parseTime(E);if(!e)return;var t=J$1();return(t=t.set("hour",e.hour)).set("minute",e.minute)}},[E]),L=reactExports.useMemo(function(){var e=ve;return{render:function(){var t=y.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=ve)},pos:function(){var t,n=y.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<5&&"#"!==fe[n];n++)t+=1;return t}(e)),e}}},[]);return reactExports.useLayoutEffect(function(){var e=y.current,t=function(){return L.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}},[y.current]),reactExports.useLayoutEffect(function(){L.render()},[E]),reactExports.useEffect(function(){return g&&v.subscribe(w)},[]),reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(TextInput,Z$1({},re,{variant:f?"default":"filled",ref:function(e){y.current=e,h&&h(e)},type:"text",readOnly:i,rightSection:reactExports.createElement(IconButton,{onClick:function(e){var t=e.clientX,n=e.clientY,r=e.target,o=document.elementFromPoint(t,n);C(o||r)},disabled:o},reactExports.createElement(default_1$j,null)),rightSectionProps:{style:{width:"auto"}},style:{opacity:o?.5:void 0},disabled:o,placeholder:d,value:E,label:c,error:p&&(t||n),description:s,onChange:function(e){return function(e){for(var t="",n=0;n<e.length;n++)t+=e[n],t=yl(t,fe,{allowed:/\d/,symbol:"#"});L.pos(),k(t)}(e.target.value)}})),reactExports.createElement(Popover$1,{open:!!_,anchorEl:_,onClose:w,anchorOrigin:{vertical:"bottom",horizontal:"right"}},reactExports.createElement(yc,{date:M,onChange:function(e){if(e){var t=e.get("hour"),n=e.get("minute");k(new tM.Time(t,n).toString())}else k(null)}})))},Tree:function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.description,s=void 0===a?"":a,l=e.outlined,c=void 0!==l&&l,u=e.title,d=void 0===u?"":u,p=e.placeholder,f=void 0===p?"":p,h=e.dirty,m=e.loading,g=e.onChange,v=e.itemTree,y=void 0===v?se:v,b=e.watchItemTree,x=Ur().object,$=Ir(),_=te(reactExports.useState(function(){return{options:[],labels:{}}}),2),C=_[0],w=_[1],S=reactExports.useRef(!1),E=il([C],10),k=reactExports.useMemo(function(){if("string"==typeof r)return[r];if(r){var e=Object.values(r);return _n$1(e)?[]:e}return[]},[r]),T=reactExports.useRef(k),P=reactExports.useMemo(function(){return sl(T.current,k)?T.current:(T.current=k,k)},[k]),M=ol().fallback,L=Ai$1(function(e){return $$1(void 0,void 0,void 0,function(){var t,n,r;return ee(this,function(o){switch(o.label){case 0:return t={},n=[],"function"!=typeof y?[3,2]:[4,y(e,$)];case 1:return r=o.sent(),[3,3];case 2:r=y,o.label=3;case 3:return function(e){void 0===e&&(e=[]);var t=[],n=function(e){return void 0===e&&(e=[]),e.forEach(function(e){var r=e.child||[];n(ne([],te(r),!1)),t.push(e)})};return n(e),t}(r).forEach(function(e){var r=e.label,o=e.value;e.child||(n.push(o),t[o]=r)}),w({options:n,labels:t}),S.current=!0,[4,E()];case 4:return o.sent(),[2]}})})},{fallback:M}),I=L.loading,R=L.execute,O=function(e){return Object.values(e||{}).sort(function(e,t){return t.localeCompare(e)}).join("-")}(P),A=reactExports.useRef(null),D=reactExports.useRef(!0);reactExports.useEffect(function(){if(!D.current){if(A.current===x)return;if(!b)return}A.current=x,D.current=!1,R(x)},[O,o,h,t,n,x,i]);var N=reactExports.useMemo(function(){return C.options.map(function(e){return{value:e,label:C.labels[e]||e}})},[C]);return I||m||!S.current?reactExports.createElement(MultiSelect,Z$1({},re,{searchable:!0,variant:c?"default":"filled",disabled:!0,label:d,error:h&&(t||n),description:s,placeholder:"Loading",comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}})):reactExports.createElement(MultiSelect,Z$1({},re,{searchable:!0,value:P,variant:c?"default":"filled",onChange:function(e){g((null==e?void 0:e.length)?e:null)},label:d,disabled:o,readOnly:i,error:h&&(t||n),description:s,placeholder:f,data:N,style:{opacity:o?.5:void 0},comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}}))},YesNo:function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=void 0===o?"":o,a=e.placeholder,s=void 0===a?"":a,l=e.noDeselect,c=e.title,u=void 0===c?"":c,d=e.tr,p=void 0===d?function(e){return e}:d,f=e.outlined,h=e.dirty,m=e.invalid,g=e.incorrect,v=e.onChange,y=te(reactExports.useState({}),2),b=y[0],x=y[1],$=reactExports.useRef(!1),_=Ir(),C=Ur().object,w=reactExports.useMemo(function(){return!0===t?"Yes":!1===t?"No":null},[t]),S=ol().fallback,E=Ai$1(function(){return $$1(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return e={},[4,Promise.all(ue.map(function(t){return $$1(void 0,void 0,void 0,function(){var n,r;return ee(this,function(o){switch(o.label){case 0:return n=e,r=t,[4,Promise.resolve(p(t,C,_))];case 1:return[2,n[r]=o.sent()]}})})}))];case 1:return t.sent(),x(e),$.current=!0,[2]}})})},{fallback:S}),k=E.loading,T=E.execute;reactExports.useEffect(function(){T()},[]);var P=reactExports.useMemo(function(){return ue.map(function(e){return{value:e,label:b[e]}})},[b]);return k||!$.current?reactExports.createElement(Select,Z$1({},re,{variant:f?"default":"filled",disabled:!0,label:u,error:h&&(m||g),description:i,placeholder:"Loading",comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}})):reactExports.createElement(Select,Z$1({},re,{value:w,allowDeselect:!l,variant:f?"default":"filled",onChange:function(e){v("Yes"===e||"No"!==e&&null)},label:u,disabled:n,readOnly:r,error:h&&(m||g),description:i,placeholder:s,data:P,style:{opacity:n?.5:void 0},comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}}))},Switch:function(e){var t=e.disabled,n=e.value,r=e.onChange,o=e.title,i=e.switchActiveLabel;return reactExports.createElement(Switch,{size:"md",mt:"xs",mb:"xs",style:{opacity:t?.5:void 0},checked:Boolean(n),disabled:t,onChange:function(){return r(!n)},label:i||o})},Radio:function(e){var t=e.disabled,n=e.onChange,r=e.title,o=e.radioValue,i=e.readonly,a=e.value,s=e.name,l=void 0===s?"":s,c=te(gl(),2),u=c[0],d=c[1],p=zr(u),f=reactExports.useMemo(function(){return u[l]===o},[u]),h=reactExports.useCallback(function(e){return d(function(t){var n;return Z$1(Z$1({},t),((n={})[l]=e,n))})},[]),m=reactExports.useCallback(function(e){h(e),n(e)},[]);return reactExports.useEffect(function(){var e=p.current;a!==e[l]&&h(a)},[a]),reactExports.createElement(Radio,{size:"md",mt:"xs",mb:"xs",checked:f,readOnly:i,style:{opacity:t?.5:void 0},disabled:t,onChange:function(){i||m(o||null)},label:r})},Slider:function(e){var t=e.disabled,n=e.value,r=e.onChange,o=e.minSlider,i=e.maxSlider,a=e.sliderSteps,s=e.stepSlider,l=e.labelFormatSlider;return reactExports.createElement(Slider,{size:"xl",mt:"xs",mb:"xs",style:{opacity:t?.5:void 0},step:s,label:l,value:n,min:o,max:i,disabled:t,marks:a,onChange:function(e){return r(e)}})},CheckBox:function(e){var t=e.disabled,n=e.onChange,r=e.title,o=e.value;return reactExports.createElement(Checkbox,{size:"md",mt:"xs",mb:"xs",disabled:t,style:{opacity:t?.5:void 0},checked:Boolean(o),onChange:function(){return n(!o)},label:r})}};const defaultSlots={Choose:pe.Choose,Combo:pe.Combo,ComboArray:pe.ComboArray,Complete:pe.Complete,Date:pe.Date,Items:pe.Items,Text:pe.Text,Time:pe.Time,Tree:pe.Tree,YesNo:pe.YesNo,Switch:pe.Switch,Radio:pe.Radio,Slider:pe.Slider,CheckBox:pe.CheckBox},OneSlotFactory=({children:e})=>factory$1(ru$1,{...defaultSlots,children:e}),ErrorProvider=({children:e})=>{const[t,n]=reactExports.useState(!1);return reactExports.useEffect(()=>ioc.errorService.errorSubject.subscribe(()=>{n(!0)}),[]),factory$1(Fragment,{children:[e,!!t&&factory$1(ErrorView,{})]})},Object$=Object,Map$=Map,Set$=Set,SetHas$=Set$.prototype.has,SetAdd$=Set$.prototype.add,MapHas$=Map$.prototype.has,MapGet$=Map$.prototype.get,MapSet$=Map$.prototype.set,ChildFlag=1,AttributeFlag=2,EventFlag=4,StyleAttributeFlag=8,SvgAttributeFlag=16,BlockFlag=32,TEXT_NODE_CACHE="__t",EVENT_PATCH="__p",EVENTS_REGISTRY="__e",IS_NON_DIMENSIONAL=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,XLINK_NS="http://www.w3.org/1999/xlink",XML_NS="http://www.w3.org/2000/xmlns/",X_CHAR=120,NON_PROPS=new Set$(["href","list","form","tabIndex","download"]),VOID_ELEMENTS=new Set$(["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","isindex","keygen","link","menuitem","meta","nextid","param","source","track","wbr"]);if("undefined"==typeof window)throw new Error("See http://million.dev/docs/install to install the compiler.");const document$=document;document$.createElement("template");const HTM_TEMPLATE=document$.createElement("template"),HTM_TEMPLATE_CONTENT=HTM_TEMPLATE.content,SVG_TEMPLATE=document$.createElementNS("http://www.w3.org/2000/svg","svg"),node$=Node.prototype,element$=Element.prototype,characterData$=CharacterData.prototype,getOwnPropertyDescriptor$=Object$.getOwnPropertyDescriptor,insertBefore$=node$.insertBefore,cloneNode$=node$.cloneNode,replaceChild$=node$.replaceChild,remove$$1=element$.remove,addEventListener$=node$.addEventListener,removeAttribute$=element$.removeAttribute,setAttribute$=element$.setAttribute,setAttributeNS$=element$.setAttributeNS,setTextContent$=getOwnPropertyDescriptor$(node$,"textContent").set,firstChild$=getOwnPropertyDescriptor$(node$,"firstChild").get,nextSibling$=getOwnPropertyDescriptor$(node$,"nextSibling").get,characterDataSet$=getOwnPropertyDescriptor$(characterData$,"data").set,stringToDOM=(e,t)=>{(t?SVG_TEMPLATE:HTM_TEMPLATE).innerHTML=e;return(t?SVG_TEMPLATE:HTM_TEMPLATE_CONTENT).firstChild};document$[EVENTS_REGISTRY]=new Set$;const createEventListener=(e,t,n)=>{let r=t.toLowerCase(),o=!1;r.endsWith("capture")&&(r=r.slice(0,-7),o=!0);const i=`$$${r}`;SetHas$.call(document$[EVENTS_REGISTRY],r)||(addEventListener$.call(document$,r,e=>{let t=e.target;for(;t;){const n=t[i];n&&(Object$.defineProperty(e,"currentTarget",{configurable:!0,get:()=>t}),n(e)),t=t.parentNode}},{capture:o}),SetAdd$.call(document$[EVENTS_REGISTRY],r));const a=t=>{var n;t?"key"in t&&t.key===(null==(n=e[i])?void 0:n.key)||(e[i]=t):e[i]=null};return a(n),a},childAt=(e,t)=>{let n=firstChild$.call(e);if(t)for(let r=0;r<t&&n;++r)n=nextSibling$.call(n);return n},visitedNodes=new WeakSet,removeComments=e=>{var t;if(visitedNodes.has(e))return;8===e.nodeType&&(null==(t=e.parentNode)||t.removeChild(e));let n=firstChild$.call(e);for(;n;)removeComments(n),n=n.nextSibling;visitedNodes.add(e)},insertText=(e,t,n)=>{const r=document$.createTextNode(t),o=childAt(e,n);return insertBefore$.call(e,r,o),r},setText=(e,t)=>{characterDataSet$.call(e,t)},setStyleAttribute=(e,t,n)=>{"number"!=typeof n||IS_NON_DIMENSIONAL.test(t)?e.style[t]=n:"string"==typeof n?e.style.cssText=n:t.startsWith("-")?e.style.setProperty(t,String(n)):e.style[t]=null==n?"":`${String(n)}px`},setSvgAttribute=(e,t,n)=>{(t=t.replace(/xlink(?:H|:h)/,"h").replace(/sName$/,"s")).startsWith("xmlns")?setAttributeNS$.call(e,XML_NS,t,String(n)):t.startsWith("xlink")&&setAttributeNS$.call(e,XLINK_NS,"href",String(n))},setAttribute=(e,t,n)=>{const r=null==n;if(n=r?"":n,!(t in e)||void 0===e[t]||null===e[t]||e instanceof SVGElement||!SetHas$.call(NON_PROPS,t))r||""===n||!1===n&&!t.includes("-")?removeAttribute$.call(e,t):setAttribute$.call(e,t,String(n));else try{e[t]=n}catch(s){}const o=e instanceof HTMLInputElement,i=e instanceof HTMLSelectElement,a=e instanceof HTMLTextAreaElement;"value"===t&&(o||i||a)&&(setAttribute$.call(e,t,String(n)),e.value=n)},aliases=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]);function getAttributeAlias(e){return aliases.get(e)||e}var __defProp$1=Object.defineProperty,__defNormalProp$1=(e,t,n)=>t in e?__defProp$1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__publicField$1=(e,t,n)=>(__defNormalProp$1(e,"symbol"!=typeof t?t+"":t,n),n);class AbstractBlock{constructor(){__publicField$1(this,"r"),__publicField$1(this,"e"),__publicField$1(this,"l"),__publicField$1(this,"g"),__publicField$1(this,"_u"),__publicField$1(this,"_t"),__publicField$1(this,"d"),__publicField$1(this,"k"),__publicField$1(this,"c")}}const renderToTemplate=(e,t=[],n=[])=>{var r,o;if("string"==typeof e)return e;if("number"==typeof e||"bigint"==typeof e||!0===e)return String(e);if(null==e||!1===e)return"";if("object"==typeof e&&"$"in e)return t.push({p:n,e:[{t:ChildFlag,n:null,v:null,h:e.$,i:0,l:null,p:null,b:null}],i:[]}),"<slot/>";let i="",a="";const s={p:n,e:[],i:[]};for(let c in e.props){const t=e.props[c];if("key"===c||"ref"===c||"children"===c)continue;const n=getAttributeAlias(c);if(n&&(c=n),"className"===c&&(c="class"),c.startsWith("on")){"$"in t?s.e.push({t:EventFlag,n:c.slice(2),v:null,h:t.$,i:null,l:null,p:null,b:null}):s.i.push({t:EventFlag,n:c.slice(2),v:null,h:null,i:null,l:t,p:null,b:null});continue}if(t){if("object"==typeof t&&"$"in t){"style"===c?s.e.push({t:StyleAttributeFlag,n:c,v:null,h:t.$,i:null,l:null,p:null,b:null}):c.charCodeAt(0)===X_CHAR?s.e.push({t:SvgAttributeFlag,n:c,v:null,h:t.$,i:null,l:null,p:null,b:null}):s.e.push({t:AttributeFlag,n:c,v:null,h:t.$,i:null,l:null,p:null,b:null});continue}if("style"===c&&"object"==typeof t){let e="";for(const n in t){if("object"==typeof t[n]){s.e.push({t:StyleAttributeFlag,n:n,v:null,h:t[n].$,i:null,l:null,p:null,b:null});continue}let r="";for(let e=0,t=n.length;e<t;++e){const t=n.charCodeAt(e);r+=t<97?`-${String.fromCharCode(t+32)}`:n[e]}e+=`${r}:${String(t[n])};`}i+=` style="${e}"`;continue}i+=` ${c}="${String(t)}"`}}if(SetHas$.call(VOID_ELEMENTS,e.type))return s.e.length&&t.push(s),`<${e.type}${i} />`;let l=!1;for(let c=0,u=(null==(r=e.props.children)?void 0:r.length)||0,d=0;c<u;++c){const r=null==(o=e.props.children)?void 0:o[c];if(null==r||!1===r)continue;if("object"==typeof r&&"$"in r){s.e.push({t:ChildFlag,n:null,v:null,h:r.$,i:c,l:null,p:null,b:null});continue}if(r instanceof AbstractBlock){s.i.push({t:BlockFlag,n:null,v:null,h:null,i:c,l:null,p:null,b:r});continue}if("string"==typeof r||"number"==typeof r||"bigint"==typeof r){const e="number"==typeof r||"bigint"==typeof r?String(r):r;if(l){s.i.push({t:ChildFlag,n:null,v:e,h:null,i:c,l:null,p:null,b:null});continue}l=!0,a+=e,d++;continue}l=!1;const i=n.slice();i.push(d++),a+=renderToTemplate(r,t,i)}return(s.i.length||s.e.length)&&t.push(s),`<${e.type}${i}>${a}</${e.type}>`};var __defProp=Object.defineProperty,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__publicField=(e,t,n)=>(__defNormalProp(e,t+"",n),n);const mapArray=e=>new ArrayBlock(e);class ArrayBlock extends AbstractBlock{constructor(e){super(),__publicField(this,"b"),this.b=e}v(){}p(e){const t=this.b,n=e.b,r=t.length,o=n.length,i=this.t();if(this===e)return i;if(0===o&&0===r)return i;if(this.b=n,0===o)return arrayRemove$.call(this),i;if(0===r)return arrayMount$.call(e,i),i;let a,s=0,l=0,c=r-1,u=o-1,d=t[0],p=n[0],f=t[c],h=n[u];for(;s<=c&&l<=u;){if(!d){d=t[++s];continue}if(!f){f=t[--c];continue}const e=d.k,r=p.k;if(e===r){patch$.call(d,p),n[l]=d,d=t[++s],p=n[++l];continue}const o=f.k,m=h.k;if(o===m){patch$.call(f,h),n[u]=f,f=t[--c],h=n[--u];continue}if(e===m){patch$.call(d,h),n[u]=d;const e=n[u+1];move$.call(d,e,(null==e?void 0:e.l)||null),d=t[++s],h=n[--u];continue}if(o===r){patch$.call(f,p),n[l]=f;const e=t[s];move$.call(f,e,(null==e?void 0:e.l)||null),f=t[--c],p=n[++l];continue}if(!a){a=new Map$;for(let e=s;e<=c;e++)MapSet$.call(a,t[e].k,e)}const g=a.get(r);if(void 0===g)mount$.call(p,i,d.l||null);else{const e=t[g];move$.call(e,d,null),patch$.call(e,p),n[l]=e,t[g]=null}p=n[++l]}if(s<=c||l<=u)if(s>c){const e=n[u+1];for(let t=l;t<=u;++t)mount$.call(n[t],i,e?e.l:null)}else for(let m=s;m<=c;++m)remove$.call(t[m]);return i}m(e,t=null){if(this._t)return this._t;for(let n=0,r=this.b.length;n<r;++n){const r=this.b[n];mount$.call(r,e,t)}return this._t=e,e}x(){const e=this.t();if(e)setTextContent$.call(e,"");else for(let t=0,n=this.b.length;t<n;++t)remove$.call(this.b[t]);this.b=[]}u(){return!0}s(){return this.b.map(e=>e.s()).join("")}t(){return this._t||(this._t=this.b[0].t()),this._t}}const array$=ArrayBlock.prototype,arrayMount$=array$.m,arrayPatch$=array$.p,arrayRemove$=array$.x,HOLE_PROXY=new Proxy({},{get:(e,t)=>({$:t})}),block$1=(e,t,n,r)=>{const o=e(HOLE_PROXY),i=[],a=stringToDOM(renderToTemplate(t?t(o):o,i),r);return removeComments(a),(e,t,r)=>new Block(a,i,e,t??(null==e?void 0:e.key)??null,r??n??null,null)},patch=(e,t)=>{if(("b"in e||"b"in t)&&arrayPatch$.call(e,t),e.l||mount$.call(e,void 0,null,null),e.k&&e.k===t.k||e.r===t.r)return patch$.call(e,t);const n=mount$.call(t,e.t(),e.l,null);return remove$.call(e),e.k=t.k,n};class Block extends AbstractBlock{constructor(e,t,n,r,o,i){super(),this.r=e,this.d=n,this.e=t,this.k=r,this.c=Array(t.length),this._u=o||null,this.g=i||null}m(e,t=null,n){var r,o;if(this.l)return this.l;const i=n??cloneNode$.call(this.r,!0),a=null==(r=this.g)?void 0:r.call(this,i);a&&(this.c=a);for(let s=0,l=this.e.length;s<l;++s){const e=this.e[s],t=(null==a?void 0:a[s])??getCurrentElement(e.p,i,this.c,s);for(let o=0,i=e.e.length;o<i;++o){const r=e.e[o],a=this.d[r.h];if(r.t&ChildFlag){if(a instanceof AbstractBlock){const e=childAt(t,r.i);n?a.m(t,e,e):a.m(t,e);continue}if(t[TEXT_NODE_CACHE]||(t[TEXT_NODE_CACHE]=new Array(i)),a&&"object"==typeof a&&"foreign"in a){if(n){const e=childAt(t,r.i);a.reset(e)}const e=a.current;t[TEXT_NODE_CACHE][o]=e,n||insertBefore$.call(t,e,childAt(t,r.i));continue}if(n){t[TEXT_NODE_CACHE][o]=childAt(t,r.i);continue}t[TEXT_NODE_CACHE][o]=insertText(t,null==a||!1===a?"":String(a),r.i)}else if(r.t&EventFlag){const e=createEventListener(t,r.n,a);t[EVENT_PATCH+r.n]=e}else if(r.t&AttributeFlag)setAttribute(t,r.n,a);else if(r.t&StyleAttributeFlag)if("string"==typeof a||"number"==typeof a)setStyleAttribute(t,r.n,a);else for(const e in a)setStyleAttribute(t,e,a[e]);else setSvgAttribute(t,r.n,a)}const r=null==(o=e.i)?void 0:o.length;if(r)for(let o=0;o<r;++o){const r=e.i[o];if(r.t&ChildFlag)r.v&&!n&&insertText(t,r.v,r.i);else if(r.t&EventFlag)createEventListener(t,r.n,r.l);else{const e=childAt(t,r.i);n?r.b.m(t,e,e):r.b.m(t,e)}}}return e&&!n&&insertBefore$.call(e,i,t),this.l=i,i}p(e){var t,n;const r=this.l;if(!e.d)return r;const o=this.d;if(!shouldUpdate$.call(this,o,e.d))return r;this.d=e.d;for(let i=0,a=this.e.length;i<a;++i){const a=this.e[i],s=this.c[i]??getCurrentElement(a.p,r,this.c,i);for(let r=0,l=a.e.length;r<l;++r){const l=a.e[r],c=o[l.h],u=e.d[l.h];if(u!==c)if(l.t&EventFlag)s[EVENT_PATCH+l.n](u);else if(l.t&ChildFlag){if(c instanceof AbstractBlock){const o=null==(n=null==(t=e.e)?void 0:t[i])?void 0:n.e[r],a=e.d[o.h];c.p(a);continue}if(u&&"object"==typeof u&&"foreign"in u){const e=s[TEXT_NODE_CACHE][r];if(u.unstable&&c!==u){const t=u.current;s[TEXT_NODE_CACHE][r]=t,replaceChild$.call(s,t,e)}else u.current=e;continue}setText(s[TEXT_NODE_CACHE][r],null==u||!1===u?"":String(u))}else if(l.t&AttributeFlag)setAttribute(s,l.n,u);else if(l.t&StyleAttributeFlag)if("string"==typeof u||"number"==typeof u)setStyleAttribute(s,l.n,u);else for(const e in u)u[e]!==c[e]&&setStyleAttribute(s,e,u[e]);else setSvgAttribute(s,l.n,u)}}return r}v(e=null,t=null){insertBefore$.call(this.t(),this.l,e?e.l:t)}x(){remove$$1.call(this.l),this.l=null}u(e,t){return!this._u||this._u(e,t)}s(){var e;return String(null==(e=this.l)?void 0:e.outerHTML)}t(){var e;return this._t||(this._t=null==(e=this.l)?void 0:e.parentElement),this._t}}const getCurrentElement=(e,t,n,r)=>{const o=e.length;if(!o)return t;const i=n&&void 0!==r;if(i&&n[r])return n[r];for(let a=0;a<o;++a){const n=e[a];t=childAt(t,n)}return i&&(n[r]=t),t},block$=Block.prototype,mount$=block$.m,patch$=block$.p,move$=block$.v,remove$=block$.x,shouldUpdate$=block$.u,experimental_options={noSlot:!1},RENDER_SCOPE="slot",SVG_RENDER_SCOPE="g",Effect=({effect:e,deps:t})=>(reactExports.useEffect(e,t||[]),null),REGISTRY=new Map,scopedContext=reactExports.createContext(!1),processProps=(e,t,n)=>{const r={ref:t};let o=0;for(const i in e){const t=e[i];reactExports.isValidElement(t)||Array.isArray(t)&&t.length&&reactExports.isValidElement(t[0])?r[i]=renderReactScope(t,!1,n,o++):r[i]=e[i]}return r},wrap=(e,t)=>reactExports.createElement(RENDER_SCOPE,{suppressHydrationWarning:!0,id:t},e),renderReactScope=(e,t,n,r,o)=>{var i;const a=null==(i=null==n?void 0:n[r])?void 0:i.current,s=reactExports.isValidElement(e)&&"function"==typeof e.type&&"_c"in e.type,l=s&&e.type._c;if("undefined"==typeof window)return s?l?e:wrap(wrap(e),o):wrap(e,o);if(l){const t=e.type(e.props);if(REGISTRY.has(t.type)){const e=REGISTRY.get(t.type);if("function"==typeof e)return e(t.props)}}const c=a??null??document.createElement(RENDER_SCOPE),u={foreign:!0,current:c,portal:reactDomExports.createPortal(reactExports.createElement(reactExports.Fragment,{children:e}),c,o),reset:e=>{e.childNodes.forEach(t=>e.removeChild(t))},unstable:t};return n&&(n[r]=u),u},unwrap=e=>{var t;if("object"!=typeof e||null===e||!("type"in e))return"number"==typeof e?String(e):e;let n=e.type;if("function"==typeof n)return unwrap(n(e.props??{}));if("object"==typeof n&&"$"in n)return n;const r={...e.props};"css"in r&&"__EMOTION_TYPE_PLEASE_DO_NOT_USE__"in r&&(r.style=r.css.styles,n=r.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,delete r.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,delete r.css);const o=null==(t=e.props)?void 0:t.children;return null!=o&&(r.children=flatten(e.props.children).map(e=>unwrap(e))),{type:n,props:r}},flatten=e=>{if(null==e)return[];if("object"==typeof e&&"type"in e&&e.type===reactExports.Fragment)return flatten(e.props.children);if(!Array.isArray(e)||"object"==typeof e&&"$"in e)return[e];const t=e.flat(1/0),n=[];for(let r=0,o=t.length;r<o;++r)n.push(...flatten(t[r]));return n},useLayoutEffect="undefined"==typeof window?reactExports.useEffect:reactExports.useLayoutEffect;function traverse(e,t,n){if(!e||t(e))return e;let r=e.return;for(;r;){const e=traverse(r,t);if(e)return e;r=null}}function useFiber(){const e=reactExports.useRef();return reactExports.useState(()=>{const t=Function.prototype.bind;Function.prototype.bind=function(n,r){return null===n&&"function"==typeof(null==r?void 0:r.type)&&(e.current=r,Function.prototype.bind=t),t.apply(this,arguments)}}),e.current}function useNearestParent(e){const t=useFiber(),n=reactExports.useRef({el:null,depth:0});return useLayoutEffect(()=>{var r;n.current.el=null==(r=traverse(t,t=>(n.current.depth++,"string"==typeof t.type&&void 0===e)))?void 0:r.stateNode},[t]),n}function useContainer(){const e=useFiber(),t=reactExports.useRef({el:null,depth:0});return useLayoutEffect(()=>{var n;t.current.el=null==(n=traverse(e,e=>{var n;return t.current.depth++,null!=(null==(n=e.stateNode)?void 0:n.containerInfo)}))?void 0:n.stateNode.containerInfo},[e]),t}const block=(e,t={})=>{const n=(null==t?void 0:t.experimental_noSlot)??experimental_options.noSlot;let r=null==t?void 0:t.block;const o=(null==t?void 0:t.svg)?SVG_RENDER_SCOPE:RENDER_SCOPE;e&&(r=block$1(e,unwrap,null==t?void 0:t.shouldUpdate,null==t?void 0:t.svg));const i=(e,i)=>{var a,s;const l=useContainer(),c=useNearestParent(),u=e._hmr,d=reactExports.useRef(null),p=reactExports.useRef(null),f=reactExports.useRef([]);e=processProps(e,i,f.current),null==(a=p.current)||a.call(p,e);const h=reactExports.useCallback(()=>{var o,i,a;if(!d.current&&!n)return;const s=r(e,e.key);return u&&(null==(o=d.current)?void 0:o.textContent)&&(d.current.textContent=""),n&&(d.current=(null==(i=c.current)?void 0:i.el)??(null==(a=l.current)?void 0:a.el),(e.scoped||c.current&&l.current&&c.current.depth>l.current.depth)&&(d.current=l.current.el),d.current.childNodes.length&&console.error(new Error(`\`experimental_options.noSlot\` does not support having siblings at the moment.\nThe block element should be the only child of the \`${cloneNode$.call(d.current).outerHTML}\` element.\nTo avoid this error, \`experimental_options.noSlot\` should be false`))),(null===p.current||u)&&(mount$.call(s,d.current,null),p.current=e=>{patch(s,r(e,e.key,null==t?void 0:t.shouldUpdate))}),()=>{remove$.call(s)}},[]),m=reactExports.useMemo(()=>n?null:reactExports.createElement((null==t?void 0:t.as)??o,{ref:d}),[]),g=f.current.length,v=new Array(g);for(let t=0;t<g;++t)v[t]=null==(s=f.current[t])?void 0:s.portal;return reactExports.createElement(reactExports.Fragment,{},m,reactExports.createElement(Effect,{effect:h,deps:u?[u]:[]}),v)};return MapHas$.call(REGISTRY,i)||MapSet$.call(REGISTRY,i,block),(null==t?void 0:t.name)&&(e&&(e.displayName=`Million(Render(${t.name}))`),i.displayName=`Million(Block(${t.name}))`),i},MillionArray=({each:e,children:t,memo:n,svg:r,as:o,...i})=>{const a=reactExports.useRef(null),[s]=reactExports.useState(()=>({current:Array(e.length)})),l=reactExports.useRef(null),c=reactExports.useRef({each:null,children:null,mounted:!1}),[,u]=reactExports.useState(!1);if(l.current&&(e!==c.current.each||!n)){const r=createChildren(e,t,c,s,n);arrayPatch$.call(l.current,mapArray(r))}const d=r?SVG_RENDER_SCOPE:RENDER_SCOPE,p=reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(o??d,{...i,ref:a}),...s.current.map(e=>e.portal));return reactExports.useEffect(()=>{if(!a.current||l.current)return;if(c.current.mounted)return;const r=createChildren(e,t,c,s,n);l.current=mapArray(r),MapHas$.call(REGISTRY,p)||MapSet$.call(REGISTRY,p,l.current),arrayMount$.call(l.current,a.current),c.current.mounted=!0,u(!0)},[a.current]),p},typedMemo=reactExports.memo;typedMemo(MillionArray);const createChildren=(e,t,n,r,o)=>{var i;const a=Array(e.length),s=n.current;for(let l=0,c=e.length;l<c;++l){if(o&&s.each&&s.each[l]===e[l]){a[l]=null==(i=s.children)?void 0:i[l];continue}const n=t(e[l],l);if(MapHas$.call(REGISTRY,n.type)){s.block||(s.block=MapGet$.call(REGISTRY,n.type)),a[l]=s.block(n.props,r,l);continue}if("function"==typeof n.type&&"_c"in n.type){const e=n.type(n.props);if(MapHas$.call(REGISTRY,e.type)){const t=MapGet$.call(REGISTRY,e.type);if("function"==typeof t){a[l]=t(e.props);continue}}}const c=block$1(e=>null==e?void 0:e.scope),u=(e,t,r)=>c({scope:renderReactScope(reactExports.createElement(n.type,e),!1,t.current,r)},n.key?String(n.key):void 0);MapSet$.call(REGISTRY,n.type,u),s.block=u,a[l]=u(n.props,r,l)}return s.each=e,s.children=a,a};function isEqual(e,t){return e===t||e!=e&&t!=t}function shouldCompiledBlockUpdate(e,t){for(const n in e)if(!isEqual(e[n],t[n]))return!0;return!1}function compiledBlock(e,{portals:t,...n}){const r=`CompiledBlock(Inner(${n.name}))`,o=block(t=>e(t),{...n,name:r,shouldUpdate:shouldCompiledBlockUpdate}),i=(null==t?void 0:t.length)||0,a=t&&i>0?e=>{const n=reactExports.useContext(scopedContext),[r]=reactExports.useState(()=>[]),a={...e,scoped:n};for(let o=0;o<i;o++){const e=t[o],n=renderReactScope(a[e],!1,r,o);a[e]=n}const s=[];for(let t=0,o=r.length;t<o;t++)s[t]=r[t].portal;return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(o,a),s)}:e=>reactExports.createElement(o,e);return n.name&&(a.displayName=`Million(CompiledBlock(Outer(${n.name})))`),a}var j$1;function B$1(e){if(!j$1){if(!(typeof document<"u"))return;j$1=document.createElement("textarea")}var t="&"+e+";";j$1.innerHTML=t;var n=j$1.value;return n!==t?n:void 0}"undefined"!=typeof window&&(window.__MILLION_DATA__={version:"3.1.11"});var C$3={},Z6=Object.defineProperty,G6=(e,t)=>{for(var n in t)Z6(e,n,{get:t[n],enumerable:!0,configurable:!0,set:e=>t[n]=()=>e})},C$2=32,l$1=9,V0=13,d$1=10,t0=96,e1=126,g1=91,D9=94,C1=62,T9=35,D1=45,d1=61,k1=92,S9=42,$9=95,j9=60,E9=64,H9=93,F9=33,x9=38,P9=58,i1=102,c1=104,x1=119,r9=116,B$=112,zZ=115,_Z=160,qZ=12,I9=46,Z9=47,DZ=43,jZ=124,HZ=123,FZ=40,OZ=41,N$=120,y$=88,G9=48,Y9=57,m1=65,h1=90,a1=97,r1=122,K1=128,WZ=32,Y6={blockQuote:0,breakLine:1,breakThematic:2,codeBlock:3,codeInline:4,footnote:5,footnoteReference:6,frontmatter:7,gfmTask:8,heading:9,htmlBlock:10,htmlComment:11,htmlSelfClosing:12,image:13,link:14,orderedList:15,paragraph:16,ref:17,refCollection:18,table:19,text:20,textFormatted:21,unorderedList:22},O$1=Y6,P$={};function L$(e){if(!c$1(e,"---"))return null;let t=3;for(;t<e.length&&(" "===e[t]||"\t"===e[t]);)t++;if(t<e.length&&"\r"===e[t]&&t++,t>=e.length||"\n"!==e[t])return null;t++;let n=!1;for(;t<e.length;){let r=t;for(;t<e.length&&"\n"!==e[t]&&"\r"!==e[t];)t++;if(t>=e.length)break;let o=t;if("\r"===e[t]&&t++,t<e.length&&"\n"===e[t]&&t++,c$1(e,"---",r))return{endPos:t,hasValidYaml:n};let i=e.indexOf(":",r);-1!==i&&i<o&&(n=!0)}return null}G6(P$,{startsWith:()=>c$1,slugify:()=>J1,skipWhitespace:()=>g0,shouldFilterTag:()=>$$,sanitizer:()=>s1,parseFrontmatterBounds:()=>L$,normalizeInput:()=>p1,normalizeCRLF:()=>j6,isVoidElement:()=>K9,isUnicodeWhitespace:()=>V9,isUnicodePunctuation:()=>t9,isAlnumCode:()=>o9,isASCIIWhitespace:()=>g9,isASCIIPunctuation:()=>_6,inlineCharTypeTable:()=>f9,includes:()=>V6,htmlAttrsToJSXProps:()=>s9,hasKeys:()=>e9,getTag:()=>H6,getOverrideProps:()=>F6,get:()=>x$,findLineEnd:()=>I$1,extractPlainText:()=>wZ,endsWith:()=>n9,decodeEntityReferences:()=>M9,charClassTable:()=>W9,applyTagFilterToText:()=>Z$,VOID_ELEMENTS:()=>R$,SHOULD_RENDER_AS_BLOCK_R:()=>T$,SANITIZE_R:()=>O9,NAMED_CODES_TO_UNICODE:()=>K6,HTML_TO_JSX_MAP:()=>AZ,HTML_CHAR_CODE_R:()=>vZ,ATTRIBUTES_TO_SANITIZE:()=>S$});var K6=C$3,vZ=/&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi,AZ={class:"className",for:"htmlFor",allowfullscreen:"allowFullScreen",allowtransparency:"allowTransparency",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",classid:"classId",colspan:"colSpan",contenteditable:"contentEditable",contextmenu:"contextMenu",crossorigin:"crossOrigin",enctype:"encType",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",inputmode:"inputMode",keyparams:"keyParams",keytype:"keyType",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",novalidate:"noValidate",radiogroup:"radioGroup",readonly:"readOnly",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",usemap:"useMap"};function s9(e){var t={};for(var n in e){var r=n.toLowerCase();t[AZ[r]||n]=e[n]}return t}var T$=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/;function M9(e){return-1===e.indexOf("&")?e:e.replace(vZ,(e,t)=>{var n=B$1(t);if(n)return n;if("#"===t[0]){var r="x"===t[1]||"X"===t[1]?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return 0===r||r>=55296&&r<=57343||r>1114111?"�":r<=65535?String.fromCharCode(r):String.fromCharCode(55296+(r-65536>>10),56320+(r-65536&1023))}return e})}var O9=/(javascript|vbscript|data(?!:image)):/i;function s1(e){if(O9.test(e))return null;if(-1===e.indexOf("%"))return e;try{let t=decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"");if(O9.test(t))return null}catch(t){return null}return e}var c0={},e0,x0;for(e0=[192,193,194,195,196,197,224,225,226,227,228,229,230,198],x0=0;x0<e0.length;x0++)c0[e0[x0]]="a";for(c0[231]=c0[199]="c",c0[240]=c0[208]="d",e0=[200,201,202,203,233,232,234,235],x0=0;x0<e0.length;x0++)c0[e0[x0]]="e";for(e0=[207,239,206,238,205,237,204,236],x0=0;x0<e0.length;x0++)c0[e0[x0]]="i";for(c0[209]=c0[241]="n",e0=[248,216,339,338,213,245,212,244,211,243,210,242],x0=0;x0<e0.length;x0++)c0[e0[x0]]="o";for(e0=[220,252,219,251,218,250,217,249],x0=0;x0<e0.length;x0++)c0[e0[x0]]="u";function o9(e){return e>=G9&&e<=Y9||e>=m1&&e<=h1||e>=a1&&e<=r1}function J1(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(o9(r))r>=m1&&r<=h1?t.push(String.fromCharCode(r+WZ)):t.push(e[n]);else if(r===C$2||r===D1)t.push("-");else{var o=c0[r];o&&t.push(o)}}return t.join("")}function V6(e,t){return-1!==e.indexOf(t)}function c$1(e,t,n){return e.startsWith(t,n)}function n9(e,t,n){return e.startsWith(t,(void 0===n?e.length:n)-t.length)}c0[376]=c0[255]=c0[221]=c0[253]="y";var R$=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr","circle","ellipse","line","path","polygon","polyline","rect","use","stop","animate","animateTransform","set"]);function K9(e){let t=e.toLowerCase();if(R$.has(t))return!0;let n=t.indexOf(":");return-1!==n&&(t=t.slice(n+1),R$.has(t))}var S$=["src","href","data","formAction","srcDoc","action"],E$=1,X9=2,MZ=1,U6=2,Q6=3,z6=4,W9=function(){let e,t=new Uint8Array(128);for(t[l$1]=t[d$1]=t[qZ]=t[V0]=t[C$2]=E$,e=F9;e<=Z9;e++)t[e]=X9;for(e=P9;e<=E9;e++)t[e]=X9;for(e=g1;e<=t0;e++)t[e]=X9;for(e=HZ;e<=e1;e++)t[e]=X9;return t}(),f9=function(){let e=new Uint8Array(128);return e[k1]=U6,e[g1]=z6,e[S9]=e[$9]=e[e1]=e[d1]=Q6,e[t0]=e[j9]=e[E9]=e[H9]=e[d$1]=e[C$2]=e[F9]=MZ,e[i1]=e[c1]=e[x1]=MZ,e}();function _6(e){return e<K1&&0!==(W9[e]&X9)}function g9(e){return e<K1&&0!==(W9[e]&E$)}var q6=/[\p{P}\p{S}]/u,D6=new RegExp("\\p{Zs}","u");function V9(e){if(!e)return!0;let t=e.charCodeAt(0);return t<K1?0!==(W9[t]&E$):D6.test(e)}function t9(e){if("number"==typeof e)return e<K1&&0!==(W9[e]&X9);if(!e)return!1;let t=e.charCodeAt(0);return t<K1?0!==(W9[t]&X9):q6.test(e)}function I$1(e,t){let n=e.indexOf("\n",t);return-1===n?e.length:n>0&&e.charCodeAt(n-1)===V0?n-1:n}var J9=[];function p1(e){var t=e.indexOf("\r"),n=e.indexOf("\0");if(-1===t&&-1===n)return e;var r=e.length;J9.length=0;var o=0,i=0;for(i=-1===t?n:-1===n||t<n?t:n;i<r;i++){var a=e.charCodeAt(i);a===V0?(o<i&&J9.push(e.slice(o,i)),i+1<r&&e.charCodeAt(i+1)===d$1&&i++,J9.push("\n"),o=i+1):0===a&&(o<i&&J9.push(e.slice(o,i)),J9.push("�"),o=i+1)}return o<r&&J9.push(e.slice(o)),J9.join("")}function j6(e){return p1(e)}function g0(e,t,n){let r=n??e.length;for(;t<r&&(" "===e[t]||"\t"===e[t]);)t++;return t}function e9(e){if(!e)return!1;for(var t in e)return!0;return!1}function x$(e,t,n){for(var r=e,o=t.split("."),i=0;i<o.length&&void 0!==(r=null==r?void 0:r[o[i]]);)i++;return r||n}function H6(e,t){if(!t)return e;let n=x$(t,e,void 0);return"string"==typeof n?n:"object"==typeof n&&n.component?n.component:e}function F6(e,t){if(!t)return{};let n=x$(t,e,void 0);return"object"==typeof n&&n.props?n.props:{}}function wZ(e,t){for(var n="",r=0,o=e.length;r<o;r++){var i=e[r],a=i.type;if(a===t.text||a===t.codeInline){var s=i.text;s&&(n+=s)}else a===t.textFormatted||a===t.link?i.children&&(n+=wZ(i.children,t)):a===t.image&&i.alt&&(n+=i.alt)}return n}function $$(e){var t=e.toLowerCase();return"title"===t||"textarea"===t||"style"===t||"xmp"===t||"iframe"===t||"noembed"===t||"noframes"===t||"script"===t||"plaintext"===t}function Z$(e){return e.replace(/<(\/?)(title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)(\s|>|\/)/gi,function(e,t,n,r){return"&lt;"+t+n+r})}function O6(e){console.warn(e)}function A9(e,t,n,r){for(var o=b$2(n),i=e.length,a=r??i-t,s=0;s<a&&t+s<i&&b$2(e,t+s)===o;)s++;return s}function BZ(e,t,n,r,o){if(0===o?n>=r:t<=r)return!1;let i=0===o?e[n]:e[t-1],a=0===o?t>0?e[t-1]:null:n<e.length?e[n]:null;var s=b$2(i);if(s<K1?g9(s):V9(i))return!1;var l=a?b$2(a):null,c=null===a||"\n"===a||"\r"===a||null===l||(l<K1?g9(l):V9(a));return!q$(s,i)||(!!c||!!a&&q$(b$2(a),a))}function Q$(e){for(var t="",n=0;n<e.length;)if("\\"===e[n]&&n+1<e.length){var r=e[n+1];t+=t9(b$2(r))?r:"\\"+r,n+=2}else t+=e[n++];return M9(t)}function k$2(e,t){return t>=e.length?t:e.charCodeAt(t)===V0&&t+1<e.length&&e.charCodeAt(t+1)===d$1?t+2:(e.charCodeAt(t),t+1)}function W6(e,t){if(e>=K1)return 0;var n=f9[e];return!t||1!==n||e!==i1&&e!==c1&&e!==x1?n:0}function M6(e,t,n,r,o,i){if(!n.length||n[n.length-1].type!==O$1.blockQuote)return null;let a=g0(r,0,r.length);if(a>=r.length||">"!==r[a])return null;let s=uZ(e,t,o,i);if(!s)return null;let l=n[n.length-1],c=s;return c.children&&l.children.push(...c.children),c.endPos}function z$(e,t,n,r){return{type:O$1.heading,level:e,children:t,id:r(n)}}var p$=/\\(.)/g,v6=/\s+#+\s*$/,n$=/^(?:(\d{1,9})([.)])\s+(.*)$|(\d{1,9})([.)])\s*$|([-*+])\s+(.*)$|([-*+])\s*$)/,u$=/^(\d{1,9})([.)])(\s+|$)/,l$=/^([*+\-])(\s+|$)/,H$=/^<([a-z][^ >/\n\r]*) ?([^>]*?)>/i,gZ=/^<([a-z][^ >/]*) ?(?:[^>/]+[^/]|)>/i,b$2=function(e,t=0){return e.charCodeAt(t)},_$=function(e){return o9(b$2(e))},d$=function(e){return g9(b$2(e))},j1=function(e){return" "===e||"\t"===e},C9=function(e){return" "===e||"\t"===e||"\n"===e||"\r"===e},q$=function(e,t){return t9(e<K1?e:t)},A6=function(e){var t=b$2(e);return _$(e)||t===D1||t===$9||t===P9||t===I9};function i$(e,t){var n=e.length;if(t>=n)return null;if(!U9(b$2(e[t])))return null;for(var r=t,o=t;o<n;){if(!((l=b$2(e[o]))>=a1&&l<=r1||l>=m1&&l<=h1||l>=G9&&l<=Y9||l===D1)){var i=b$2(e[o]);if(i===C$2||i===l$1||i===d$1||i===V0||i===C1||i===Z9)break;return null}o++}if(o===r)return null;for(var a=e.slice(r,o),s=0;s<a.length;s++){var l;if(!((l=b$2(a[s]))>=a1&&l<=r1||l>=m1&&l<=h1||l>=G9&&l<=Y9||l===D1))return null}return{tagName:a,tagLower:a.toLowerCase(),nextPos:o}}function n1(e,t){var n=U$(e,t);return n&&"tag"===n.kind?{tagName:n.tagName||"",tagLower:n.tagNameLower||"",attrs:n.attrs||"",endPos:n.endPos,isClosing:n.isClosing||!1,isSelfClosing:n.isSelfClosing||!1,hasNewline:n.hasNewline,hasSpaceBeforeSlash:!1,whitespaceBeforeAttrs:n.whitespaceBeforeAttrs||""}:null}function w6(e,t,n){for(var r=1,o=t;r>0&&o<e.length;){var i=e.indexOf("<",o);if(-1===i)return null;var a=n1(e,i);if(a){if(a.isClosing&&a.tagLower===n&&0===--r)return[i,a.endPos];a.isClosing||a.isSelfClosing||a.tagLower!==n||r++,o=a.endPos}else o=i+1}return null}var B6=/^\{.*\}$/,F$=/\n\n/,O$=/^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m,N6=/<\/?(?:pre|script|style|textarea)\b/i,CZ=/^<[A-Z]/,y6=/\n$/,b6=new Set(["#",">","-","*","+","`","|","0","1","2","3","4","5","6","7","8","9"]);function R6(e,t,n,r){let o=t;for(;o<n;)if("\\"===e[o]&&o+1<n)o+=2;else{if(e[o]===r)return o;o++}return-1}function NZ(e,t){var n=t.indexOf(":");if(n>0){var r=t.slice(n+1).trim(),o=r.length;if(o>=2){var i=r[0];'"'!==i&&"'"!==i||r[o-1]!==i||(r=r.slice(1,-1))}e.push([t.slice(0,n).trim(),r])}}function L6(e){var t=[];if(!e)return t;for(var n="",r=0,o="",i=0;i<e.length;i++){var a=e[i];if('"'===a||"'"===a)o?a===o&&(o="",r--):(o=a,r++);else if("("===a&&n9(n,"url"))r++;else if(")"===a&&r>0)r--;else if(";"===a&&0===r){NZ(t,n),n="";continue}n+=a}return NZ(t,n),t}function T6(tag,key,value,sanitizeUrlFn,options){if("style"===key)return L6(value).reduce(function(e,[t,n]){let r=sanitizeUrlFn(n,tag,t);return null!=r&&(e[t.replace(/(-[a-z])/g,e=>e[1].toUpperCase())]=r),e},{});if(value.match(B6)){if(value=value.slice(1,value.length-1),value=value?value.replace(p$,"$1"):value,value.length>0){let e=value[0];if("["===e||"{"===e)try{return JSON.parse(value)}catch(Z2){return value}}if("true"===value)return!0;if("false"===value)return!1;if(options.evalUnserializableExpressions)try{return eval(`(${value})`)}catch($2){return value}return value}return-1!==S$.indexOf(key)?sanitizeUrlFn(value?value.replace(p$,"$1"):value,tag,key):"true"===value||"false"!==value&&value}function u1(e,t,n,r){let o={};if(!e||!e.trim())return o;let i=[],a=0,s=e.length;for(;a<s;){for(;a<s&&C9(e[a]);)a++;if(a>=s)break;let t=a;for(;a<s&&A6(e[a]);)a++;if(a===t){a++;continue}let n=e.slice(t,a);for(;a<s&&C9(e[a]);)a++;if(a>=s||"="!==e[a]){i.push(n);continue}for(a++;a<s&&C9(e[a]);)a++;if(a>=s){i.push(n+"=");break}let r=a,o=e[a];if('"'===o||"'"===o)for(a++;a<s;){if(e[a]===o){if(a+1>=s){a++;break}let t=e[a+1];if(C9(t)||"/"===t){a++;break}}a++}else if("{"===o){let t=1;for(a++;a<s&&t>0;){if("{"===e[a])t++;else if("}"===e[a]&&(t--,0===t)){a++;break}a++}}else for(;a<s&&!C9(e[a]);)a++;i.push(n+"="+e.slice(r,a))}if(!(null==i?void 0:i.length))return o;let l=t.toLowerCase();for(let d=0;d<i.length;d++){let e=i[d],t=e.indexOf("=");if(-1!==t){let i=e.slice(0,t).trim(),a=i.toLowerCase();if("ref"===a)continue;let s=(e=>{let t=e[0];return('"'===t||"'"===t)&&e.length>=2&&e[e.length-1]===t?e.slice(1,-1):e})(e.slice(t+1).trim());if("href"===a&&"a"===l||"src"===a&&"img"===l){let e=r.sanitizer(s,l,a);if(null==e){O6(`Stripped unsafe ${a} on <${n}>`);continue}o[i]=e}else{let e=T6(l,a,s,r.sanitizer,r);o[i]=e}}else"style"!==e&&(o[e]=!0)}if(-1!==e.indexOf("%"))try{if(O9.test(decodeURIComponent(e)))for(var c in o)delete o[c]}catch(u){}else if(O9.test(e))for(var c in o)delete o[c];return o}var p9=function(e){return b6.has(e)};function S6(e,t,n){let r=t+1;for(;r<e.length&&"]"!==e[r];)"\\"===e[r]&&r+1<e.length?r+=2:r++;if(r>=e.length)return{shouldSkip:!1,newPos:0};let o=t+1,i=r,a=o<i&&("\n"===e[o]||"\r"===e[o]),s=i>o&&("\n"===e[i-1]||"\r"===e[i-1]),l=r+1;if(l=g0(e,l),l>=e.length||":"!==e[l])return{shouldSkip:!1,newPos:0};if((a||s)&&n){let t=l+1;for(t=g0(e,t),t<e.length&&"\n"===e[t]&&(t=g0(e,t+1));t<e.length&&"\n"!==e[t];)t++;return t<e.length&&t++,{shouldSkip:!0,newPos:t}}return E6(e,l)}function E6(e,t){let n=t+1;for(n=g0(e,n),n<e.length&&"\n"===e[n]&&(n=g0(e,n+1));n<e.length&&"\n"!==e[n];)n++;if(n>=e.length)return{shouldSkip:!1,newPos:0};n++;let r=g0(e,n);if(r>=e.length||'"'!==e[r]&&"'"!==e[r])return{shouldSkip:!1,newPos:0};let o=e[r],i=r+1;for(;i<e.length&&e[i]!==o&&"\n"!==e[i];)"\\"===e[i]&&i+1<e.length?i+=2:i++;if(i>=e.length||e[i]!==o)return{shouldSkip:!1,newPos:0};let a=g0(e,i+1);return a<e.length&&"\n"!==e[a]&&"\r"!==e[a]?{shouldSkip:!0,newPos:n}:{shouldSkip:!1,newPos:0}}function kZ(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.type===O$1.link)return!0;if(n.type===O$1.textFormatted){var r=n;if(r.children&&kZ(r.children))return!0}}return!1}function c$(e){for(var t="",n=0,r=e.length;n<r;n++){var o=e[n],i=o.type;if(i===O$1.text)t+=o.text;else if(i===O$1.image){var a=o;a.alt&&(t+=a.alt)}else if(i===O$1.textFormatted){var s=o;s.children&&(t+=c$(s.children))}else if(i===O$1.link){var l=o;l.children&&(t+=c$(l.children))}}return t}var x6=new Set([" ","\t","\r","\n","\f","\v"]),C6,G2;function l1(e,t,n,r,o){for(var i=[],a=[],s=[],l=t,c=t,u=o.disableAutoLink||r.inAnchor,d=!1,p=!!r.inAnchor,f=!!o.disableParsingRawHTML,h=o.optimizeForStreaming,m=-1,g=-1,v=[],y=function(t,a){if(h&&r.inHTML)return!1;if(!p){var s=f$(e,l,r,o,"<");if(s)return b(l),i.push(s),l=s.endPos,c=l,!0}if(f)return!1;var u=M$(e,l,r,o);if(u){b(l);var d=i.length;return i.push(u),v&&v.push(d),l=u.endPos,c=l,!0}if(h&&-1===g&&l+1<n){var m=b$2(e,l+1);(m>=m1&&m<=h1||m>=a1&&m<=r1||m===Z9||m===F9)&&(g=l)}var y=n1(e,l);if(!y)return!1;var x=l+(y.isClosing?2:1);if(x>=e.length||j1(e[x]))return!1;var $=e.indexOf(">",l+1);if(-1!==$){var _=l+1;if($-_>=7)if(c$1(e,"http://",_)||c$1(e,"https://",_))for(var C=_;C<$;C++)if(j1(e[C]))return!1}if(U9(b$2(e,x))&&x+1<e.length&&":"===e[x+1])return!1;if(y.isClosing&&y.attrs.trim().length)return!1;if(y.attrs.length)for(var w=!1,S="",E=0;E<y.attrs.length;E++){var k=y.attrs[E];if(w&&k===S)w=!1;else if(w||'"'!==k&&"'"!==k){if("*"===k||"#"===k||"!"===k){for(var T=E+1;T<y.attrs.length&&"="!==y.attrs[T]&&" "!==y.attrs[T]&&"\t"!==y.attrs[T];)T++;if(T<y.attrs.length&&"="===y.attrs[T])return!1}}else w=!0,S=k}var P=e.slice(l,y.endPos),M=y.tagName.toLowerCase(),L=P,I=L.indexOf(">");if(-1!==I){var R="</"+M+">",O=(L=L.slice(I+1)).indexOf(R);-1!==O&&(L=L.slice(0,O))}var A=[];if(L.trim()&&o){var D={...r,inline:!1,inHTML:!0},N=L.trim();F$.test(N)||O$.test(N)||H$.test(N)?A=d9(N,D,o):N&&(D.inline=!0,A=l1(N,0,N.length,D,o))}var F=u1(y.whitespaceBeforeAttrs+y.attrs,M,y.tagName,o),z={type:O$1.htmlBlock,tag:y.tagName,attrs:F,children:A,rawText:P,text:L,verbatim:!0,endPos:y.endPos};return b(l),i.push(z),c=l=z.endPos,!0},b=function(t){if(t>c){var n=e.slice(c,t);i.push({type:O$1.text,text:d?M9(n):n}),c=t,d=!1}};l<n;){if(0!==W6(pe=b$2(e,l),u)){if(pe===t0){for(var x=l,$=0;l+$<n&&b$2(e,l+$)===t0;)$++;if($>0){for(var _=l+$,C=-1,w=_;w<n;){for(;w<n&&b$2(e,w)!==t0;)w++;if(w>=n)break;for(var S=0;w+S<n&&b$2(e,w+S)===t0;)S++;S>$&&(S=$);var E=w+S;if(S===$&&(w<=_||b$2(e,w-1)!==t0)&&(E>=n||b$2(e,E)!==t0)){C=w,w=E;break}w++}if(-1!==C){for(var k=e.slice(_,C),T=!1,P=0;P<k.length;P++){var M=b$2(k,P);if(M===d$1||M===V0){T=!0;break}}var L=k;if(T&&(L=k.replace(/\r\n/g," ").replace(/\r/g," ").replace(/\n/g," ")),L.length>0){var I=b$2(L,0),R=b$2(L,L.length-1);if(I===C$2&&R===C$2)for(var O=1;O<L.length-1;O++)if(b$2(L,O)!==C$2){L=L.slice(1,L.length-1);break}}b(x),i.push({type:O$1.codeInline,text:L}),c=l=w;continue}if(h&&-1===m){m=x,b(x),n=x;break}l=_;continue}}if(!(p||u||pe!==i1&&pe!==c1&&pe!==x1)){var A=null,D=l+1<n?b$2(e,l+1):0,N=l+2<n?b$2(e,l+2):0,F=l+3<n?b$2(e,l+3):0,z=l+4<n?b$2(e,l+4):0,B=l+5<n?b$2(e,l+5):0;if(pe===c1&&D===r9&&N===r9&&F===B$?A="h":pe===x1&&D===x1&&N===x1&&F===I9?A="w":pe===i1&&D===r9&&N===B$&&F===P9&&z===Z9&&B===Z9&&(A="f"),A){var j=f$(e,l,r,o,A);if(j){b(l),i.push(j),l=j.endPos,c=l;continue}}}if(!p&&!u&&pe===E9){var H=f$(e,l,r,o,"@");if(H&&"emailStart"in H){var{emailStart:V,endPos:U}=H,W=[];for(E=a.length-1;E>=0;E--){(G=a[E]).sourcePos>=V&&G.sourcePos<U&&(G.nodeIndex>=0&&G.nodeIndex<i.length&&(i.splice(G.nodeIndex,1),W.push(G.nodeIndex)),a.splice(E,1))}if(V<c){for(w=i.length-1;w>=0;w--)if(i[w].type===O$1.text){i.splice(w,1),W.push(w);break}c=V}if(W.length){W.sort(function(e,t){return e-t});for(var Y=0,q=0;q<a.length;q++){for(var G=a[q];Y<W.length&&W[Y]<G.nodeIndex;)Y++;G.nodeIndex-=Y}}b(V),i.push(H),c=l=U;continue}}if(pe!==j9||!y()){if(pe===k1){if(l+1<n&&b$2(e,l+1)===d$1){for(var K=l+2;K<n&&b$2(e,K)===C$2;)K++;if(K>=n){l++;continue}for(b(l),i.push({type:O$1.breakLine}),l+=2;l<n&&b$2(e,l)===C$2;)l++;c=l;continue}var X=l+1<n?e[l+1]:"";if(X&&-1!=="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".indexOf(X)){b(l),i.push({type:O$1.text,text:"&"===X?"&​":X}),c=l+=2;continue}}if(pe!==g1)if(pe===H9&&s.length>0){var Z=s[s.length-1],J=Z.pos+("image"===Z.type?2:1),Q=l;b(l);var ee=l+1,te=t$(i,Z),ne="link"===Z.type&&kZ(te),re=!1;if(!ne&&ee<n&&"("===e[ee]){var oe=g6(e,ee+1);if(oe){yZ(i,a,s,Z,J,Q,o.sanitizer(Q$(oe.target),"a","href"),oe.title?Q$(oe.title):void 0),l=oe.endPos,c=l;continue}}var ie=r.refs||{},ae=null,se=l;if(ee<n&&"["===e[ee]){var le=ee+1;for(w=le;w<n&&"]"!==e[w];)w++;w<n&&(ae=e.slice(le,w),se=w,re=!0)}re&&""!==ae||(ae=e.slice(J,Q));var ce=hZ(ae);if(!ne&&ie&&ie[ce]){var ue=ie[ce];yZ(i,a,s,Z,J,Q,ue.target,ue.title),c=l=se+1;continue}var de=Z.resultIdx;if(s.pop(),i.length=de,h){if(i.push(...te),ee<n&&"("===e[ee])return i}else"image"===Z.type&&i.push({type:O$1.text,text:"!"}),i.push({type:O$1.text,text:"["},...te,{type:O$1.text,text:"]"});for(P=0;P<a.length;P++)a[P].nodeIndex>=de&&a[P].nodeIndex++;l++,c=l}else if(pe!==S9&&pe!==$9&&pe!==e1&&pe!==d1)if(pe!==d$1)for(pe===x9&&(d=!0),l++;l<n;){var pe;if((pe=b$2(e,l))>=K1)break;if(pe===x9&&(d=!0),0!==(Oe=f9[pe])){if(1!==Oe||pe!==i1&&pe!==c1&&pe!==x1||!u)break;l++}else l++}else{Ie=l-1;for(var fe=0;Ie>=c&&b$2(e,Ie)===C$2;)fe++,Ie--;if(fe>=2){for(K=l+1;K<n&&b$2(e,K)===C$2;)K++;if(K>=n){b(Ie+1),l=n,c=n;continue}for(b(Ie+1),i.push({type:O$1.breakLine}),l++;l<n&&b$2(e,l)===C$2;)l++;c=l;continue}var he=l>c?b$2(e,l-1):0;Pe=l+1<n?b$2(e,l+1):0;b(l>c&&he===C$2&&Pe===C$2?l-1:l),i.push({type:O$1.text,text:"\n"}),c=l+1,l>t&&he===C$2&&c<n&&b$2(e,c)===C$2&&c++,l=c}else{var me=e[l],ge=l,ve=A9(e,l,me);if(("~"===me||"="===me)&&2!==ve){l++;continue}var ye=ge+ve,be=BZ(e,ge,ye,n,0),xe=BZ(e,ge,ye,t,1),$e=be,_e=xe;if("_"===me&&be&&xe){if(ge>0){var Ce=e[ge-1],we=b$2(Ce);$e=q$(we,Ce)}if(ye<n){var Se=e[ye],Ee=b$2(Se);_e=q$(Ee,Se)}}b(ge),a.push({nodeIndex:i.length,type:me,length:ve,canOpen:$e,canClose:_e,active:!0,sourcePos:ge,inAnchor:p}),i.push({type:O$1.text,text:e.slice(ge,ge+ve)}),c=l=ge+ve}else{if(!p){if(l+1<n&&"^"===e[l+1]){for(var ke=l+2;ke<n&&"]"!==e[ke];)ke++;if(ke<n){var Te=e.slice(l+2,ke);b(l),i.push({type:O$1.footnoteReference,target:`#${o.slugify(Te)}`,text:Te}),c=l=ke+1;continue}}var Pe;if(r.inList&&l+2<n&&b$2(e,l+2)===H9)if((Pe=b$2(e,l+1))===C$2||Pe===N$||Pe===y$){b(l),i.push({type:O$1.gfmTask,completed:Pe===N$||Pe===y$}),c=l+=3;continue}}var Me=!1;if(l>t&&"!"===e[l-1]){for(var Le=0,Ie=l-2;Ie>=t&&"\\"===e[Ie];Ie--)Le++;if(!(1&Le)&&(Me=!0,c<l-1&&b(l-1),i.length>0&&i[i.length-1].type===O$1.text)){var Re=i[i.length-1];Re.text.endsWith("!")&&(Re.text=Re.text.slice(0,-1),Re.text||i.pop())}}Me||b(l),c=l+1,(!p||Me)&&s.push({type:Me?"image":"link",pos:Me?l-1:l,resultIdx:i.length,inAnchor:p}),l++}}}else for(pe===x9&&(d=!0),l++;l<n&&!((pe=b$2(e,l))>=K1);){var Oe;if(pe===x9&&(d=!0),0!==(Oe=f9[pe])){if(u&&1===Oe&&(pe===i1||pe===c1||pe===x1)){l++;continue}break}l++}}if(b(l),a.length&&rZ(i,a),h){for(var Ae=i.length,De=v.length-1;De>=0;De--){var Ne=v[De];if(Ne<i.length&&i[Ne].type===O$1.htmlBlock){var Fe=i[Ne];if(!(K9(Fe.tag)||Fe.children&&0!==Fe.children.length)){i.splice(Ne,1),Ne<Ae&&Ae--;for(P=0;P<a.length;P++)a[P].nodeIndex>Ne&&a[P].nodeIndex--;for(P=De+1;P<v.length;P++)v[P]>Ne&&v[P]--}}}if(-1!==m&&m<Ae)for(var ze=i.length-1;ze>=0;ze--)if(i[ze].type===O$1.text){Ae=ze;break}if(-1!==g&&g<Ae)for(ze=i.length-1;ze>=0;ze--)if(i[ze].type===O$1.text){Ae=ze;break}for(w=a.length-1;w>=0;w--)if(a[w].active&&a[w].nodeIndex<Ae){i.splice(a[w].nodeIndex,1),a[w].nodeIndex<Ae&&Ae--;for(E=0;E<w;E++)a[E].nodeIndex>a[w].nodeIndex&&a[E].nodeIndex--}return Ae<i.length&&(i.length=Ae),i}if(s.length){s.sort(function(e,t){return e.resultIdx-t.resultIdx});for(w=0;w<s.length;w++)i.splice(s[w].resultIdx+w,0,{type:O$1.text,text:"image"===s[w].type?"![":"["})}return i}function P6(e,t,n,r,o){for(var i=!1,a=0;a<t.length;a++)if(t[a].sourcePos>=r&&t[a].sourcePos<o){i=!0;break}if(i){var s=t$(e,n),l=[];for(a=0;a<t.length;a++){var c=t[a];c.sourcePos>=r&&c.sourcePos<o&&l.push({nodeIndex:c.nodeIndex-n.resultIdx,type:c.type,length:c.length,canOpen:c.canOpen,canClose:c.canClose,active:c.active,sourcePos:c.sourcePos,inAnchor:c.inAnchor})}rZ(s,l),e.length=n.resultIdx;for(var u=0;u<s.length;u++)e.push(s[u]);var d=[];for(a=0;a<t.length;a++)(t[a].sourcePos<r||t[a].sourcePos>=o)&&d.push(t[a]);t.length=0;for(u=0;u<d.length;u++)t.push(d[u])}}function I6(e,t,n,r){return"link"===e.type?{type:O$1.link,target:n,title:r,children:t}:{type:O$1.image,target:n||"",alt:c$(t),title:r}}function t$(e,t){return e.slice(t.resultIdx)}function yZ(e,t,n,r,o,i,a,s){P6(e,t,r,o,i);var l=t$(e,r);n.pop(),e.length=r.resultIdx,e.push(I6(r,l,a,s))}function f6(e,t,n){let r=g0(e,t),o=r<e.length&&"<"===e[r];o&&r++;let i,a,s=r;if(o&&r<e.length&&">"===e[r])return{target:"",endPos:r+1,hadSpace:!1};var l=!1;if(o){for(a=r;a<e.length&&">"!==e[a];){let t=e[a];if("\n"===t||"\r"===t||"<"===t)return null;"\\"!==t?a++:a+=2}if(a>=e.length||">"!==e[a])return null;a++;let t=s;for(;t<a-1&&j1(e[t]);)t++;let n=a-1;for(;n>t&&j1(e[n-1]);)n--;i=e.slice(t,n),r=a}else{let t=0;for(a=r;a<e.length;){let n=e[a];if(" "===n||"\t"===n||"\n"===n){l=!0;break}if("("!==n)if(")"!==n)a++;else{if(a>0&&"\\"===e[a-1]){a++;continue}if(0===t)break;t--,a++}else{if(a>0&&"\\"===e[a-1]){a++;continue}t++,a++}}i=e.slice(s,a),r=a}return{target:i,endPos:r,hadSpace:l}}function bZ(e,t,n,r){let o,i=t,a=0;for(;i<e.length;){let t=e[i];if(j1(t))i++;else{if("\n"!==t){if(V9(t))break;break}if(a>=1)break;a++,i++}}if(n&&!r&&(i>=e.length||'"'!==e[i]&&"'"!==e[i]&&"("!==e[i]))return{title:void 0,endPos:i};if(i<e.length){let t=e[i];if('"'===t||"'"===t){i++;let n=i;for(;i<e.length&&e[i]!==t;)"\\"===e[i]&&i++,i++;i<e.length&&(o=e.slice(n,i),i++)}else if("("===t){i++;let t=i,n=1;for(;i<e.length&&n>0;)"\\"===e[i]&&i+1<e.length?i++:"("===e[i]?n++:")"===e[i]&&n--,i++;0===n&&(o=e.slice(t,i-1))}}return i=g0(e,i),{title:o,endPos:i}}function g6(e,t,n){let r=f6(e,t);if(!r)return null;let o=t;o=g0(e,o);let i=o<e.length&&"<"===e[o];if(i&&""===r.target&&r.endPos===o+2){let t=bZ(e,r.endPos,!1,i);return t.endPos>=e.length||")"!==e[t.endPos]?null:{target:"",title:t.title,endPos:t.endPos+1}}let a=bZ(e,r.endPos,r.hadSpace,i);return a.endPos>=e.length||")"!==e[a.endPos]?null:{target:r.target,title:a.title,endPos:a.endPos+1}}function U9(e){return e>=m1&&e<=h1||e>=a1&&e<=r1}function mZ(e){let t=e.indexOf(":");if(t<2||t>32)return!1;if(!U9(b$2(e)))return!1;for(let n=1;n<t;n++){let t=e[n];if(b$2(t),!_$(t)&&"+"!==t&&"."!==t&&"-"!==t)return!1}return!0}function RZ(e,t,n){return 0===t||-1!==(n?" \t\n\r*_~(":" \t\n*_~(").indexOf(e[t-1])}function G$(e,t,n,r,o){let i=r(e,"a","href");return i?{type:O$1.link,target:i,children:[{type:O$1.text,text:t}],endPos:n,...void 0!==o?{emailStart:o}:{}}:null}function I$(e,t,n,r,o){if(n.inAnchor||2!==o&&r.disableAutoLink)return null;if(2===o){if("<"!==e[t])return null;let n=t+1;for(;n<e.length&&">"!==e[n];){let t=b$2(e,n);if(t===C$2||t===l$1||t===d$1||t===V0||t<C$2)return null;n++}if(n>=e.length||">"!==e[n])return null;let o=e.slice(t+1,n);if(!o.length)return null;let i=-1!==o.indexOf("\\"),a=mZ(o),s=c$1(o,"http://")||c$1(o,"https://"),l=!1;if(!a&&!s&&o.length>=7){let e=o[0];if("m"===e||"M"===e){let e=o.toLowerCase();if(c$1(e,"mailto:")){l=!0;let t=e.indexOf(":");return G$("mailto:"+o.slice(t+1),o,n+1,r.sanitizer)}}}let c=!i&&-1!==o.indexOf("@")&&-1===o.indexOf("//")&&!a;if(!(s||l||c||a))return null;let u=o;return l||a||s||!c||(u="mailto:"+o),G$(u,o,n+1,r.sanitizer)}if(1===o){let n=t;for(;n>0&&(_$(e[n-1])||-1!==".+-_".indexOf(e[n-1]));)n--;if(n>=t||!RZ(e,n,!0))return null;let o=t+1,i=!1;for(;o<e.length;){let t=e[o];if("."===t)i=!0,o++;else{if(!_$(t)&&"-"!==t&&"_"!==t)break;o++}}if(!i||o<=t+1)return null;for(;o>t+1&&"."===e[o-1];)o--;if(o>t+1&&("-"===e[o-1]||"_"===e[o-1]))return null;if(o-(t+1)<1e4){if(e.indexOf(".",t+1)>=o||-1===e.indexOf(".",t+1))return null}else if(-1===e.slice(t+1,o).indexOf("."))return null;let a=e.slice(n,o);return G$("mailto:"+a,a,o,r.sanitizer,n)}let i=c$1(e,"http://",t)||c$1(e,"https://",t),a=!i&&c$1(e,"ftp://",t),s=!i&&!a&&c$1(e,"www.",t);if(!(i||a||s)||!RZ(e,t,!1))return null;for(var l=t+(i?b$2(e,t+4)===zZ?8:7:a?6:4),c=l;l<e.length;){let t=b$2(e,l);if(t===C$2||t===l$1||t===d$1||t===j9||t===C1)break;l++}if(l<=c)return null;let u=l;for(;u>c;){let t=e[u-1];if(u>c+1&&"\\"===e[u-2])break;if("?"===t||"!"===t||"."===t||","===t||":"===t||"*"===t||"_"===t||"~"===t)u--;else if(";"===t){let t=u-2;for(;t>=c&&"&"!==e[t]&&" "!==e[t];)t--;if(t>=c&&"&"===e[t]){let n=e.slice(t+1,u-1);if(n.length>=2&&n.length<=10&&/^[a-zA-Z0-9]+$/.test(n)&&("lt"===n||"gt"===n||n.length>=3&&(c$1(n,"amp")||c$1(n,"apos")||c$1(n,"quot")||c$1(n,"nbsp")||/^[a-z]{3,10}$/.test(n))))break;u=t;break}u--}else{if(")"!==t)break;{let t=0,n=0;for(let r=c;r<u;r++)"("===e[r]&&t++,")"===e[r]&&n++;if(!(n>t))break;u--}}}if((l=u)<=c)return null;for(var d=c,p=-1,f=-1;d<l;){let t=b$2(e,d);if(!(t>=m1&&t<=h1||t>=a1&&t<=r1||t>=G9&&t<=Y9||t===D1||t===$9||t===I9))break;t===I9&&(f=p,p=d),d++}if(d===c||-1===p)return null;-1===f&&(f=c-1);for(let m=f+1;m<p;m++)if("_"===e[m])return null;for(let m=p+1;m<d;m++)if("_"===e[m])return null;let h=e.slice(t,l);return G$(s?"http://"+h:h,h,l,r.sanitizer)}function f$(e,t,n,r,o){return"<"===o?I$(e,t,n,r,2):"h"===o||"f"===o||"w"===o?I$(e,t,n,r,0):"@"===o?I$(e,t,n,r,1):null}function hZ(e){var t=e.trim().replace(/[\s\t\n\r]+/g," ");return-1!==t.indexOf("ẞ")?t.replace(/\u1E9E/g,"ss").toLowerCase():t.toLowerCase()}function k6(e,t,n){if(t+3>=e.length||"["!==e[t])return null;let r=e[t+1];return" "!==r&&"x"!==r&&"X"!==r||"]"!==e[t+2]?null:{type:O$1.gfmTask,completed:"x"===r.toLowerCase(),endPos:t+3}}function e$(e,t,n,r){let{inline:o,inList:i,inBlockQuote:a}=t;void 0!==r.inline&&(t.inline=r.inline),void 0!==r.list&&(t.inList=r.list),void 0!==r.inBlockQuote&&(t.inBlockQuote=r.inBlockQuote);let s=d9(e,t,n);return t.inline=o,t.inList=i,t.inBlockQuote=a,s}function u9(e,t,n,r,o){return W$(r,!0,()=>l1(e,t,n,r,o))}function l9(e,n,r,o){var i=e[n];if(void 0===i)return null;var a=n,s=null,l=i,c=null,u=b$2(i),d=u===C$2||u===l$1;if(d){if((a=n+(s=t(e,n,c=I$1(e,n))).charCount)>=e.length)return X$(e,n);l=e[a]}if((s?s.spaceEquivalent:0)>=4)return d?X$(e,n):null;var p=b$2(l);if(p===C1){var f=uZ(e,n,r,o);if(f)return f}else{if(p===$9)return D$(e,n);if(p===D1||p===S9||p===DZ){var h=D$(e,n);if(h)return h;if(m=o$(e,n,r,o))return m}else if(p>=G9&&p<=Y9){var m;if(m=o$(e,n,r,o))return m}else{if(p===T9)return m6(e,a,r,o);if(p===g1)return B9(e,a,r,o,a+1<e.length&&b$2(e,a+1)===D9);if(p===j9&&!o.disableParsingRawHTML)return M$(e,a,r,o);if(p===t0||p===e1){if(c||(c=I$1(e,n)),s||(s=t(e,n,c)),s.spaceEquivalent<=3)return $Z(e,a,r,o)}else if(p===jZ)return aZ(e,n,r,o)}}return d?X$(e,n):null}function d9(e,n,r){let o=[],i=0;for(;i<e.length;){for(;i<e.length&&"\n"===e[i];)i++;if(i>=e.length)break;var a=e[i];if(n.inList&&o.length>0){var s=o[o.length-1];if((null==s?void 0:s.type)===O$1.paragraph){var l=s,c=b$2(a);if(c===D1||c===d1||c===C$2||c===l$1){var u=I$1(e,i),d=e.slice(i,u),p=t(e,i,u);if(p.spaceEquivalent<4)if(cZ(o,d.slice(p.charCount).trim(),r)){i=u+(u<e.length&&"\n"===e[u]?1:0);continue}}}}var f=l9(e,i,n,r);if(f)o.push(f),i=f.endPos;else{var h=pZ(e,i,n,r);if(h)o.push(h),i=h.endPos;else{if(e.slice(i).trim()){if(n.inBlockQuote&&o.length>0){let t=function(e){if(e.type===O$1.blockQuote){var n=e;if(n.children&&n.children.length>0){var r=n.children[n.children.length-1];if(r.type===O$1.paragraph)return r}}else if(e.type===O$1.orderedList||e.type===O$1.unorderedList){var o=e;if(o.items&&o.items.length>0){var i=o.items[o.items.length-1];if(i&&i.length>0){var a=i[i.length-1],s=t(a);if(s)return s}}}return null};for(var m=o.length-1;m>=0;m--){if(l=t(o[m]))if(v=a$(e,i,n,r)){var g=v;l.children&&g.children&&l.children.push({type:O$1.text,text:"\n"},...g.children),i=v.endPos;continue}}}var v;if(v=a$(e,i,n,r)){o.push(v),i=v.endPos;continue}}i++}}}return o}function m6(e,n,r,o){if(r.inline)return null;let i=t(e,n,I$1(e,n),3);if(i.spaceEquivalent>3&&!r.inList)return null;var a=n+i.charCount;if(a>=e.length||"#"!==e[a])return null;let s=A9(e,a,"#",6);if((a+=s)>=e.length)return null;let l=e[a];if("\n"===l||"\r"===l){let t=I$1(e,a);return{...z$(s,[],"",o.slugify),endPos:t+(t<e.length?1:0)}}if(" "!==l&&"\t"!==l)return null;let c=a,u=I$1(e,c);var d=e.slice(c,u).replace(v6,"").trim();return{...z$(s,u9(d,0,d.length,r,o),d,o.slugify),endPos:u+(u<e.length?1:0)}}function pZ(e,t,n,r){if(n.inline||n.inBlockQuote||n.inList)return null;let o=I$1(e,t);if(o>=e.length)return null;let i=k$2(e,o),a=-1,s=null;for(var l=0;i<e.length&&l<10;l++){let t=I$1(e,i);if(t>=e.length)break;for(var c=i;c<t&&(b$2(e,c)===C$2||b$2(e,c)===l$1||b$2(e,c)===V0);)c++;if(c>=t)break;for(var u=0,d=i;d<t&&u<3&&b$2(e,d)===C$2;)u++,d++;if(d<t){let n=b$2(e,d);if(n===d1||n===D1){let r=e[d];for(var p=0,f=!1,h=d;h<t;){let t=b$2(e,h);if(t===n){if(f){p=0;break}p++}else{if(t!==C$2&&t!==l$1){p=0;break}f=!0}h++}if(p>=1){a=t,s=r;break}}}i=k$2(e,t)}if(!s)return null;let m=b$2(e,t);if(m===T9||m===C1||"|"===e[t])return null;let g=t;for(var v=t,y=!1;v<i;){let t=I$1(e,v);if(t>=i)break;for(var b=v;b<t&&(b$2(e,b)===C$2||b$2(e,b)===l$1||b$2(e,b)===V0);)b++;b<t&&(y=!0,g=t),v=k$2(e,t)}if(!y)return null;let x=e.slice(t,g);for(var $=0,_=x.length;$<_&&(x.charCodeAt($)===C$2||x.charCodeAt($)===l$1||x.charCodeAt($)===V0||x.charCodeAt($)===d$1);)$++;for(;_>$&&(x.charCodeAt(_-1)===C$2||x.charCodeAt(_-1)===l$1||x.charCodeAt(_-1)===V0||x.charCodeAt(_-1)===d$1);)_--;let C=x.slice($,_);return C?{...z$("="===s?1:2,u9(C,0,C.length,n,r),C,r.slugify),endPos:a+(a<e.length?1:0)}:null}function a$(e,n,r,o){if(r.inline)return null;if(o.optimizeForStreaming&&"|"===e[n]){for(var i=Math.min(500,e.length-n),a=e.substr(n,i),s=0,l=!1,c=0;c<a.length;c++)"|"===a[c]&&s++,"-"!==a[c]&&":"!==a[c]||(l=!0);if(s>=3&&l){for(var u=I$1(e,n);u<e.length;){var d=k$2(e,u);if(d>=e.length)break;var p=I$1(e,d),f=e.slice(d,p);if(-1===f.indexOf("|")&&-1===f.indexOf("-"))break;if(u=p,p>=e.length)break}return{type:O$1.paragraph,children:[],endPos:k$2(e,u)}}}let h=n,m=e.length;for(;h<m;){let n=I$1(e,h),i=!0;for(let t=h;t<n;t++){let n=b$2(e,t);if(n!==C$2&&n!==l$1&&n!==V0){i=!1;break}}if(i){h=n;break}if(n>=m){h=m;break}let a=k$2(e,n);if(a>=m){h=m;break}let s=I$1(e,a),l=!0,c="";for(let t=a;t<s;t++){let n=b$2(e,t);if(n!==C$2&&n!==l$1&&n!==V0){l=!1,""===c&&(c=e[t]);break}}if(l){h=n;break}let u=!1,d=t(e,a,s),p=4===d.spaceEquivalent&&4===d.charCount;if("<"===c&&!p&&!o.disableParsingRawHTML){let t=a,n=0;for(;t<s&&n<3;){let r=b$2(e,t);if(r!==C$2&&r!==l$1)break;n++,t++}if(t<s&&"<"===e[t]){var g=M$(e,t,{...r,inline:!1},o);g&&(u=!("canInterruptParagraph"in g)||g.canInterruptParagraph)}}if(p)u=!1;else if(!u&&c&&p9(c))if("["===c){u=!(a+1>=m||"^"!==e[a+1])}else if("*"===c||"+"===c)if(D$(e,a))u=!0;else{let t=a+1<m?e[a+1]:"";u=!(!t||!j1(t))}else{let n=l9(e,a,r,o);n&&(u=n.type===O$1.codeBlock?!(t(e,a,s).spaceEquivalent>=4):n.type===O$1.unorderedList||n.type===O$1.orderedList?n.type!==O$1.orderedList||1===n.start:"-"===c||n.type!==O$1.ref)}if(u){h=n;break}h=k$2(e,n)}if(h<=n)return null;for(var v=n,y=h;v<y;){let t=b$2(e,v);if(t!==C$2&&t!==l$1)break;v++}var b;if(y>I$1(e,v)){for(var x=[],$=v,_=0;$<y;){var C=I$1(e,$);if(C>y&&(C=y),0===_)x.push(e.slice($,C));else{for(var w=0;w<4&&$+w<C&&b$2(e,$+w)===C$2;)w++;var S=4===w?$+4:$;x.push(e.slice(S,C))}if(C<y){let t=b$2(e,C);t===V0||t===d$1?(x.push("\n"),$=k$2(e,C)):$=y}else $=y;_++}b=x.join("")}else b=e.slice(v,y);for(var E=b.length;E>0;){var k=b.charCodeAt(E-1);if(k!==C$2&&k!==l$1)break;E--}E<b.length&&(b=b.slice(0,E));let T=!1;for(let t=0;t<b.length;t++){let e=b.charCodeAt(t);if(e!==C$2&&e!==l$1&&e!==d$1&&e!==V0){T=!0;break}}if(!T)return null;for(var P=b,M=h,L=-1,I=h-1;I>=v;){if(b$2(e,I)===d$1){L=I;break}I--}if(L>=0){for(var R=!1,O=v;O<L;O++){let t=b$2(e,O);if(t!==C$2&&t!==l$1&&t!==d$1&&t!==V0){R=!0;break}}if(!R){for(var A=L+1;A<e.length;){let t=b$2(e,A);if(t!==C$2&&t!==l$1)break;A++}if(A-(L+1)<4&&A<e.length&&"["===e[A]){var D={...r,inline:!1},N=B9(e,A,D,o,!1);if(N){var F=0;for(I=v;I<=L;){let t=e.indexOf("\n",I);if(-1===t||t>L)break;F++,I=t+1}var z=0,B=0;for(I=0;I<b.length;){let e=b.indexOf("\n",I);if(-1===e)break;if(++B===F){z=e+1;break}I=e+1}z>0&&(P=b.slice(0,z-1)),M=N.endPos,r.refs=D.refs}}}}let j=u9(P,0,P.length,r,o);var H={type:O$1.paragraph,children:j,endPos:M};if(j.length>0){for(var V=[],U=j.length-1;U>=0;U--){var W=j[U];if(W.type===O$1.htmlSelfClosing&&!0===W.isClosingTag)V.push(U);else{if(W.type!==O$1.text)break;var Y=W;if(Y.text&&Y.text.trim().length>0)break}}if(V.length>=3){var q=V[V.length-1],G=j.slice(q+1);j.splice(q+1),H.removedClosingTags=G}}return H}function h6(e,t){if(0!==t)return null;let n=L$(e);if(!(null==n?void 0:n.hasValidYaml))return null;let r=n.endPos-1;r>0&&"\r"===e[r-1]&&r--;let o=p1(e.slice(0,r));return{type:O$1.frontmatter,text:o,endPos:n.endPos}}function D$(e,n,r,o){let i=I$1(e,n),a=t(e,n,i,3);if(a.spaceEquivalent>3)return null;var s=n+a.charCount;if(s>=i)return null;let l=e[s];if("-"!==l&&"*"!==l&&"_"!==l)return null;for(var c=0,u=s;u<i;){var d=e[u];if(d===l)c++;else if(" "!==d&&"\t"!==d)return null;u++}return c<3?null:{type:O$1.breakThematic,endPos:k$2(e,i)}}function t(e,t,n,r){let o=0,i=0,a=t;for(;a<n;){var s=b$2(e,a);if(s!==C$2&&s!==l$1)break;if(void 0!==r&&o>=r)break;o+=s===l$1?4-o%4:1,i++,a++}return{spaceEquivalent:o,charCount:i}}function LZ(e,t,n,r){let o=0,i=0,a=r;for(let d=t;d<n&&i<4;d++){var s=b$2(e,d);if(s===l$1){let e=4-a%4;if(i+=e,o++,a+=e,i>=4)break}else{if(s!==C$2)break;if(i++,o++,a++,i>=4)break}}let l=e.slice(t+o,n);for(var c=0,u=t;u<n&&("\t"===e[u]&&c++,!(c>=2));u++);return c>=2&&c$1(l,"\t")&&r>0&&(l=" "+l.slice(1)),l}function X$(e,n,r){let o=t(e,n,I$1(e,n));if(o.spaceEquivalent<4)return null;let i=o.spaceEquivalent,a=I$1(e,n+o.charCount),s=n,l=0;for(var c=s-1;c>=0&&"\n"!==e[c]&&"\r"!==e[c];)c--;for(c++;c<s;)"\t"===e[c]?l=l+4-l%4:l++,c++;let u=LZ(e,s,a,l),d=k$2(e,a);if(d>=e.length)return u.trim()?{type:O$1.codeBlock,text:u,endPos:d}:null;var p=[];p.push(u);let f=d;for(;f<e.length;){let n=I$1(e,f);if(w1(e,f,n)){let r=n+1;if(r<e.length){let n=t(e,r,I$1(e,r)),o=e[r+n.charCount];if(o&&"\n"!==o&&(n.spaceEquivalent<4||">"===o&&n.spaceEquivalent<i))break}p.push("\n")}else{if(t(e,f,n).spaceEquivalent<4)break;let r=LZ(e,f,n,0);p.push("\n"),p.push(r)}f=k$2(e,n)}let h=p.join("");return h=h.replace(y6,""),h.trim()?{type:O$1.codeBlock,text:h,endPos:f}:null}function $Z(e,n,r,o){let i=e[n];if("`"!==i&&"~"!==i)return null;let a=A9(e,n,i);if(a<3)return null;let s=n;for(;s>0&&b$2(e,s-1)!==d$1;)s--;let l=t(e,s,n),c=l.spaceEquivalent,u=c;if(4===c&&4===l.charCount&&(c=0,u=4),c>=4)return null;let d=g0(e,n+a),p=I$1(e,d),f=e.slice(d,p).trim();if("`"===i&&-1!==f.indexOf("`"))return null;f=f.replace(p$,"$1");let h=f.indexOf(" "),m=h>0?f.slice(0,h):f,g=h>0?f.slice(h+1).trim():"",v=g&&/=\s*["']/.test(g)?u1(g,"code","code",o):void 0,y=k$2(e,p),b=y,x=!1;for(;b<e.length;){let t=I$1(e,b),n=b,r=0;for(;n<t;){let t=b$2(e,n);if(t===C$2){if(r++,n++,r>=4)break}else{if(t!==l$1)break;if(r+=4-r%4,n++,r>=4)break}}if(r<4){let r=A9(e,n,i,t-n);if(r>=a){let o=n+r;for(;o<t;){let t=b$2(e,o);if(t!==C$2&&t!==l$1)break;o++}if(o===t){x=!0;break}if(r>=3&&o<t){let o=n+r;if(!(o<t)||b$2(e,o)!==C$2&&b$2(e,o)!==l$1){let n=!0;if("`"===i&&-1!==e.slice(o,t).indexOf("`")&&(n=!1),n)break}}}}else if(4===u&&0===c&&4===r){let r=A9(e,n,i,t-n);if(r>=a&&w1(e,n+r,t)){x=!0;break}}b=k$2(e,t)}let $=b>y&&"\n"===e[b-1]?b-1:b;$>y&&"\r"===e[$-1]&&$--;let _=p1(e.slice(y,$));u&&(_=r$(_,u));let C=x&&b<e.length?k$2(e,I$1(e,b)):b;return{type:O$1.codeBlock,text:_,lang:m,attrs:v,endPos:C}}function p6(e,t,n){for(var r=0;r<e.length;r++)if(!d$(e[r])){let r=e$(e,t,n,{inline:!1,inBlockQuote:!0});for(var o=0;o<r.length;o++){let e=r[o];"endPos"in e&&delete e.endPos}return r}return[]}function uZ(e,n,r,o){if(r.inline)return null;let i=n;for(;i<e.length&&(" "===e[i]||"\t"===e[i]);)i++;if(i>=e.length||">"!==e[i])return null;let a=n;for(var s=[],l=void 0,c=-1,u=!1,d=null,p=null,f=0,h=!1;a<e.length;){let n=I$1(e,a),i=a;for(;i<n&&(" "===e[i]||"\t"===e[i]);)i++;if(i<n&&">"===e[i]){let r=i+1;r<n&&" "===e[r]&&r++;let o=t(e,r,n).spaceEquivalent>=4,a=!1,l=null,v=0;if(r<n){let t=e[r];if("`"===t||"~"===t){let o=0,i=r;for(;i<n&&e[i]===t&&o<20;)o++,i++;o>=3&&(a=!0,l=t,v=o)}}u&&"fenced"===d&&l===p&&v>=f?(u=!1,d=null,p=null,f=0):(o||a)&&(u=!0,d=o?"indented":"fenced",p=l,f=v);var m=!o&&!a;if(m)for(var g=r;g<n;g++)if(!d$(e[g])){m=!1;break}h=m,-1!==c||m||(c=s.length);let y=i+1;if(y<n&&"\t"===e[y]){s.push(" ");let t=4;for(let r=y+1;r<n;r++){let n=e[r];if(b$2(n)===l$1){let e=4-t%4;1===e?s.push(" "):2===e?s.push(" "):3===e?s.push(" "):s.push(" ".repeat(e)),t+=e}else s.push(n),t++}n<e.length&&s.push("\n")}else{let t=y;t<n&&" "===e[t]&&t++,s.push(e.slice(t,n)),n<e.length&&s.push("\n")}}else{var v=!0;for(g=a;g<n;g++)if(!d$(e[g])){v=!1;break}if(v||u)break;if(0===t(e,a,n).spaceEquivalent){let t=l9(e,a,r,o);if(t&&t.type!==O$1.ref&&t.type!==O$1.codeBlock)break;if(h)break}s.push(e.slice(a,n)),n<e.length&&s.push("\n")}a=k$2(e,n)}if(a===n)return null;s.length>0&&"\n"===s[s.length-1]&&s.pop();let y=s.join("");if(y.length>=4&&y.charCodeAt(0)===g1&&y.charCodeAt(1)===F9){let e=y.indexOf("]\n",2);e>2&&(l=y.slice(2,e),y=y.slice(e+2))}let b=p6(y,r,o),x={type:O$1.blockQuote,children:b,endPos:a};return l&&(x.alert=l),x}function r$(e,t){return e.split("\n").map(function(e){if(0===e.length)return e;let n=t,r=0,o=0,i=0;for(;o<e.length&&r<n;)if(" "===e[o])r++,i++,o++;else{if("\t"!==e[o])break;{let t=4-i%4;if(!(r+t<=n)){let i=n-r,a=Math.max(0,t-i);return" ".repeat(a)+e.slice(o+1)}r+=t,i+=t,o++}}return e.slice(o)}).join("\n")}function K$(e,t,n,r,o=!0){let i=(o?"\n":"")+e,a=u9(i,0,i.length,n,r);t.length>0&&t[t.length-1].type===O$1.paragraph?t[t.length-1].children.push(...a):t.push(...a)}function k9(e){return e.some(function(e){return e.type===O$1.codeBlock||e.type===O$1.paragraph||e.type===O$1.blockQuote||e.type===O$1.orderedList||e.type===O$1.unorderedList||e.type===O$1.heading})}function g$(e){return!!e.match(n$)}function lZ(e){var t;if(0===e.length)return e;var n=e[e.length-1];return(n.type===O$1.orderedList||n.type===O$1.unorderedList)&&(null==(t=n.items)?void 0:t.length)>0?lZ(n.items.slice(-1)[0]):e}function s$(e,t,n,r,o,i,a){if(!c$1(o,"["))return null;var s={inline:!1,refs:i.refs||{}},l=B9(e,t+r.charCount,s,a,!1);return l?l.endPos:null}function TZ(e,t,n,r){return!(1!==e.length||!n)&&(0===e[0].length&&(!!t||!t&&""===r.trim()))}function SZ(e,t){var n=e.index||0;return t?n+e[1].length+e[2].length+1:n+e[1].length+1}function j$(e,t,n,r,o){for(var i=0,a=r+o,s=t;s<n&&i<4;){var l=b$2(e,s);if(l===C$2)i++,a++;else{if(l!==l$1)break;var c=4-a%4;if(i+c>4)break;i+=c,a+=c}s++}return{contentStartColumn:a,contentStartPos:s}}function C$(e){var t=e.match(n$);return t?t[1]?{match:[e,t[1],t[2],t[3]],ordered:!0,listItemRegex:u$}:t[4]?{match:[e,t[4],t[5],""],ordered:!0,listItemRegex:u$}:t[6]?{match:[e,t[6],t[7]],ordered:!1,listItemRegex:l$}:t[8]?{match:[e,t[8],""],ordered:!1,listItemRegex:l$}:null:null}function o1(e,t,n,r,o,i,a){if(t.spaceEquivalent!==i)return!1;var s=e.match(a);if(s)return n?s[2]===o:s[1]===r;var l=e.match(n$);return!!l&&(n?l[4]&&l[5]===o:l[8]===r)}function dZ(e,t,n,r){for(var o=t,i=n,a=t[0];i<e.length;){var s=I$1(e,i),l=e.slice(i,s),c=c$1(l," ".repeat(r))?l.slice(r):l;if(c$1(c.trim(),a)&&A9(c.trim(),0,a)>=3)return{content:o,endPos:k$2(e,s)};o+="\n"+c,i=k$2(e,s)}return{content:o,endPos:i}}function Y$(e,n,r,o,i,a,s,l,c,u,d,p,f){var h=u?void 0:c[1],m=u?c[2]:void 0,g=u?u$:l$,v=d;if(!d)for(var y=k$2(e,a);y<e.length;){var b=I$1(e,y),x=e.slice(y,b),$=t(e,y,b),_=$.spaceEquivalent;if(w1(e,y,b)){var C=k$2(e,b);if(C<e.length)if(t(e,C,I$1(e,C)).spaceEquivalent+1>(E=j$(e,i+l+(S=SZ(c,u)),a,s,S).contentStartColumn)){v=!0;break}break}if(_<=s){var w=x.slice($.charCount).match(g);if(w&&(u?w[2]===m:w[1]===h))break}y=k$2(e,b)}var S,E=j$(e,i+l+(S=SZ(c,u)),a,s,S).contentStartColumn,k=o,T=k$2(e,a);if(c$1(o,"```")||c$1(o,"~~~")){var P=dZ(e,o,T,u?c[1].length+c[2].length+1:c[1].length+1);k=P.content,T=P.endPos}return n.push(iZ(k,v,p,f)),r.push(E),{newCurrentPos:T,itemHasBlankLine:v}}function EZ(e,t,n,r,o,i){if(o>r||i.disableParsingRawHTML)return!1;let a=t+n;return!(a>=e.length||"<"!==e[a])&&u6(e,a)}function u6(e,t){if(t>=e.length||"<"!==e[t])return!1;let n=e.length,r=t+1;if(r<n&&"/"===e[r]&&r++,r>=n)return!1;if(!U9(b$2(e,r)))return!1;for(r++;r<n;){let t=e[r],n=b$2(e,r);if(">"===t||" "===t||"\t"===t||"\n"===t||"\r"===t||"/"===t)break;if(!("-"===t||"_"===t||U9(n)||n>=48&&n<=57))return!1;r++}let o=0;for(;r<n;){let t=e[r],i=b$2(e,r);if(1===o)'"'===t&&(o=0),r++;else if(2===o)"'"===t&&(o=0),r++;else if('"'===t)o=1,r++;else if("'"===t)o=2,r++;else{if(">"===t)return!0;if("/"===t&&r+1<n&&">"===e[r+1])return!0;if(10===i||13===i)return!1;r++}}return!1}function xZ(e,n,r,o,i,a,s,l,c,u,d,p){let f=o,h=!1;for(;f<e.length;){let o=I$1(e,f),m=t(e,f,o),g=m.spaceEquivalent;if(w1(e,f,o)){h=!0,f=k$2(e,o);continue}let v=e.slice(f+m.charCount,o);if(g<=i&&o1(v,m,a,s,l,i,c))break;if(!(g>=r))break;{if(p&&h){let t=s$(e,f,o,m,v,u,d);if(t){f=t,h=!1;continue}}let t=V$(e,f,o,m,r-1,r,n,h,u,d,void 0);if(t.processed){f=t.newPos,h=t.wasBlank;continue}}}return f}function PZ(e,t,n,r){let o=e$(e,n,r,{inline:!1,list:!0});if(o.length>0)return t||1!==o.length||o[0].type!==O$1.paragraph?o:o[0].children;let i=W$(n,!0,()=>l1(e,0,e.length,n,r));return t&&i.length>0?[{type:O$1.paragraph,children:i}]:i}function iZ(e,t,n,r){let o=k6(e,0);if(!o||!(o.endPos>=e.length||" "===e[o.endPos]))return PZ(e,t,n,r);let i=o.endPos<e.length?o.endPos+1:o.endPos,a=PZ(e.slice(i),t,n,r),s=[o];return o.endPos<e.length&&s.push({type:O$1.text,text:" "}),s.push(...a),s}function IZ(e,t){if(!e[0])return!1;let n=e[0].indexOf(t);if(-1===n)return!1;let r=n+t.length;if(r>=e[0].length)return!1;let o=e[0][r];return!!o&&b$2(o)===_Z}function cZ(e,t,n){if(0===e.length)return!1;let r=e[e.length-1],o=t.trim();if(!c$1(o,"=")&&!c$1(o,"-")||o.length<1||!/^[=-]+[ \t]*$/.test(o))return!1;let i=[],a="";if(r.type===O$1.paragraph){let e=r;i=e.children,a=e.children.map(e=>e.type===O$1.text?e.text:"").join("").trim()}else if(r.type===O$1.text){let t=[],n=e.length-1;for(;n>=0&&e[n].type===O$1.text;)t.unshift(e[n]),n--;t.length>0&&(i=t,a=t.map(e=>e.text).join("").trim())}if(!a)return!1;let s="="===o[0]?1:2;if(r.type===O$1.paragraph)e.pop();else if(r.type===O$1.text)for(;e.length>0&&e[e.length-1].type===O$1.text;)e.pop();return e.push(z$(s,i,a,n.slugify)),!0}function V$(e,t,n,r,o,i,a,s,l,c,u,d){let p=r.spaceEquivalent,f=e.slice(t+r.charCount,n);if(p>=o+4){let n=X$(e,t);if(n){let e=n,t=r$(e.text||"",i);return a.push({...e,text:t}),{processed:!0,newPos:e.endPos,wasBlank:!1}}}if(p+1>=i&&p-(i-1)<=3){let o=t+r.charCount;if(o<n){let t=e[o];if("`"===t||"~"===t){let t=$Z(e,o,l,c);if(t){let e=t,n=r$(e.text||"",i-1);return a.push({...e,text:n,endPos:e.endPos}),{processed:!0,newPos:e.endPos,wasBlank:!1}}}if("|"===t){let t=aZ(e,o,l,c);if(t){let e=t;return a.push(e),{processed:!0,newPos:e.endPos,wasBlank:!1}}}}}if(f.length>0&&("-"===f[0]||"*"===f[0]||"+"===f[0]||f[0]>="0"&&f[0]<="9")&&/^([-*+]|\d{1,9}[.)])\s+/.test(f)){let t=u9(f,0,f.length,l,c);return a.push({type:O$1.text,text:"\n"},...t),{processed:!0,newPos:k$2(e,n),wasBlank:!1}}let h=M6(e,t,a,f,l,c);if(null!==h)return{processed:!0,newPos:h,wasBlank:!1};let m=e$(f,l,c,{inline:!1,list:!0});if(m.length>0){if(u&&m[0].type===O$1.paragraph){let e=m[0];a.push({type:O$1.text,text:"\n"},...e.children),m.length>1&&a.push(...m.slice(1))}else if(!s&&m[0].type===O$1.paragraph&&a.length>0){let e=a[a.length-1],t=m[0];e.type===O$1.paragraph?e.children.push({type:O$1.text,text:"\n"},...t.children):e.type===O$1.heading?a.push(...t.children):k9(a)?a.push(...m):a.push({type:O$1.text,text:" "},...t.children),m.length>1&&a.push(...m.slice(1))}else a.push(...m);return{processed:!0,newPos:k$2(e,n),wasBlank:!1}}if(s){let e=W$(l,!0,()=>l1(f,0,f.length,l,c));a.push({type:O$1.paragraph,children:e})}else K$(f,a,l,c);return{processed:!0,newPos:k$2(e,n),wasBlank:!1}}function o$(e,n,r,o){if(r.inline)return null;var i=r.inList;if(r.inList=!0,n>0){var a=b$2(e,n-1);if(a!==d$1&&a!==V0)return r.inList=i,null}var s=I$1(e,n);if((Le=t(e,n,s)).spaceEquivalent>3&&!r.inList)return r.inList=i,null;var l=e.slice(n,s),c=Le.charCount,u=C$(Ie=l.slice(c));if(!u)return r.inList=i,null;var{match:d,ordered:p,listItemRegex:f}=u,h=Le.spaceEquivalent,m=p?parseInt(d[1],10):void 0,g=p?d[2]:void 0,v=p?void 0:d[1],y=p?""===d[3]:""===d[2];function b(t,n){if(0===t)return!0;if(b$2(e,t-1)!==d$1)return!1;if(!n)return!0;for(var r=t-2;r>=0;){var o=b$2(e,r);if(o!==C$2&&o!==l$1)break;r--}return r<0||b$2(e,r)===d$1}if(y&&!b(n,!0))return r.inList=i,null;if(p&&1!==m&&!b(n,!1))return null;if(!p&&IZ(d,v))return null;var x=d.index||0,$=p?x+d[1].length+d[2].length+1:y?x+d[1].length:x+d[1].length+1,_=j$(e,n+c+$,s,h,$).contentStartColumn,C=h+x+d[1].length,w=p?C+d[2].length+1:y?C:C+1,S=[],E=[];function k(e,t,n){return n?e>=t:e>t}function T(){return S[S.length-1]}function P(){return E[E.length-1]??_}function M(t,n){let i=lZ(n),a=r.inList;r.inList=!0;let s=o$(e,t,r,o);return r.inList=a,s?(i.push(s),s):null}for(var L=k$2(e,s),I=L,R=!1;I<e.length;){var O=I$1(e,I),A=e.slice(I,O);if(""===A.trim()){for(var D=k$2(e,O);D<e.length;){if((te=b$2(e,D))===d$1);else if(!x6.has(e[D]))break;D++}var N=I$1(e,D),F=e.slice(D,N),z=t(e,D,N),B=F.slice(z.charCount);if(o1(B,z,p,v,g,h,f))R=!0;else{var j=s$(e,D,N,z,B,r,o);if(j){for(var H=j;H<e.length&&b$2(e,H)===d$1;)H++;if(H<e.length){var V=I$1(e,H),U=e.slice(H,V),W=t(e,H,V);o1(U.slice(W.charCount),W,p,v,g,h,f)&&(R=!0)}}}break}var Y=t(e,I,O),q=C$(A.slice(Y.charCount));if(!q)break;var G=q.match;if(p){if(G[2]!==g)break}else if(G[1]!==v)break;I=k$2(e,O)}var K=p?d[3]:d[2];K=K.trimStart();for(var X=n+c+(d.index||0),Z=p?X+d[1].length+d[2].length:X+d[1].length,J=Z;J<e.length;){if((te=b$2(e,J))!==C$2&&te!==l$1)break;J++}for(var Q=0,ee=Z;ee<s;){var te;if((te=b$2(e,ee))===l$1)Q+=4-Q%4;else{if(te!==C$2)break;Q++}ee++}var ne=!1;if(Z<e.length&&b$2(e,Z)===l$1){for(var re=1,oe=Z+1;oe<e.length&&b$2(e,oe)===l$1;)re++,oe++;re>=2&&(K=" "+K,ne=!0)}p||(y=y&&0===Q),Q>=4&&!ne&&(K=" ".repeat(Q-1)+K.trimStart()),K.trim();let ie=R;if(!R&&L<e.length)for(var ae=L;ae<e.length;){var se=I$1(e,ae),le=e.slice(ae,se);if(w1(e,ae,se)){for(var ce=k$2(e,se);ce<e.length;){var ue=I$1(e,ce);if(!w1(e,ce,ue))break;ce=k$2(e,ue)}if(ce<e.length){var de=t(e,ce,e.length),pe=de.spaceEquivalent;if(pe>=h){for(var fe=e.slice(ce,I$1(e,ce)).slice(de.charCount).match(f),he=fe&&(p?fe[2]===g:fe[1]===v),me=null,ge=L;ge<ae;ge=I$1(e,ge)+1){var ve=I$1(e,ge),ye=t(e,ge,ve),be=e.slice(ge,ve).slice(ye.charCount).match(f);if(be&&ye.spaceEquivalent>h&&ye.spaceEquivalent>=_&&(p?be[2]===g:be[1]===v)){var xe=ye.spaceEquivalent+1,$e=p?xe+be[1].length+be[2].length+1:xe+be[1].length+1,_e=ge+ye.charCount+be[0].length;me=j$(e,_e,ve,xe,$e-xe).contentStartColumn;break}}!he&&pe>=(Q>=5?w:_)&&(null===me||pe+1<me)&&(ie=!0)}}break}var Ce=t(e,ae,se),we=Ce.spaceEquivalent,Se=le.slice(Ce.charCount).match(f);if(Se&&(p?Se[2]===g:Se[1]===v)&&we<=h)break;ae=k$2(e,se)}var Ee=K;if(c$1(K,"```")||c$1(K,"~~~")){var ke=p?d[1].length+d[2].length+1:d[1].length+1,Te=dZ(e,K,L,ke);Ee=Te.content,L=Te.endPos}var Pe=!y&&""===K.trim()&&Q>0&&Q<5;if(!ie){var Me=">"===(Ee.length>0?Ee[0]:"");for(n=L;n<e.length;){var Le;s=I$1(e,n);if(""===(l=e.slice(n,s)).trim())break;if((Le=t(e,n,s)).spaceEquivalent<w)break;var Ie=l.slice(Le.charCount);if(Le.spaceEquivalent<=h&&o1(Ie,Le,p,v,g,h,f))break;if(g$(Ie)&&Le.spaceEquivalent>h)break;var Re=Ie.length>0?Ie[0]:"";if(">"===Re&&!(">"===Re&&Me)||"#"===Re||c$1(Ie,"```")||c$1(Ie,"~~~"))break;Ee+="\n"+Ie,L=n=k$2(e,s)}}if(S.push(iZ(Ee,ie,r,o)),E.push(_),ie&&(Q>=5||Pe)){let t=T();L=xZ(e,t,w,L,h,p,v,g,f,r,o,!0)}else if(!ie){let n=w-1;for(;L<e.length;){let i=I$1(e,L),a=e.slice(L,i),s=t(e,L,i),l=s.spaceEquivalent,c=a.slice(s.charCount);if(""===a.trim()||l<=h&&o1(c,s,p,v,g,h,f)||g$(c)&&l>h||l<n)break;let u=T(),d=V$(e,L,i,s,n,_,u,!1,r,o,!0);if(!d.processed)break;L=d.newPos}}for(var Oe=!1;L<e.length;){let n=I$1(e,L),i=e.slice(L,n),a=t(e,L,n),s=a.charCount,l=a.spaceEquivalent;if(""===i.trim())R=!0,Oe=!0,L=k$2(e,n);else{if(l<h){let t=i.slice(s);if(t.startsWith("<")&&EZ(e,L,s,h,l,o))break;let c=t.trim();if(c.length>0&&S.length>0&&!p9(c[0])&&!o1(t,a,p,v,g,h,f)){let i=T();if(i.length>0){let a=i[i.length-1];if(!Oe&&(a.type===O$1.paragraph||a.type===O$1.text)){K$(t,i,r,o),Oe=!1,L=k$2(e,n);continue}}}break}{let c=i.slice(s);if(S.length>0){if(l+1>=(E[S.length-1]||_)&&!o1(c,a,p,v,g,h,f)){let t=T();if(t.length>0&&cZ(t,c,o)){L=k$2(e,n);continue}}}if(D$(e,L))break;if(Oe){let t=s$(e,L,n,a,c,r,o);if(t){L=t,Oe=!1;continue}}if(l<=h){if(c.startsWith("<")&&EZ(e,L,s,h,l,o))break;if(!o1(c,a,p,v,g,h,f)){if(l===h&&!Oe){let t=c.trim();if(t.length>0&&!p9(t[0])){let t=l9(e,L,r,o);if(t&&t.type!==O$1.paragraph)break;let i=T();if(i.length>0&&!k9(i)){K$(c,i,r,o,!0),Oe=!1,L=k$2(e,n);continue}}}break}}if(TZ(S,y,Oe,K))break;let u=C$(c),d=u?u.match:null,m=d&&(p?d[2]===g:d[1]===v);if(m&&l>3&&Oe)break;if(m&&l<=h+3){if(l>=4&&Oe)break;if(l===h){let t=p?d[3]:d[2];if(t=t.trimStart(),L=Y$(e,S,E,t,L,n,l,s,d,p,R,r,o).newCurrentPos,Oe=!1,""===t.trim()){let t=S[S.length-1],n=P();L=xZ(e,t,n,L,h,p,v,g,f,r,o)}continue}if(l>h){if(Oe){let t=p?d[3]:d[2];t=t.trimStart(),L=Y$(e,S,E,t,L,n,l,s,d,p,R,r,o).newCurrentPos,Oe=!1;continue}let i=T(),c=k(l+1,P(),k9(i));if(c){let e=M(L,i);if(e){L=e.endPos,Oe=!1;continue}}if(!c&&m){let i=p?d[3]:d[2];if(i=i.trimStart(),!R){let r=k$2(e,n);for(;r<e.length;){let n=I$1(e,r),o=e.slice(r,n),i=t(e,r,n),a=i.spaceEquivalent;if(""===o.trim()){let r=k$2(e,n);if(r<e.length){if(t(e,r,e.length).spaceEquivalent+1>l+(p?d[1].length+d[2].length+1:d[1].length+1))break}break}if(a<=h){let e=o.slice(i.charCount).match(f);if(e&&(p?e[2]===g:e[1]===v)&&a<=h)break}r=k$2(e,n)}}L=Y$(e,S,E,i,L,n,l,s,d,p,R,r,o).newCurrentPos,Oe=!1;continue}if(!c&&!m)break;{let t=T(),i=0===t.length;if(i&&TZ(S,y,Oe,K))break;let s=t.some(e=>e.type===O$1.codeBlock||e.type===O$1.paragraph||e.type===O$1.blockQuote||e.type===O$1.orderedList||e.type===O$1.unorderedList||e.type===O$1.heading),c=i&&1===S.length?w:_;if(!(s?l>=c:l>c))break;{let t=V$(e,L,n,a,c,_,T(),Oe,r,o,void 0);if(t.processed){Oe=t.wasBlank,L=t.newPos;continue}}}}else if(l===h){if(!p&&d&&IZ(d,d[1]))break;let t=p?d[3]:d[2];t=t.trimStart(),L=Y$(e,S,E,t,L,n,h,s,d,p,R,r,o).newCurrentPos,Oe=!1}}else{if(!(l>h))break;{let t=T();if(g$(c)){if(k(l+1,P(),k9(t))){let e=M(L,t);if(e){L=e.endPos,Oe=!1;continue}}if(!(l-h>3))break;{let i=t.length>0?t[t.length-1]:null;if(i&&(i.type===O$1.paragraph||i.type===O$1.text)){K$(c,t,r,o),Oe=!1,L=k$2(e,n);continue}}}else{let e=M(L,t);if(e){L=e.endPos,Oe=!1;continue}}let i=_;if(!(k9(t)?l>=i-1:l>i-1))break;{let t=V$(e,L,n,a,i-1,_,T(),Oe,r,o,void 0);if(t.processed){Oe=t.wasBlank,L=t.newPos;continue}}}}}}}if(R&&S.length>1&&S[0].length>0&&S[0][0].type!==O$1.paragraph)for(var Ae=1;Ae<S.length;Ae++)if(S[Ae].length>0&&S[Ae][0].type===O$1.paragraph){for(var De=!1,Ne=0;Ne<S[0].length;Ne++){var Fe=S[0][Ne].type;if(Fe===O$1.codeBlock||Fe===O$1.heading||Fe===O$1.blockQuote||Fe===O$1.orderedList||Fe===O$1.unorderedList||Fe===O$1.htmlBlock||Fe===O$1.breakThematic){De=!0;break}}De||(S[0]=[{type:O$1.paragraph,children:S[0]}]);break}let ze=p?{type:O$1.orderedList,items:S,ordered:!0,start:m}:{type:O$1.unorderedList,items:S,ordered:!1};return r.inList=i,{...ze,endPos:L}}function aZ(e,t,n,r){if(n.inline)return null;let o=[],i=t;for(;i<e.length;){let t=I$1(e,i);if(w1(e,i,t))break;let n=e.slice(i,t).trim();if(!(-1!==n.indexOf("|")||o.length>=3&&n&&!p9(n[0])))break;o.push(n),i=k$2(e,t)}if(o.length<2)return null;let a=e=>"|"===e[0]&&"|"===e[e.length-1]?e.slice(1,-1):e,s=e=>{let t=[],n="",r=!1;for(let o=0;o<e.length;o++){let i=e[o];"\\"===i&&o+1<e.length&&"|"===e[o+1]?(n+="|",o++):"`"===i?(r=!r,n+=i):"|"!==i||r?n+=i:(t.push(n.trim()),n="")}return t.push(n.trim()),t},l=s(a(o[0]));if(!l.length)return null;let c=s(a(o[1]));if(c.length!==l.length||c.some(e=>!/^:?-+:?$/.test(e)))return null;let u=c.map(e=>{let t=":"===e[0],n=":"===e[e.length-1];return t&&n?"center":t?"left":n?"right":null});if(r.optimizeForStreaming&&2===o.length)return null;let d=e=>W$(n,!0,()=>e.map(e=>l1(e,0,e.length,n,r))),p=d(l),f=o.slice(2).map(e=>{let t=-1!==e.indexOf("|")?s(a(e)):[e.trim()],n=l.length;for(;t.length<n;)t.push("");return t.length=n,d(t)});return{type:O$1.table,header:p,cells:f,align:u,endPos:i}}G2=C6||={},G2[G2.URI=0]="URI",G2[G2.EMAIL=1]="EMAIL",G2[G2.ANGLE=2]="ANGLE";var l6=["div","p","section","article","aside","nav","header","footer","main","h1","h2","h3","h4","h5","h6","blockquote","ul","ol","li","dl","dt","dd","table","thead","tbody","tfoot","tr","td","th","form","fieldset","hr","pre","details","summary","figure","figcaption"],d6=new Set(["pre","script","style","textarea"]);function m9(e){return-1!==l6.indexOf(e.toLowerCase())}function w9(e){return d6.has(e)}function w1(e,t,n){for(var r=t;r<n;r++){let t=b$2(e,r);if(t!==C$2&&t!==l$1&&t!==V0)return!1}return!0}function W$(e,t,n){let r=e.inline;e.inline=t;try{return n()}finally{e.inline=r}}function k$(e,t,n){for(var r=t;r<n;){var o=I$1(e,r);if(w1(e,r,o))return r;r=k$2(e,o)}return n}function m$(e,t,n){return{type:O$1.htmlComment,text:p1(e),endPos:t,...n}}function v9(e,t,n,r,o,i,a,s,l){var c=p1(t);s&&(s.forceBlock||s.optimizeForStreaming)&&t&&!i&&(new RegExp("^<"+e.toLowerCase()+"(\\s[^>]*)?>$","i").test(t.trim())&&(c=""));var u=c,d=e.toLowerCase();if(new RegExp("^<"+d+"[\\s>]","i").test(u)){var p=u.indexOf(">");if(-1!==p){var f="</"+d+">",h=(u=u.slice(p+1)).indexOf(f);-1!==h&&(u=u.slice(0,h))}}else{var m="</"+d+">",g=u.indexOf(m);-1!==g&&(u=u.slice(0,g))}var v=[];if(u&&s&&!s.optimizeForStreaming){var y=l||{inline:!1,inHTML:!0,inAnchor:!1},b=u.trim(),x=F$.test(b),$=O$.test(b),_=H$.test(b);if(x||$||_)v=d9(b,{...y,inline:!1,inHTML:!0,inAnchor:y.inAnchor||"a"===d},s);else if(b){var C={...y,inline:!0,inHTML:!0,inAnchor:y.inAnchor||"a"===d};v=l1(b,0,b.length,C,s)}}return{type:O$1.htmlBlock,tag:e,attrs:r||{},rawAttrs:o,children:v,rawText:c,text:u,verbatim:!0,isClosingTag:i,canInterruptParagraph:a,endPos:n}}function h9(e){let t=O$.test(e),n=F$.test(e),r=N6.test(e);return t||n&&!r}function fZ(e,t,n,r,o,i,a,s,l,c){if(!s.inHTML&&!s.inline&&!n9(o,"\n")){let e=i,t=a.length;for(;e<t;){let t=I$1(a,e);if(w1(a,e,t))break;let n=a.slice(e,t).trim();if(n.length>0&&p9(n[0])){let t=M$(a,e,s,c);if(t){e=t.endPos;continue}let n=n1(a,e);if(n){e=n.endPos;continue}return null}e=k$2(a,t)}}let u=t,d=w9(u);var p=!d&&!K9(t),f=void 0;if(o){var h=o.indexOf(">");if(-1!==h){var m=o.slice(0,h+1);-1!==m.indexOf("\n")&&(f=m);for(var g=h,v=1;v<h;v++){var y=m[v];if(" "===y||"\t"===y||"\n"===y||">"===y){g=v;break}}n=m.slice(g,h)}}var b={...u1(n.replace(/^[\s\n\r\t]+/,""),t,e,c)},x=!1,$=!1;if(p&&r.length>0){var _="</"+u;if((P=r.indexOf(_))>=0){for(var C=P+_.length;C<r.length&&(" "===r[C]||"\t"===r[C]);)C++;if(C<r.length&&">"===r[C]){var w=r.slice(0,P);h9(w)?(r=w,$=!0):x=!0}}if(!$){var S=r.length-1;if("\n"===r[S]){for(S--;S>=0&&(" "===r[S]||"\t"===r[S]||"\r"===r[S]);)S--;S>=0&&"\n"===r[S]&&(x=!0)}}}var E=d||p&&x&&!h9(r),k=p1(r),T=k;if(E){k.length>0&&"\n"===k[0]&&(T=k=k.slice(1)),k.length>0&&"\n"===k[k.length-1]&&(T=k=k.slice(0,-1));var P;_="</"+u+">";-1!==(P=k.indexOf(_))&&(k=k.slice(0,P))}let M=k.match(/^([ \t]*)/),L=M?M[1]:"",I=new RegExp(`^${L.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`,"gm"),R=k.replace(I,""),O=F$.test(R),A=O$.test(R),D="p"===u,N=H$.test(R),F=D?O:O||A||s.inHTML&&N,z=[];if(R)if(F||N){z=d9(R,{...s,inline:!1,inHTML:!0,inAnchor:s.inAnchor||"a"===u},c)}else{let e={...s,inline:!0,inHTML:!!c.optimizeForStreaming||s.inHTML,inAnchor:s.inAnchor||"a"===u};z=l1(R,0,R.length,e,c)}var B=void 0;return E&&(B=void 0!==f?f+T:T),{type:O$1.htmlBlock,tag:E?t:e,attrs:b,rawAttrs:n,children:z,rawText:B,text:R,verbatim:E,canInterruptParagraph:!0,endPos:i}}function M$(e,t,n,r){if("<"!==e[t])return null;if(r.optimizeForStreaming&&n.inHTML)return null;if(n.inline,t+1<e.length)if("?"===e[t+1]){var o=U$(e,t);if(o&&"pi"===o.kind)return m$(o.text||"",o.endPos,{raw:!0})}else if("!"===e[t+1]){if(t+3<e.length&&"\x3c!--"===e.slice(t,t+4)){n.inline;var i=U$(e,t);if(i&&"comment"===i.kind){var a=i.text||"",s=!1;return"\x3c!--\x3e"===a?(a="",s=!0):"\x3c!---\x3e"===a?(a="-",s=!0):a.startsWith("\x3c!--")&&a.endsWith("--\x3e")&&(a=a.slice(4,-3)),n.inline,m$(a,i.endPos,{endsWithGreaterThan:s})}}var l=U$(e,t);if(l&&("declaration"===l.kind||"cdata"===l.kind))return m$(l.text||"",l.endPos,{raw:!0})}if(t+1<e.length){let n=e[t+1];if(" "===n||"\n"===n||"\t"===n||"\r"===n)return null}var c=e.indexOf(">",t+1);if(-1!==c){var u=e.slice(t+1,c),d=-1!==u.indexOf(" ")||-1!==u.indexOf("\t");if(!d&&(c$1(u,"http://")||c$1(u,"https://")))return null;if(!d&&mZ(u))return null}var p,f,h=n1(e,t);if(!h&&!n.inline){for(var m=e.length,g=I$1(e,t),v=t,y=0;v<g&&y<3&&(" "===e[v]||"\t"===e[v]);)y++,v++;if(v>=g||"<"!==e[v])return null;if(v+1<g)if(tt=i$(e,v+1)){var b=m9(nt=tt.tagName);if(!b)return null;for(var x=tt.nextPos,$=!1,_=!1,C="",w=g,S=!1;w<m&&!S;){for(var E=!1;x<w;){var k=e[x];if(_)k===C&&(_=!1,C=""),"\n"!==k&&"\r"!==k||($=!0),x++,E=!0;else if('"'===k||"'"===k)_=!0,C=k,x++,E=!0;else if("\n"===k||"\r"===k){$=!0,x++,E=!0;var T=I$1(e,x);if(T===x)break;w=T}else{if(">"===k){x++,S=!0;break}x++,E=!0}}if(S)break;if(!E&&x>=w){if((P=I$1(e,w+1))<=w)break;w=P}else{if(!(x>=w&&w<m))break;var P;if((P=I$1(e,w+1))<=w)break;w=P}}if(!$&&S)return null;x>=g&&g<m&&(x=g);var M=b?"type6":"type7",L=x,I=k$(e,k$2(e,g),m),R=e.slice(L,I),O=t+1<e.length&&"/"===e[t+1];if("type7"===M&&""===R.trim()){var A=e.slice(t,I);return(ze=I$1(A,0))<A.length&&ze++,v9(nt,je=A.slice(0,ze),I,{},void 0,O,!1,r,n)}return v9(nt,Ve=e.slice(t,I),I,{},void 0,O,"type6"===M,r,n)}return null}if(!h)return null;if(-1!==c){var D=e.slice(t+1,c);if((c$1(D,"http://")||c$1(D,"https://"))&&(-1!==D.indexOf(" ")||-1!==D.indexOf("\t")))return null}if((f=t+(h.isClosing?2:1))<e.length){var N=e[f],F=b$2(N);if((F>=97&&F<=122||F>=65&&F<=90)&&f+1<e.length&&":"===e[f+1])return null}if(h.isClosing){if(h.attrs.trim().length>0)return null;if(!n.inline){m=e.length,g=I$1(e,t);for(var z=L=h.endPos;z<g&&(" "===e[z]||"\t"===e[z]||"\r"===e[z]);)z++;if(z>=g||"<"===e[z]&&((p=n1(e,z))&&m9(p.tagLower))){I=k$(e,k$2(e,g),m);(R=e.slice(L,I)).length>0&&("\r"===R[0]&&"\n"===R[1]?R=R.slice(2):"\n"!==R[0]&&"\r"!==R[0]||(R=R.slice(1)));let t=h.tagLower||h.tagName.toLowerCase();return v9(h.tagName,R,I,u1(h.whitespaceBeforeAttrs+h.attrs,t,h.tagName,r),h.whitespaceBeforeAttrs+h.attrs,!0,!1,r,n)}}var B=e.slice(t,h.endPos);return{type:O$1.htmlSelfClosing,tag:h.tagName,attrs:{},endPos:h.endPos,isClosingTag:!0,rawText:B}}if((f=t+(h.isClosing?2:1))<e.length){var j=e[f];if(" "===j||"\t"===j||"\n"===j||"\r"===j)return null}var H=h.tagLower,V=K9(h.tagName);let U=h.tagName.length>0&&h.tagName[0]>="A"&&h.tagName[0]<="Z";if(h.isSelfClosing||V&&"a"!==H){if(h.hasNewline&&!U)return null;if(!n.inHTML&&!n.inline&&!U)return null;var W=u1(h.attrs.replace(/\/\s*$/,""),H,h.tagName,r);B=n.inline?e.slice(t,h.endPos):void 0;let o={type:O$1.htmlSelfClosing,tag:h.tagName,attrs:W,endPos:h.endPos};return void 0!==B&&(o.rawText=B),o}if(n.inline){var Y=h.attrs.replace(/\/\s*$/,""),q=h.whitespaceBeforeAttrs+Y,G={...u1(Y,H,h.tagName,r)},K=h.endPos,X=[];if(!K9(h.tagName)){var Z=w6(e,h.endPos,H);if(null!==Z){var J=e.slice(h.endPos,Z[0]);J&&(X=n.inHTML&&H$.test(J)||h9(J)?d9(J,{...n,inline:!1,inHTML:!0,inAnchor:n.inAnchor||"a"===H},r):l1(J,0,J.length,{...n,inline:!0,inHTML:!!r.optimizeForStreaming||n.inHTML,inAnchor:n.inAnchor||"a"===H},r)),K=Z[1]}}return{type:O$1.htmlBlock,tag:h.tagName,attrs:G,rawAttrs:q,children:X,verbatim:!1,endPos:K}}if(!n.inline){m=e.length,g=I$1(e,t);for(var Q=h.tagLower,ee=w9(Q),te=!ee&&m9(h.tagName),ne=!1,re=t;re<h.endPos;){if(">"===e[re]){ne=!0;break}re++}for(z=h.endPos;z<g&&(" "===e[z]||"\t"===e[z]);)z++;var oe=z>=g||"\n"===e[z]||"\r"===e[z]||te&&z<g||!ne;if(ee&&ne&&!h.isClosing){var{tagName:ie,endPos:ae,attrs:se}=h,le=ae;"\n"===e[le]&&le++;for(var ce=le,ue=le,de=1,pe=Q.length+1;de>0;){var fe=e.indexOf("<",le);if(-1===fe){ue=m,le=m;break}var he=-1,me=-1;if("/"===e[fe+1])me=fe;else if(fe+pe+1<=m&&(e[fe+1]===Q[0]||e[fe+1]===ie[0])){e.substring(fe+1,fe+pe).toLowerCase()!==Q||" "!==e[fe+pe]&&">"!==e[fe+pe]||(he=fe)}if(-1!==he||-1!==me)if(-1!==he&&(-1===me||he<me))le=he+pe+1,de++;else{for(var ge=me+2;ge<m;){var ve=e[ge];if(" "!==ve&&"\t"!==ve&&"\n"!==ve&&"\r"!==ve)break;ge++}if(ge+Q.length>m)break;if(e.substring(ge,ge+Q.length).toLowerCase()!==Q){le=ge;continue}for(ge+=Q.length;ge<m;){var ye=e[ge];if(" "!==ye&&"\t"!==ye&&"\n"!==ye&&"\r"!==ye)break;ge++}if(ge>=m||">"!==e[ge]){le=ge;continue}var be=I$1(e,ge+1);ue=be,le=be+1,de--}else le=fe+1}for(var xe=0;le+xe<m&&"\n"===e[le+xe];)xe++;var $e=e.slice(t,le+xe),_e=e.slice(ce,ue),Ce=le+xe;return fZ(h.tagName,h.tagName,se,_e,$e,Ce,e,n,!1,r)}if(oe||!ne){M=te?"type6":"type7",L=h.endPos,I=k$(e,k$2(e,g),m);if("type6"===M&&!h.isClosing){let t=U?h.tagName:h.tagLower||h.tagName.toLowerCase();for(var we="</"+t,Se="<"+t,Ee=L,ke=1,Te=-1;Ee<I&&ke>0;){for(var Pe=e.indexOf(Se,Ee),Me=e.indexOf(we,Ee);-1!==Pe&&Pe<I;){var Le=Pe+Se.length;if(Le>=m){Pe=-1;break}var Ie=e[Le];if(" "===Ie||"\t"===Ie||"\n"===Ie||"\r"===Ie||">"===Ie)break;Pe=e.indexOf(Se,Le)}if((-1===Pe||Pe>=I)&&(Pe=I),(-1===Me||Me>=I)&&(Me=I),Pe<Me)ke++,Ee=Pe+Se.length;else{if(!(Me<I))break;if(0===--ke){Te=Me;break}Ee=Me+we.length}}if(-1!==Te&&Te<I){for(var Re=Te+we.length;Re<m&&(" "===e[Re]||"\t"===e[Re]);)Re++;if(Re<m&&">"===e[Re]){for(var Oe=Re+1,Ae=Oe;Ae<m&&"\n"!==e[Ae];)Ae++;for(Ae<m&&Ae++;Ae<m&&(" "===e[Ae]||"\t"===e[Ae]);)Ae++;if(Ae<m&&"<"===e[Ae]&&!c$1(e.slice(Ae),we))n1(e,Ae)&&(I=Oe)}}else if(-1!==(Te=e.indexOf(we,L))){var De=e.slice(L,Te);if(U||h9(De)){for(var Ne=Te+we.length;Ne<m&&(" "===e[Ne]||"\t"===e[Ne]);)Ne++;if(Ne<m&&">"===e[Ne])I=I$1(e,Ne+1)}}}R=e.slice(L,I);var Fe=h.whitespaceBeforeAttrs+h.attrs;O=h.isClosing;let o=()=>{let e=h.tagLower||h.tagName.toLowerCase(),t=h.whitespaceBeforeAttrs+h.attrs;return{parsed:u1(t,e,h.tagName,r),raw:t}};if("type7"===M&&""===R.trim()){if(-1!==e.slice(t,h.endPos).indexOf("\n"))return null;var ze,Be=h.endPos;(ze=I$1(e,Be))<e.length&&ze++;var je=e.slice(t,ze);let i=o();return v9(h.tagName,je,I,i.parsed,i.raw,O,!1,r,n)}if((h.hasNewline||!ne)&&"type7"===M){var He=h.endPos,Ve=e.slice(t,He)+R;let i=o();return v9(h.tagName,Ve,I,i.parsed,i.raw,O,!1,r,n)}let i=h.tagLower||h.tagName.toLowerCase();var Ue={...u1(Fe,i,h.tagName,r)};if("type6"===M){var We=R,Ye=R.indexOf("</"+i);if(Ye>=0){for(z=Ye+2+h.tagName.length;z<R.length&&(" "===R[z]||"\t"===R[z]);)z++;z<R.length&&">"===R[z]&&(We=R.slice(0,Ye))}if(h9(We))return fZ(h.tagName,h.tagName,Fe,We,e.slice(t,h.endPos),I,e,n,!1,r)}var qe=R;qe.length>0&&("\r"===qe[0]&&"\n"===qe[1]?qe=qe.slice(2):"\n"!==qe[0]&&"\r"!==qe[0]||(qe=qe.slice(1)));for(var Ge=qe.split("\n"),Ke=1/0,Xe=0;Xe<Ge.length;Xe++){var Ze=Ge[Xe];if(0!==Ze.trim().length){for(y=0;y<Ze.length&&(" "===Ze[y]||"\t"===Ze[y]);)y++;y<Ke&&(Ke=y)}}if(Ke>0&&Ke<1/0){for(var Je=[],Qe=0;Qe<Ge.length;Qe++){var et=Ge[Qe];0===et.trim().length?Je.push(et):Je.push(et.slice(Ke))}qe=Je.join("\n")}return v9(h.tagName,qe,I,Ue,Fe,O,"type6"===M,r,n)}}if(n.inline)return null;var tt,nt;if(!(tt=i$(e,t+1)))return null;if(!K9(nt=tt.tagName))return null;let rt=tt.tagLower;for(var ot=tt.nextPos,it=e.length;ot<it&&j1(e[ot]);)ot++;for(var at=ot;ot<it&&">"!==e[ot];)ot++;if(ot>=it)return null;let st=e.slice(at,ot).trim(),lt=ot+1;for(;lt<it&&j1(e[lt]);)lt++;let ct="</"+rt+">",ut=e.toLowerCase().indexOf(ct,lt);if(-1!==ut&&e.slice(lt,ut).trim())return null;let dt=++ot;for(;ot<it&&j1(e[ot]);)ot++;ot<it&&"\n"===e[ot]&&ot++;let pt=u1(st,nt,nt,r);return{type:O$1.htmlSelfClosing,tag:nt,attrs:pt,endPos:dt}}function i6(e,t){if("<"!==e[t])return null;var n=e.length,r=!1,o=t+1;t+1<n&&"/"===e[t+1]&&(r=!0,o=t+2);var i=i$(e,o);if(!i)return null;var{tagName:a,tagLower:s,nextPos:l}=i;if(l<n){var c=e[l];if(">"===c||"/"===c){var u=">"===c?l+1:l+2;if("/"===c&&(l+1>=n||">"!==e[l+1]))return null;var d="/"===c,p=m9(a);return{kind:"tag",tagNameLower:s,tagName:a,isClosing:r,isSelfClosing:d,hasNewline:!1,type6Candidate:p,type7Candidate:!w9(s)&&!p,endPos:u,attrs:"",whitespaceBeforeAttrs:""}}}for(var f=l,h=!1;l<n;){var m=e[l],g=b$2(e,l);if(" "===m||"\t"===m);else{if(10!==g&&13!==g)break;h=!0}l++}for(var v=e.slice(f,l),y=l,b=0,x=!1,$=!1,_=0;y<n;){var C=e[y];g=b$2(e,y);if(1===_){if('"'===C){if(y+1<n&&'"'===e[y+1])return null;_=0}y++}else if(2===_)"'"===C&&(_=0),y++;else if('"'===C)_=1,y++;else if("'"===C)_=2,y++;else if("{"===C||"}"===C&&b>0)b+="{"===C?1:-1,y++;else{if(">"===C&&0===b){if(y>l){for(var w=y-1;w>=l;){var S=e[w];if(" "!==S&&"\t"!==S)break;w--}w>=l&&"/"===e[w]&&(x=!0,$=w<y-1)}y++;break}if("*"===C||"#"===C||"!"===C){for(var E=y+1;E<n;){var k=e[E];if("="===k||" "===k||"\t"===k||"\n"===k||"\r"===k||">"===k)break;E++}if(E<n&&"="===e[E])return null}10!==g&&13!==g||(h=!0),y++}}if(y>n||">"!==e[y-1])return null;if(1===_||2===_)return null;if(b>0)return null;if($)return null;var T=y-1;x&&T--;for(var P=e.slice(l,T),M=x,L=-1,I=!1,R="",O=!1,A=0;A<P.length;A++){m=P[A];if(I)m===R&&(I=!1,L=A,R="",O=!1);else if('"'===m||"'"===m)I=!0,R=m,O=!1;else if("="===m)O=!0;else if(-1!==L&&A===L+1){if(U9(g=m.charCodeAt(0)))return null}else{if(O&&!I&&("*"===m||"#"===m||"!"===m))return null;j1(m)&&(O=!1)}}var D=m9(a);return{kind:"tag",tagNameLower:s,tagName:a,isClosing:r,isSelfClosing:M,hasNewline:h,type6Candidate:D,type7Candidate:!w9(s)&&!D,endPos:y,attrs:P,whitespaceBeforeAttrs:v}}function U$(e,t){if(t>=e.length||"<"!==e[t])return null;var n=e.length;if(t+1>=n)return null;var r=e[t+1];if("!"===r){if(t+4<=n&&"\x3c!--"===e.slice(t,t+4)){if((o=t+4)<n&&">"===e[o])return{kind:"comment",hasNewline:!1,endPos:o+1,text:e.slice(t,o+1),raw:!0};if(o+1<n&&"-"===e[o]&&">"===e[o+1])return{kind:"comment",hasNewline:!1,endPos:o+2,text:e.slice(t,o+2),raw:!0};for(;o+2<n;){if("--\x3e"===e.slice(o,o+3))return{kind:"comment",hasNewline:!1,endPos:o+3,text:e.slice(t,o+3),raw:!0};o++}return null}if(t+9<=n&&"<![CDATA["===e.slice(t,t+9)){for(var o=t+9;o+2<n;){if("]]>"===e.slice(o,o+3))return{kind:"cdata",hasNewline:!1,endPos:o+3,text:e.slice(t,o+3),raw:!0};o++}return null}if(t+2<n&&U9(e.charCodeAt(t+2))){for(o=t+2;o<n&&">"!==e[o];)o++;return o>=n?null:{kind:"declaration",hasNewline:!1,endPos:o+1,text:e.slice(t,o+1),raw:!0}}return null}if("?"===r){for(o=t+2;o+1<n;){if("?>"===e.slice(o,o+2))return{kind:"pi",hasNewline:!1,endPos:o+2,text:e.slice(t,o+2),raw:!0};o++}return null}return i6(e,t)}function h$(e,t){if(t>=e.length)return!1;var n=e[t];return"="===n||"-"===n||"_"===n||"*"===n||"#"===n||">"===n||"`"===n||"~"===n||"["===n||n>="0"&&n<="9"}function J$(e,t){if(t>=e.length)return!1;var n=e[t];return'"'===n||"'"===n||"("===n}function c6(e,t,n){var r=e.length;if(t>=r||e[t]!==n)return null;for(var o=++t,i=!1;t<r&&e[t]!==n;){var a=e.charCodeAt(t);if(a===d$1){if(i)return null;i=!0,t++}else if(a===V0)if(t+1<r&&e.charCodeAt(t+1)===d$1){if(i)return null;i=!0,t+=2}else i=!1,t++;else i=!1,a===k1&&t+1<r&&t++,t++}return t>=r?null:{value:e.slice(o,t),endPos:t+1}}function a6(e,t){var n=e.length;if(t>=n||"("!==e[t])return null;for(var r=++t,o=1,i=!1;t<n&&o>0;){var a=e.charCodeAt(t);if(a===d$1){if(i)return null;i=!0,t++}else if(a===V0)if(t+1<n&&e.charCodeAt(t+1)===d$1){if(i)return null;i=!0,t+=2}else i=!1,t++;else i=!1,a===k1&&t+1<n?t++:a===FZ?o++:a===OZ&&o--,t++}return 0!==o?null:{value:e.slice(r,t-1),endPos:t}}function r6(e,t){for(var n=e.length,r=t;r<n;){var o=0===r||"\n"===e[r-1];if(e.charCodeAt(r)===d$1&&r>t){var i=r+1;if(i<n&&e.charCodeAt(i)===V0&&i++,i<n&&e.charCodeAt(i)===d$1){for(var a=i+1;a<n&&(" "===e[a]||"\t"===e[a]);)a++;var s=a-(r+1);if(e.charCodeAt(r+1)===V0&&s--,a<n&&e.charCodeAt(a)!==d$1&&e.charCodeAt(a)!==V0&&s<4)return r}}if(o&&c$1(e,"[^",r)){for(var l=r+2;l<n&&"]"!==e[l];)l++;if(l<n&&"]"===e[l]&&l+1<n&&":"===e[l+1])return r}r++}return n}function s6(e,t,n){let r=e.length,o=t,i=o<r&&"<"===e[o];i&&o++;let a=o,s=a;if(a>=r){if(!i)return null;s=a}else{if(n>0&&a<r&&"\n"===e[a])return null;for(;s<r&&(!i||">"!==e[s]);){if("\n"===e[s]){let t=s+1;if(t>=r)break;if(t<r&&"\n"===e[t])break;let n=t;for(;n<r&&(" "===e[n]||"\t"===e[n]);)n++;if(n<r&&J$(e,n))break;if(n<r&&"["===e[n])break;if(n<r){let t=e[n];if(h$(e,n))break;if(t>="a"&&t<="z"){let t=n+1;for(;t<r&&t<n+32&&(e[t]>="a"&&e[t]<="z"||e[t]>="A"&&e[t]<="Z"||e[t]>="0"&&e[t]<="9"||"+"===e[t]||"."===e[t]||"-"===e[t]);)t++;if(!(t<r&&":"===e[t]))break}}s=n;continue}if(!i&&(" "===e[s]||"\t"===e[s])){let t=s+1;for(;t<r&&(" "===e[t]||"\t"===e[t]);)t++;if(t<r&&J$(e,t))break;if(t<r&&"\n"===e[t]){let n=t+1;if(n<r&&"\n"===e[n])break;let o=n;for(;o<r&&(" "===e[o]||"\t"===e[o]);)o++;if(o<r&&J$(e,o))break}}s++}}if(i&&(s>=r||">"!==e[s]))return null;let l=e.slice(a,s),c=[],u=0;for(let C=0;C<=l.length;C++)if(C===l.length||"\n"===l[C]){let e=l.slice(u,C);e=e.trim(),e.length>0||0===c.length?(c.push(e),C<l.length&&c.push("\n")):C<l.length&&c.push("\n"),u=C+1}l=c.join(""),l=l.trim(),o=i?s+1:s;var d=!1;if(o<r&&"\n"===e[o]){for(var p=o+1;p<r&&(" "===e[p]||"\t"===e[p]);)p++;if(p<r){let t=e[p];if(h$(e,p)&&(d=!0),!d&&"="!==t&&"-"!==t){var f=I$1(e,p);if(f<r){for(var h=k$2(e,f);h<r&&(" "===e[h]||"\t"===e[h]);)h++;if(h<r){var m=e[h];"="!==m&&"-"!==m||(d=!0)}}}}}if(!d&&o<r&&J$(e,o))return null;let g,v=0;for(;o<r&&!d;){let t=e[o];if("\n"===t){if(v++,v>1)break;o++;var y=o;if(o=g0(e,o),o<r&&V9(e[o])&&"\n"!==e[o]){o=y-1;break}if(o<r&&(e[o],h$(e,o))){d=!0,o=y-1;break}}else{if(" "!==t&&"\t"!==t){if(V9(t))break;break}o++}}if(o<r){let t=e[o];var b="("===t?a6(e,o):'"'===t||"'"===t?c6(e,o,t):null;if(null===b&&('"'===t||"'"===t||"("===t))return null;if(b){g=b.value,o=b.endPos;for(var x=o;x<r&&(" "===e[x]||"\t"===e[x]);)x++;if(x<r&&"\n"!==e[x]&&"\r"!==e[x])return null;o=x}}if(o=g0(e,o),o<r&&"\n"!==e[o])for(var $=o;$<r&&"\n"!==e[$];){if(" "!==e[$]&&"\t"!==e[$])return null;$++}if(void 0===g&&o<r&&"\n"!==e[o])for(var _=o;_<r&&"\n"!==e[_];){if(" "!==e[_]&&"\t"!==e[_])return null;_++}return{endPos:o<r&&"\n"===e[o]?o+1:o,target:l,title:g}}function o6(e,t){let n=r6(e,t),r=n<e.length&&"\n"===e[n]&&"\n"===e[n+1],o=n;var i=[];let a=t,s=0,l=!1;for(;a<o;){let t=I$1(e,a);if(t>o&&(t=o),0===s){let n=t;for(;n>a&&(" "===e[n-1]||"\t"===e[n-1]);)n--;let r=e.slice(a,n);i.push(r),l=0===r.length}else{let n=0,r=a;for(;r<t&&r<a+4&&" "===e[r];)n++,r++;let o=!1;for(let i=a;i<t;i++)if(" "!==e[i]&&"\t"!==e[i]&&"\r"!==e[i]){o=!0;break}let s=!o;n>=4&&l||4!==n||l?i.push(e.slice(a,t)):i.push(e.slice(a+4,t)),l=s}if(t<o){let n=b$2(e,t);n===V0||n===d$1?(i.push("\n"),a=k$2(e,t)):a=o}else a=o;s++}let c=i.join("");r&&(c=c.replace(/\n$/,""));for(var u=c.length;u>0;){var d=c[u-1];if("\n"!==d&&" "!==d)break;u--}return u<c.length&&(c=c.slice(0,u)),{endPos:n,target:c,title:void 0}}function B9(e,n,r,o,i){if("["!==e[n])return null;var a=n+1<e.length&&"^"===e[n+1];if(i?!a:a)return null;for(var s=n;s>0&&"\n"!==e[s-1];)s--;if(t(e,s,n).spaceEquivalent>=4||r.inline)return null;var l=n+(i?2:1),c=e.length,u=R6(e,l,c,"]");if(-1===u)return null;var d=e.slice(l,u);if(d.length>999)return null;for(var p=!1,f=!1,h=!1,m=0;m<d.length;m++){var g=d[m];if("\\"===g&&m+1<d.length)m++;else{var v=b$2(g);v===g1||v===H9?f=!0:v===d$1||v===V0?h=!0:v!==C$2&&v!==l$1&&(p=!0)}}if(!p||f)return null;var y=u+1;if(h){var b=b$2(e,l),x=b$2(e,u-1);if(b===d$1||b===V0||x===d$1||x===V0||y>=c||":"!==e[y])return null}else if((y>=c||":"!==e[y])&&((y=g0(e,y))<c&&b$2(e,y)===d$1&&(y=g0(e,y+1)),y>=c||":"!==e[y]))return null;y++;for(var $=0;y<c;){var _=b$2(e,y);if(_===d$1){if(++$>1)break;y=g0(e,y+1)}else{if(_!==C$2&&_!==l$1)break;y++}}let C=i?o6(e,y):s6(e,y,$);if(!C)return null;let w=hZ(d),S=r.refs||{},E=i?`^${w}`:w;return S[E]||(S[E]={target:Q$(C.target.trim()),title:C.title?Q$(C.title):void 0},r.refs=S),{type:i?O$1.footnote:O$1.ref,endPos:C.endPos}}function rZ(e,t,n){for(var r=[],o=0;o<t.length;){var i=t[o];if(!i||"*"!==i.type&&"_"!==i.type&&"~"!==i.type&&"="!==i.type)o++;else if(i.canClose&&i.active){for(var a=6*("*"===i.type?0:"_"===i.type?1:"~"===i.type?2:3)+i.length%3*2+(i.canOpen?1:0),s=void 0!==r[a]?r[a]:-1,l=-1,c=i.type,u=i.inAnchor,d=i.canOpen,p=i.length,f=p%3,h=o-1;h>s;h--){var m=t[h];if(m&&m.active&&m.type===c&&m.canOpen&&m.inAnchor===u){var g=m.length;if(!d&&!m.canClose||0===f||(g+p)%3!=0){l=h;break}}}if(l>=0){var v=t[l],y=(g=v.length)>=2&&p>=2,b=y?2:1;if(b>g||b>p){o++;continue}var x=v.nodeIndex,$=i.nodeIndex,_=x+1,C=$,w=e.slice(_,C);if(w.length>0){var S=C-_;e.splice(_,S);for(var E=0;E<t.length;E++)t[E].nodeIndex>_&&(t[E].nodeIndex-=S);$>_&&($-=S)}var k="~"===v.type?"del":"="===v.type?"mark":y?"strong":"em",T={type:O$1.textFormatted,tag:k,children:w},P=e[x];if(!P||!P.text){v.active=i.active=!1;continue}var M=P.text.length<=b;if(M){e.splice(x,1);for(E=0;E<t.length;E++)t[E].nodeIndex>x&&t[E].nodeIndex--;$>x&&$--}else P.text=P.text.slice(b);var L=e[$];if(!L||!L.text){v.active=i.active=!1;continue}var I=L.text.length<=b;if(I){e.splice($,1);for(E=0;E<t.length;E++)t[E].nodeIndex>$&&t[E].nodeIndex--}else L.text=L.text.slice(b);var R=M?x<$?$-1:x:x+1;(R<0||R>e.length)&&(R=R<0?0:e.length),e.splice(R,0,T);for(E=0;E<t.length;E++)t[E].nodeIndex>=R&&t[E].nodeIndex++;for(E=l+1;E<o;E++)t[E].active=!1;M?v.active=!1:(v.length-=b,0===v.length&&(v.active=!1)),I?(i.active=!1,o++):(i.length-=b,0===i.length&&(i.active=!1,o++))}else r[a]=o-1,i.canOpen||(i.active=!1),o++}else o++}var O=0;for(h=0;h<t.length;h++)t[h].active&&(t[O++]=t[h]);t.length=O}function i9(e,n,r){var o=[],i=0,a=-3;if(n.inline)return l1(e,0,e.length,n,r);if(0===i&&e.startsWith("---")){var s=h6(e,i);s&&(o.push(s),i=s.endPos)}for(;i<e.length;){for(;i<e.length&&"\n"===e[i];)i++;if(i>=e.length)break;a=-3;let s=e[i],c=l9(e,i,n,r);if(c){if(c.type===O$1.codeBlock){var l="`"===s||"~"===s;if(!l&&(" "===s||"\t"===s)){let n=t(e,i,I$1(e,i));l=n.spaceEquivalent<=3&&i+n.charCount<e.length&&("`"===e[i+n.charCount]||"~"===e[i+n.charCount])}}if(c.type===O$1.htmlComment){o.push(c);let t=i;i=c.endPos;let n=I$1(e,t);if(i<n){let t=e.slice(i,n);t.trim().length>0&&o.push({type:O$1.text,text:t}),(i=n)<e.length&&"\n"===e[i]&&i++}continue}if(c.type!==O$1.htmlBlock&&c.type!==O$1.htmlSelfClosing){o.push(c),i=c.endPos;continue}if(c.type!==O$1.htmlSelfClosing||!0!==c.isClosingTag||n.inline||n.inHTML){o.push(c),i=c.endPos;continue}}let u=-3!==a?a:i;if(-3===a){if(j1(s)){let n=t(e,i,I$1(e,i)),r=i+n.charCount;u=n.spaceEquivalent<=3&&r<e.length&&"["===e[r]?r:-1}else u="["===s?i:-1;a=u}if(u>=0&&u+1<e.length&&"^"===e[u+1]&&(u=-1),u>=0){let t=B9(e,u,n,r,!1);if(t){o.push(t),i=t.endPos;continue}let a=S6(e,u,0===i);if(a.shouldSkip){i=a.newPos;continue}}let d=pZ(e,i,n,r);if(d){o.push(d),i=d.endPos;continue}let p=i;if(j1(e[p])){p=i+t(e,i,I$1(e,i)).charCount}if(p<e.length&&"["===e[p]&&p+1<e.length&&"^"===e[p+1]){let t=B9(e,p,n,r,!0);if(t){i=t.endPos;continue}}let f=a$(e,i,n,r);f?(o.push(f),i=f.endPos):i++}let c=n.refs||{},u={};for(let t in c)u[t]=c[t];return e9(u)?[{type:O$1.refCollection,refs:u},...o]:o}function v$(e,n,r){var o=0,i=!0;let a=e.length;for(;o<a;){for(var s=0;o<a&&b$2(e,o)===d$1;)s++,o++;if(o>=a)break;s>0&&(i=!0);let x=b$2(e,o);if(x===t0||x===e1){var l=$Z(e,o,{},r);if(l){o=l.endPos,i=!0;continue}}for(var c=o,u=0;c<a&&u<4;){let t=b$2(e,c);if(t===C$2)u++,c++;else{if(t!==l$1)break;u+=4-u%4,c++}}if(u<4&&c<a&&b$2(e,c)===g1&&i){if(c+1<a&&b$2(e,c+1)===D9){i=!1,o=(p=I$1(e,o))>=a?a:k$2(e,p);continue}var d=B9(e,c,{inline:!1,refs:n},r,!1);if(d){o=d.endPos,i=!0;continue}var p=I$1(e,o),f=e.indexOf(":",c+1);if(-1===f||f>=p){var h=t(e,o,p);!w1(e,o,p)&&x!==T9&&x!==C1&&x!==D1&&x!==d1&&h.spaceEquivalent<4&&(i=!1)}o=p>=a?a:k$2(e,p)}else{if(x===C1&&i){for(var m=o,g=[];m<a;){p=I$1(e,m);for(var v=m;v<p;){let t=b$2(e,v);if(t!==C$2&&t!==l$1)break;v++}if(v>=p||b$2(e,v)!==C1)break;var y=v+1;y<p&&(b$2(e,y)===C$2||b$2(e,y)===l$1)&&y++,g.push(e.slice(y,p)),m=k$2(e,p)}if(g.length){v$(g.join("\n"),n,r),o=m,i=!0;continue}}if((p=I$1(e,o))>=a)o=a;else{var b=w1(e,o,p);h=t(e,o,p);o=k$2(e,p),i=x===T9||x===C1||x===D1||x===d1||b||h.spaceEquivalent>=4}}}}var t6=/^\n+/,ZZ=typeof reactExports.createContext<"u"?reactExports.createContext(void 0):void 0;function e6(e){let t=!1;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>127||n===k1||n===t0){t=!0;break}}if(!t)return e;let n="";for(let r=0;r<e.length;r++){let t=e[r];if("%"===t&&r+2<e.length&&/[0-9A-Fa-f]/.test(e[r+1])&&/[0-9A-Fa-f]/.test(e[r+2]))n+=e[r]+e[r+1]+e[r+2],r+=2;else if(t.charCodeAt(0)===k1)n+="%5C";else if(t.charCodeAt(0)===t0)n+="%60";else{n+=t.charCodeAt(0)>127?encodeURIComponent(t):t}}return n}function $5(e,t,n,r,o,i,a,s){switch(e.type){case O$1.blockQuote:{let o={key:n.key};return e.alert&&(o.className="markdown-alert-"+i(e.alert.toLowerCase(),J1),e.children.unshift({attrs:{},children:[{type:O$1.text,text:e.alert}],verbatim:!0,type:O$1.htmlBlock,tag:"header"})),r("blockquote",o,t(e.children,n))}case O$1.breakLine:return r("br",{key:n.key});case O$1.breakThematic:return r("hr",{key:n.key});case O$1.frontmatter:return s.preserveFrontmatter?r("pre",{key:n.key},e.text):null;case O$1.codeBlock:let l=e.lang?M9(e.lang):"";return r("pre",{key:n.key},r("code",{...s9(e.attrs||{}),className:l?`language-${l} lang-${l}`:""},e.text));case O$1.codeInline:return r("code",{key:n.key},e.text);case O$1.footnoteReference:return r("a",{key:n.key,href:o(e.target,"a","href")},r("sup",{key:n.key},e.text));case O$1.gfmTask:return r("input",{checked:e.completed,key:n.key,readOnly:!0,type:"checkbox"});case O$1.heading:return r(`h${e.level}`,{id:e.id,key:n.key},t(e.children,n));case O$1.htmlBlock:{let l=e;if(s.tagfilter&&$$(l.tag)){let e;if("rawText"in l&&"string"==typeof l.rawText)e=l.rawText;else{let t="";if(l.attrs)for(let[e,n]of Object.entries(l.attrs))!0===n?t+=` ${e}`:null!=n&&!1!==n&&(t+=` ${e}="${String(n)}"`);e=`<${l.tag}${t}>`}return r("span",{key:n.key},e)}if(l.rawText&&l.verbatim){let c=function(e){var t,n;if(e.type===O$1.htmlSelfClosing&&"isClosingTag"in e&&e.isClosingTag)return[];if(e.type===O$1.paragraph){let t=e.children;return t?t.flatMap(c):[]}return e.type===O$1.text?(null==(t=e.text)?void 0:t.trim())?[e]:[]:e.type===O$1.htmlBlock&&e.children?[{...e,children:null==(n=e.children)?void 0:n.flatMap(c)}]:[e]},u=l.tag.toLowerCase(),d=w9(u),p=/<[a-z][^>]{0,100}>/i.test(l.rawText),f=/<\/?pre\b/i.test(l.rawText);if(d&&!p){let t=l.rawText.replace(new RegExp("\\s*</"+u+">\\s*$","i"),"");return s.tagfilter&&(t=Z$(t)),r(e.tag,{key:n.key,...e.attrs},t)}if(f){let t=s.tagfilter?Z$(l.rawText):l.rawText;return r(e.tag,{key:n.key,...e.attrs,dangerouslySetInnerHTML:{__html:t}})}let h={slugify:e=>i(e,J1),sanitizer:o,tagfilter:!0},m=l.rawText.replace(/>\s+</g,"><").replace(/\n+/g," ").trim();if(new RegExp(`^<${l.tag}(\\s[^>]*)?>(\\s*</${l.tag}>)?$`,"i").test(m))return r(e.tag,{key:n.key,...e.attrs});let g=i9(m,{inline:!1,refs:a,inHTML:!1},h),v="</"+l.tag.toLowerCase()+">",y=new RegExp(`^<${l.tag}(\\s|>)`,"i").test(m),b=m.toLowerCase().trimEnd().endsWith(v),x=y&&b,$=!l.attrs||0===Object.keys(l.attrs).length,_=l.children&&l.children.length>0;return x&&$?t(g.flatMap(c),n):r(e.tag,{key:n.key,...e.attrs},t(x&&_?l.children:g.flatMap(c),n))}return r(e.tag,{key:n.key,...e.attrs},e.children?t(e.children,n):"")}case O$1.htmlSelfClosing:{let t=e;if(s.tagfilter&&$$(t.tag)){let e;if("rawText"in t&&"string"==typeof t.rawText)e=t.rawText;else{let n="";if(t.attrs)for(let[e,r]of Object.entries(t.attrs))!0===r?n+=` ${e}`:null!=r&&!1!==r&&(n+=` ${e}="${String(r)}"`);e=`<${t.tag}${n} />`}return r("span",{key:n.key},e)}return r(e.tag,{key:n.key,...e.attrs})}case O$1.image:return r("img",{key:n.key,alt:e.alt&&e.alt.length>0?e.alt:void 0,title:e.title||void 0,src:o(e.target,"img","src")});case O$1.link:{let o={key:n.key};return null!=e.target&&(o.href=e6(e.target)),e.title&&(o.title=e.title),r("a",o,t(e.children,n))}case O$1.table:{let o=e;return r("table",{key:n.key},r("thead",null,r("tr",null,o.header.map(function(e,i){return r("th",{key:i,style:null==o.align[i]?{}:{textAlign:o.align[i]}},t(e,n))}))),r("tbody",null,o.cells.map(function(e,i){return r("tr",{key:i},e.map(function(e,i){return r("td",{key:i,style:null==o.align[i]?{}:{textAlign:o.align[i]}},t(e,n))}))})))}case O$1.text:return e.text;case O$1.textFormatted:return r(e.tag,{key:n.key},t(e.children,n));case O$1.orderedList:case O$1.unorderedList:{let o=e.type===O$1.orderedList?"ol":"ul";return r(o,{key:n.key,start:e.type===O$1.orderedList?e.start:void 0},e.items.map(function(e,o){return r("li",{key:o},t(e,n))}))}case O$1.paragraph:return r("p",{key:n.key},t(e.children,n));case O$1.ref:default:return null}}var Z5=(e,t,n,r,o,i)=>{let a=(a,s,l)=>{let c=()=>$5(a,s,l,t,n,r,o,i);return e?e(c,a,s,l):c()},s=(e,t={})=>{let n=(t.renderDepth||0)+1;if(n>2500)return(e=>e.map(e=>"text"in e?e.text:""))(e);t.renderDepth=n;let r=t.key,o=[],i=!1;for(let l=0;l<e.length;l++){t.key=l;let n=a(e[l],s,t),r="string"==typeof n;if(r&&i)o[o.length-1]+=n;else if(null!==n)if(Array.isArray(n))for(let e=0;e<n.length;e++)o.push(n[e]);else o.push(n);i=r}return t.key=r,t.renderDepth=n-1,o};return s},G5=(...e)=>e.filter(Boolean).join(" "),GZ=(e,t,n)=>{let r=e,o=t.split("."),i=0;for(;i<o.length&&(r=null==r?void 0:r[o[i]],void 0!==r);)i++;return r||n},Y5=(e,t)=>{let n=GZ(t,e,void 0);return n?"function"==typeof n||"object"==typeof n&&"render"in n?n:GZ(t,`${e}.component`,e):e};function J5(e,t){let n={...t||{}};n.overrides=n.overrides||{};let r=n.slugify||J1,o=n.sanitizer||s1,i=n.createElement||reactExports.createElement,a=e=>A$(e,{...n,wrapper:null});function s(e,t,...r){let o=GZ(n.overrides,`${e}.props`,{}),s=s9(t||{});if(a)for(let[n,i]of Object.entries(s))"string"==typeof i&&i.length>0&&"<"===i[0]&&(gZ.test(i)||CZ.test(i)||n1(i,0))&&(s[n]=a(i.trim()));return i(Y5(e,n.overrides),{...s,...o,className:G5(null==s?void 0:s.className,o.className)||void 0},...r)}let l=[];for(let g=0;g<e.length;g++){let t=e[g];if(t.type===O$1.htmlBlock&&"rawText"in t&&t.rawText&&/<\/?pre\b/i.test(t.rawText)&&g+1<e.length&&e[g+1].type===O$1.paragraph&&"removedClosingTags"in e[g+1]&&e[g+1].removedClosingTags){let n=function(e){let t="";for(let r of e){let e=r.type;if(e===O$1.text)t+=r.text;else if(e===O$1.htmlSelfClosing&&"rawText"in r&&r.rawText)t+=r.rawText;else if(e===O$1.textFormatted){let e=r,o="em"===e.tag?"_":"strong"===e.tag?"**":"";t+=o+n(e.children)+o}else"children"in r&&r.children&&(t+=n(r.children))}return t},r=t,o=e[g+1],i=n(o.children);o.removedClosingTags&&(i+=o.removedClosingTags.filter(e=>e.type===O$1.htmlSelfClosing&&"rawText"in e&&e.rawText&&-1===e.rawText.indexOf(`</${r.tag}>`)).map(e=>e.type===O$1.htmlSelfClosing&&"rawText"in e&&e.rawText||"").join("")),r.rawText=(r.rawText||"")+"\n"+i,r.text=r.rawText,g++}l.push(t)}e=l;let c={...n,slugify:e=>r(e,J1),sanitizer:o,tagfilter:!1!==n.tagfilter},u=e[0]&&e[0].type===O$1.refCollection?e[0].refs:{},d=Z5(n.renderRule,s,o,r,u,n),p=d(e,{inline:n.forceInline,refs:u}),f=[];for(let g in u)g.charCodeAt(0)===D9&&f.push({identifier:g,footnote:u[g].target});if(f.length&&p.push(s("footer",{key:"footer"},f.map(function(e){let t=e.identifier.charCodeAt(0)===D9?e.identifier.slice(1):e.identifier,n=i9(e.footnote,{inline:!0,refs:u},c);return s("div",{id:r(t,J1),key:e.identifier},t+": ",d(n,{inline:!0,refs:u}))}))),null===n.wrapper)return p;let h,m=n.wrapper||(n.forceInline?"span":"div");return p.length>1||n.forceWrapper?(h=p,i(m,{key:"outer",...n.wrapperProps},h)):1===p.length?p[0]:null}function A$(e="",t={}){let n={...t||{}};n.overrides=n.overrides||{};let r=n.slugify||J1,o=n.sanitizer||s1;let i={};return function(e){let t=n.forceInline||!n.forceBlock&&!T$.test(e),a={...n,slugify:e=>r(e,J1),sanitizer:o,tagfilter:!1!==n.tagfilter};t||v$(e,i,a);let s=e;if(!t){let e=s.length;for(;e>0&&("\n"===s[e-1]||"\r"===s[e-1]);)e--;s=s.slice(0,e),s=`${s.replace(t6,"")}\n\n`}if(n.optimizeForStreaming){let e=s.lastIndexOf("<");-1!==e&&-1===s.slice(e).indexOf(">")&&(s=s.slice(0,e))}return J5(i9(t?e:s,{inline:t,refs:i},a),{...a,forceInline:t})}(e)}var oZ=({children:e,options:t,...n})=>{if(!(typeof reactExports.useContext<"u")){return A$(null==e?"":e,{...t,overrides:{...null==t?void 0:t.overrides},wrapperProps:{...null==t?void 0:t.wrapperProps,...n}})}let r=reactExports.useContext(ZZ),o=reactExports.useMemo(()=>({...r,...t,overrides:{...null==r?void 0:r.overrides,...null==t?void 0:t.overrides},wrapperProps:{...null==r?void 0:r.wrapperProps,...null==t?void 0:t.wrapperProps,...n}}),[r,t,n]),i=null==e?"":e;return reactExports.useMemo(()=>A$(i,o),[i,o])},X5=oZ,e$1=function(){return e$1=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},e$1.apply(this,arguments)};function o$1(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"==typeof SuppressedError&&SuppressedError;var n$1=function(e){return factory$1(Box$1,e$1({},e))},f$1=function(e){return factory$1(Typography,e$1({},e))},b$1=function(e){var t=e.children,n=void 0===t?"":t,r=e.style,o=o$1(e,["children","style"]);return factory$1("pre",e$1({style:e$1({borderRadius:"0.5rem",padding:"0.5rem 0.75rem",overflow:"auto"},r)},o,{children:n}))},g$1=function(e){var t=e.children,n=void 0===t?"":t,r=e.language,o=void 0===r?"tsx":r,i=e.Highlight,a=e.themes,s=e.theme,l=e.hideLineNumbers;return factory$1(i,{code:n,language:o,theme:s||a.vsDark,children:function(t){var n=t.style,r=t.tokens,o=t.getLineProps,i=t.getTokenProps;return factory$1("pre",{style:e$1(e$1({borderRadius:"0.5rem",padding:"0.5rem 0.75rem",overflow:"auto"},n),e.styles),children:r.map(function(e,t){return factory$1("div",e$1({},o({line:e}),{children:[!l&&factory$1("span",{children:[t+1," "]}),e.map(function(e,t){return factory$1("span",e$1({},i({token:e})),t)})]}),t)})})}})},y$1=function(e){var t=e.children,n=e.Highlight,r=e.themes,o=e.prismTheme,i=e.styles,a=e.hideLineNumbers;if(t&&t.props&&t.props.className&&t.props.className.startsWith("lang-")){var s=t.props.children,l=t.props.className?t.props.className.replace("lang-",""):"tsx";if("enableMermaid"in e&&e.enableMermaid&&"mermaid"===l){if(e.enableMermaid&&"DiagramComponent"in e&&e.DiagramComponent)return factory$1(e.DiagramComponent,{enableMermaid:!0,mermaidConfig:e.mermaidConfig,children:s});console.error("Make sure you've passed the Diagram component to the MuiMarkdown properly, you can import it from 'mui-markdown/Diagram'.")}return n&&r?factory$1(g$1,{Highlight:n,themes:r,language:l,theme:o,styles:i,hideLineNumbers:a,children:s}):factory$1(b$1,{style:i,children:s})}return factory$1(n$1,{component:"pre",sx:{whiteSpace:"pre-wrap"},children:t})},k$1=function(e){return factory$1(TableCell,e$1({},e,{sx:e$1({whiteSpace:"nowrap"},e.sx)}))},x$1=function(e){return factory$1(Table,e$1({},e))},w$1={a:function(e){return factory$1(Link$1,e$1({},e))},blockquote:function(e){var t=e.children;return factory$1(n$1,{component:"blockquote",dir:"auto",sx:{borderInlineStart:"3px solid",paddingInlineStart:"1.5rem",borderColor:"text.secondary",m:"0.25rem 0"},children:t})},code:function(e){var t=e.children,n=e.style,r=o$1(e,["children","style"]);return factory$1("code",e$1({style:e$1({backgroundColor:"rgba(126, 125, 124, 0.1)",borderRadius:"0.25rem",padding:"0.25rem 0.5rem"},n)},r,{children:t}))},h1:function(e){var t=e.children,n=e.component,r=void 0===n?"h1":n,o=e.variant,i=void 0===o?"h1":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},h2:function(e){var t=e.children,n=e.component,r=void 0===n?"h2":n,o=e.variant,i=void 0===o?"h2":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},h3:function(e){var t=e.children,n=e.component,r=void 0===n?"h3":n,o=e.variant,i=void 0===o?"h3":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},h4:function(e){var t=e.children,n=e.component,r=void 0===n?"h4":n,o=e.variant,i=void 0===o?"h4":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},h5:function(e){var t=e.children,n=e.component,r=void 0===n?"h5":n,o=e.variant,i=void 0===o?"h5":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},h6:function(e){var t=e.children,n=e.component,r=void 0===n?"h6":n,o=e.variant,i=void 0===o?"h6":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},hr:function(e){return factory$1(Divider,e$1({},e))},ol:function(e){var t=e.children,n=e.component,r=void 0===n?"ol":n,o=o$1(e,["children","component"]);return factory$1(f$1,e$1({component:r},o,{children:t}))},p:function(e){var t=e.children,n=e.component,r=void 0===n?"p":n,o=e.variant,i=void 0===o?"body1":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},pre:y$1,span:function(e){var t=e.children,n=e.component,r=void 0===n?"span":n,o=e.variant,i=void 0===o?"body1":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},table:function(e){var t=e.children,n=e.sx,r=o$1(e,["children","sx"]);return factory$1(n$1,{sx:n?e$1({overflow:"auto"},n):function(e){var t,n=e.palette;return e$1({overflow:"auto"},{"::-webkit-scrollbar":{width:"8px",height:"6px"},"::-webkit-scrollbar-track":{background:"dark"===(t=n).mode?t.background.default:t.background.paper,borderRadius:"8px",overflow:"hidden"},"::-webkit-scrollbar-thumb":{background:darken$1(t.background.default,.05),borderRadius:"8px"}})},children:factory$1(n$1,{sx:{width:"100%",display:"table",tableLayout:"fixed"},children:factory$1(x$1,e$1({},r,{children:t}))})})},tbody:function(e){return factory$1(TableBody,e$1({},e))},td:k$1,tfoot:function(e){return factory$1(TableFooter,e$1({},e))},th:k$1,thead:function(e){return factory$1(TableHead,e$1({},e))},tr:function(e){return factory$1(TableRow,e$1({},e))},ul:function(e){var t=e.children,n=e.component,r=void 0===n?"ul":n,o=o$1(e,["children","component"]);return factory$1(f$1,e$1({component:r},o,{children:t}))}},C$1=function(e){void 0===e&&(e={});var t=e.overrides,n=o$1(e,["overrides"]);return e$1(e$1(e$1({},w$1),t),{pre:{component:y$1,props:n}})},M$1=function(e){var t,n=e.children,r=void 0===n?"":n,o=function(e){var t=e.options,n=e.overrides,r=C$1(e);return t?t.overrides?t:e$1(e$1({},t),{overrides:r}):{overrides:n||r}}(e);return"options"in(t=e)&&"overrides"in t&&console.error("Cannot set both 'options' and 'overrides' in the MuiMarkdown component props."),factory$1(X5,{options:o,children:r})};e$1({},w$1);const 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={},shared={},flatTokensSymbol$1=shared.flatTokensSymbol=Symbol("flat-tokens"),htmlFlowSymbol$1=shared.htmlFlowSymbol=Symbol("html-flow"),newLineRe$1=shared.newLineRe=/\r\n?|\n/g;shared.nextLinesRe=/[\r\n][\s\S]*$/;const{flatTokensSymbol:flatTokensSymbol,htmlFlowSymbol:htmlFlowSymbol}=shared;function inHtmlFlow(e){return Boolean(e[htmlFlowSymbol])}function isHtmlFlowComment(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}function addRangeToSet(e,t,n){for(let r=t;r<=n;r++)e.add(r)}function filterByPredicate(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 filterByTypes(e,t,n){const r=e=>t.includes(e.type)&&(n||!inHtmlFlow(e)),o=e[flatTokensSymbol];return o?o.filter(r):filterByPredicate(e,r)}function getBlockQuotePrefixText(e,t,n=1){return filterByTypes(e,["blockQuotePrefix","linePrefix"]).filter(e=>e.startLine===t).map(e=>e.text).join("").trimEnd().concat("\n").repeat(n)}function getDescendantsByType(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}function getHeadingLevel(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}function getHeadingStyle(e){if("setextHeading"===e.type)return"setext";return 1===e.children.filter(e=>"atxHeadingSequence"===e.type).length?"atx":"atx_closed"}function getHeadingText(e){return getDescendantsByType(e,[["atxHeadingText","setextHeadingText"]]).flatMap(e=>e.children.filter(e=>"htmlText"!==e.type)).map(e=>e.text).join("").replace(/[\r\n]+/g," ")||""}function getHtmlTagInfo(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}function getParentOfType(e,t){let n=e;for(;(n=n.parent)&&!t.includes(n.type););return n}const docfxTabSyntaxRe=/^#tab\//;function isDocfxTab(e){if("atxHeading"===(null==e?void 0:e.type)){const t=getDescendantsByType(e,["atxHeadingText"]);if(1===t.length&&1===t[0].children.length&&"link"===t[0].children[0].type){const e=filterByTypes(t[0].children[0].children,["resourceDestinationString"]);return 1===e.length&&docfxTabSyntaxRe.test(e[0].text)}}return!1}const nonContentTokens=new Set(["blockQuoteMarker","blockQuotePrefix","blockQuotePrefixWhitespace","lineEnding","lineEndingBlank","linePrefix","listItemIndent","undefinedReference","undefinedReferenceCollapsed","undefinedReferenceFull","undefinedReferenceShortcut"]);var micromarkHelpers={addRangeToSet:addRangeToSet,filterByPredicate:filterByPredicate,filterByTypes:filterByTypes,getBlockQuotePrefixText:getBlockQuotePrefixText,getDescendantsByType:getDescendantsByType,getHeadingLevel:getHeadingLevel,getHeadingStyle:getHeadingStyle,getHeadingText:getHeadingText,getHtmlTagInfo:getHtmlTagInfo,getParentOfType:getParentOfType,inHtmlFlow:inHtmlFlow,isDocfxTab:isDocfxTab,isHtmlFlowComment:isHtmlFlowComment,nonContentTokens:nonContentTokens};const micromark=micromarkHelpers,{newLineRe:newLineRe,nextLinesRe:nextLinesRe}=shared;var newLineRe_1=helpers.newLineRe=newLineRe,nextLinesRe_1=helpers.nextLinesRe=nextLinesRe,frontMatterRe=helpers.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;const inlineCommentStartRe=/(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi;var inlineCommentStartRe_1=helpers.inlineCommentStartRe=inlineCommentStartRe,endOfLineHtmlEntityRe=helpers.endOfLineHtmlEntityRe=/&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/,endOfLineGemojiCodeRe=helpers.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 allPunctuation=".,;:!?。,;:!?";var allPunctuation_1=helpers.allPunctuation=allPunctuation,allPunctuationNoQuestion=helpers.allPunctuationNoQuestion=allPunctuation.replace(/[??]/gu,"");function isNumber(e){return"number"==typeof e}var isNumber_1=helpers.isNumber=isNumber;function isString(e){return"string"==typeof e}var isString_1=helpers.isString=isString;function isEmptyString(e){return 0===e.length}var isEmptyString_1=helpers.isEmptyString=isEmptyString;function isObject(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}var isObject_1=helpers.isObject=isObject;function isUrl(e){return!!e&&Object.getPrototypeOf(e)===URL.prototype}var isUrl_1=helpers.isUrl=isUrl;function cloneIfArray(e){return Array.isArray(e)?[...e]:e}var cloneIfArray_1=helpers.cloneIfArray=cloneIfArray;function cloneIfUrl(e){return isUrl(e)?new URL(e):e}var cloneIfUrl_1=helpers.cloneIfUrl=cloneIfUrl,getHtmlAttributeRe=helpers.getHtmlAttributeRe=function(e){return new RegExp(`\\s${e}\\s*=\\s*['"]?([^'"\\s>]*)`,"iu")};function isBlankLine(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()}var isBlankLine_1=helpers.isBlankLine=isBlankLine;const htmlCommentBegin="\x3c!--",htmlCommentEnd="--\x3e",safeCommentCharacter=".",startsWithPipeRe=/^ *\|/,notCrLfRe=/[^\r\n]/g,notSpaceCrLfRe=/[^ \r\n]/g,trailingSpaceRe=/ +[\r\n]/g,replaceTrailingSpace=e=>e.replace(notCrLfRe,safeCommentCharacter);var clearHtmlCommentText=helpers.clearHtmlCommentText=function(e){let t=0;for(;-1!==(t=e.indexOf(htmlCommentBegin,t));){const n=e.indexOf(htmlCommentEnd,t+2);if(-1===n)break;if(n>t+htmlCommentBegin.length){const r=e.slice(t+htmlCommentBegin.length,n),o=e.lastIndexOf("\n",t)+1,i=e.slice(o,t),a=0===i.trim().length,s=startsWithPipeRe.test(i)&&r.includes("\n");if(a||!(s||r.startsWith(">")||r.startsWith("->")||r.endsWith("-")||r.includes("--"))){const o=r.replace(notSpaceCrLfRe,safeCommentCharacter).replace(trailingSpaceRe,replaceTrailingSpace);e=e.slice(0,t+htmlCommentBegin.length)+o+e.slice(n)}}t=n+htmlCommentEnd.length}return e},escapeForRegExp=helpers.escapeForRegExp=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")};function ellipsify(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}var ellipsify_1=helpers.ellipsify=ellipsify;function addError$1(e,t,n,r,o,i){e({lineNumber:t,detail:n,context:r,range:o,fixInfo:i})}var addError_1=helpers.addError=addError$1;function addErrorDetailIf(e,t,n,r,o,i,a,s){n!==r&&addError$1(e,t,"Expected: "+n+"; Actual: "+r+(o?"; "+o:""),i,a,s)}var addErrorDetailIf_1=helpers.addErrorDetailIf=addErrorDetailIf;function addErrorContext(e,t,n,r,o,i,a){addError$1(e,t,void 0,n=ellipsify(n.replace(newLineRe,"\n"),r,o),i,a)}var addErrorContext_1=helpers.addErrorContext=addErrorContext;const positionLessThanOrEqual=(e,t,n,r)=>e<n||e===n&&t<=r;var hasOverlap=helpers.hasOverlap=function(e,t){const n=positionLessThanOrEqual(e.startLine,e.startColumn,t.startLine,t.startColumn),r=n?e:t,o=n?t:e;return positionLessThanOrEqual(o.startLine,o.startColumn,r.endLine,r.endColumn)},frontMatterHasTitle=helpers.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))};function getReferenceLinkImageData$1(e){var t;const n=e=>e.toLowerCase().trim().replace(/\s+/g," "),r=e=>null==e?void 0:e.children.filter(e=>"blockQuotePrefix"!==e.type).map(e=>e.text).join(""),o=new Map,i=new Map,a=(e,t,r)=>{const a=[e.startLine-1,e.startColumn-1,e.text.length],s=n(t),l=r?i:o,c=l.get(s)||[];c.push(a),l.set(s,c)},s=new Map,l=[],c=[],u=micromark.filterByTypes(e,["definition","gfmFootnoteDefinition","definitionLabelString","gfmFootnoteDefinitionLabelString","gfmFootnoteCall","image","link","undefinedReferenceCollapsed","undefinedReferenceFull","undefinedReferenceShortcut"]);for(const d of u){let e="";switch(d.type){case"definition":case"gfmFootnoteDefinition":for(let e=d.startLine;e<=d.endLine;e++)l.push(e-1);break;case"gfmFootnoteDefinitionLabelString":e="^";case"definitionLabelString":{const r=n(`${e}${d.text}`);if(s.has(r))c.push([r,d.startLine-1]);else{const e=micromark.getParentOfType(d,["definition"]),n=e&&(null==(t=micromark.getDescendantsByType(e,["definitionDestination","definitionDestinationRaw","definitionDestinationString"])[0])?void 0:t.text);s.set(r,[d.startLine-1,n])}}break;case"gfmFootnoteCall":case"image":case"link":{let e=1===d.children.length;const t=2===d.children.length&&!d.children.some(e=>"resource"===e.type),[n]=micromark.getDescendantsByType(d,["label","labelText"]),[o]=micromark.getDescendantsByType(d,["reference","referenceString"]);let i=r(n);if(!e&&!t){const[t,n]=d.children.filter(e=>["gfmFootnoteCallMarker","gfmFootnoteCallString"].includes(e.type));t&&n&&(i=`${t.text}${n.text}`,e=!0)}(e||t)&&a(d,r(o)||i,e)}break;case"undefinedReferenceCollapsed":case"undefinedReferenceFull":case"undefinedReferenceShortcut":{const e=micromark.getDescendantsByType(d,["undefinedReference"])[0].children.map(e=>e.text).join("");a(d,e,"undefinedReferenceShortcut"===d.type)}}}return{references:o,shortcuts:i,definitions:s,duplicateDefinitions:c,definitionLineIndices:l}}var getReferenceLinkImageData_1=helpers.getReferenceLinkImageData=getReferenceLinkImageData$1;function getPreferredLineEnding(e,t){let n=0,r=0,o=0;const i=e.match(newLineRe)||[];for(const s of i)switch(s){case"\r":n++;break;case"\n":r++;break;case"\r\n":o++}let a=null;return a=n||r||o?r>=o&&r>=n?"\n":o>=n?"\r\n":"\r":t&&t.EOL||"\n",a}var getPreferredLineEnding_1=helpers.getPreferredLineEnding=getPreferredLineEnding;function expandTildePath(e,t){const n=t&&t.homedir&&t.homedir();return n?e.replace(/^~($|\/|\\)/,`${n}$1`):e}helpers.expandTildePath=expandTildePath;const map=new Map;let params;function initialize(e){map.clear(),params=e}function micromarkTokens(){return(null==params?void 0:params.parsers.micromark.tokens)||[]}function getCached(e,t){if(map.has(e))return map.get(e);const n=t();return map.set(e,n),n}function filterByTypesCached(e,t){return getCached(JSON.stringify(arguments),()=>micromarkHelpers.filterByTypes(micromarkTokens(),e,t))}function getReferenceLinkImageData(){return getCached(getReferenceLinkImageData.name,()=>getReferenceLinkImageData_1(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}=helpers;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=micromarkHelpers.getHeadingLevel(r);e>n&&addErrorDetailIf_1(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=micromarkHelpers.getHeadingStyle(r);if("consistent"===n&&(n=e),e!==n){const o=micromarkHelpers.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"),addErrorDetailIf_1(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=micromarkHelpers.getParentOfType(t,["listOrdered","listUnordered"]);)e++}const a=micromarkHelpers.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;addErrorDetailIf_1(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)addErrorDetailIf_1(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?r-n:e,u=o?c-n:s;addError_1(t,i,o?`Expected: (${r}); Actual: (${c})`:`Expected: ${e}; Actual: ${s}`,void 0,l,{editColumn:Math.min(u,a)+1,deleteCount:Math.max(u-a,0),insertText:"".padEnd(Math.max(a-u,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=micromarkHelpers.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))};addErrorDetailIf_1(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"]))micromarkHelpers.addRangeToSet(i,u.startLine+1,u.endLine-1);for(const u of filterByTypesCached(["codeIndented"]))micromarkHelpers.addRangeToSet(i,u.startLine,u.endLine);const a=new Set;if(r)for(const u of filterByTypesCached(["listOrdered","listUnordered"])){micromarkHelpers.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"]))micromarkHelpers.addRangeToSet(s,e.startLine,e.endLine-1);for(const e of filterByTypesCached(["codeText"]))micromarkHelpers.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;addError_1(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 micromarkHelpers.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=>hasOverlap(e,i))||addError_1(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"]))micromarkHelpers.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=>hasOverlap(e,u))||addError_1(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"]))micromarkHelpers.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&&addErrorDetailIf_1(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,f=e.config.tables,h=void 0===f||!!f,m=e.config.headings,g=void 0===m||!!m,v=new Set;for(const w of filterByTypesCached(["atxHeading","setextHeading"]))micromarkHelpers.addRangeToSet(v,w.startLine,w.endLine);const y=new Set;for(const w of filterByTypesCached(["codeFenced","codeIndented"]))micromarkHelpers.addRangeToSet(y,w.startLine,w.endLine);const b=new Set;for(const w of filterByTypesCached(["table"]))micromarkHelpers.addRangeToSet(b,w.startLine,w.endLine);const x=new Set;for(const w of filterByTypesCached(["autolink","image","link","literalAutolink"]))micromarkHelpers.addRangeToSet(x,w.startLine,w.endLine);const $=new Set;for(const w of filterByTypesCached(["paragraph"]))for(const e of micromarkHelpers.getDescendantsByType(w,["data"]))micromarkHelpers.addRangeToSet($,e.startLine,e.endLine);const _=new Set;for(const w of x)$.has(w)||_.add(w);const C=new Set(getReferenceLinkImageData().definitionLineIndices);for(let w=0;w<e.lines.length;w++){const s=e.lines[w],d=w+1,f=v.has(d),m=y.has(d),x=b.has(d),$=m?o:f?r:n,S=m?u:f?c:l;!p&&m||!h&&x||!g&&f||C.has(w)||!i&&(a&&sternModeRe.test(s)||_.has(d))||!S.test(s)||addErrorDetailIf_1(t,d,$,s.length,void 0,void 0,[$+1,s.length-$])}}},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;addErrorContext_1(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"]))micromarkHelpers.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;addErrorContext_1(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;addErrorContext_1(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"===micromarkHelpers.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"===micromarkHelpers.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"]))micromarkHelpers.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,f=!r,h=!s||!!l,m=l?`${l} `:"";if(f||h){const e=f?[1,d+1]:[i.length-u-p,p+1];addErrorContext_1(t,o+1,i.trim(),f,h,e,{editColumn:1,deleteCount:i.length,insertText:`${n} ${a} ${m}${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[micromarkHelpers.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&&isBlankLine_1(o[e-2-t]);t++)n++;addErrorDetailIf_1(t,e,c,n,"Above",l,void 0,{insertText:micromarkHelpers.getBlockQuotePrefixText(i,e-1,c-n)})}const u=r(a);if(u>=0){let n=0;for(let e=0;e<u&&isBlankLine_1(o[s+e]);e++)n++;addErrorDetailIf_1(t,e,u,n,"Below",l,void 0,{lineNumber:s+1,insertText:micromarkHelpers.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;addErrorContext_1(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=micromarkHelpers.getHeadingText(a);if(n){const e=micromarkHelpers.getHeadingLevel(a);for(;o<e;)o++,r[o]=[];for(;o>e;)r[o]=[],o--;i=r[e]}i.includes(e)?addErrorContext_1(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===micromarkHelpers.getHeadingLevel(e)&&!micromarkHelpers.isDocfxTab(e));if(o.length>0){const n=frontMatterHasTitle(e.frontMatterLines,e.config.front_matter_title);let i=n;if(!i){i=r.slice(0,r.indexOf(o[0])).every(e=>micromarkHelpers.nonContentTokens.has(e.type)||micromarkHelpers.isHtmlFlowComment(e))}if(i)for(const e of o.slice(n?0:1))addErrorContext_1(t,e.startLine,micromarkHelpers.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?allPunctuationNoQuestion:n);const r=new RegExp("\\s*["+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&&!endOfLineHtmlEntityRe.test(o)&&!endOfLineGemojiCodeRe.test(o)){const r=a[0],o=r.length,i=e-o;addError_1(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)&&!micromarkHelpers.getParentOfType(s,listTypes))){const{startColumn:n,startLine:r,text:o}=s,{length:i}=o,a=e.lines[r-1];addErrorContext_1(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)addError_1(t,e);break}break}}}}},listStyleExamples={one:"1/1/1",ordered:"1/2/3",zero:"0/0/0"};function getOrderedListItemValue(e){return Number(micromarkHelpers.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=micromarkHelpers.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);addErrorDetailIf_1(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)};addErrorDetailIf_1(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`};addErrorContext_1(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&&micromarkHelpers.getParentOfType(i,["listOrdered","listUnordered"])||(isBlankLine_1(o[i.startLine-2])||addError(t,o,i.startLine,!0),isBlankLine_1(o[i.endLine])||isBlankLine_1(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=micromarkHelpers.filterByPredicate(r.micromark.tokens,isList,e=>isList(e)||"htmlFlow"===e.type?[]:e.children);for(const a of i){const e=a.startLine;isBlankLine_1(n[e-2])||addErrorContext_1(t,e,n[e-1].trim(),void 0,void 0,void 0,{insertText:micromarkHelpers.getBlockQuotePrefixText(o,e)});const r=micromarkHelpers.filterByPredicate(a.children,e=>!micromarkHelpers.nonContentTokens.has(e.type),e=>micromarkHelpers.nonContentTokens.has(e.type)?[]:e.children);let i=a.endLine;r.length>0&&(i=r[r.length-1].endLine);const s=i;isBlankLine_1(n[s])||addErrorContext_1(t,s,n[s-1].trim(),void 0,void 0,void 0,{lineNumber:s+1,insertText:micromarkHelpers.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=micromarkHelpers.getHtmlTagInfo(r);if(e&&!e.close&&!n.includes(e.name.toLowerCase())){const n=[r.startColumn,r.text.replace(nextLinesRe_1,"").length];addError_1(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,micromarkHelpers.filterByPredicate(n,e=>{var t;if("literalAutolink"===e.type&&!micromarkHelpers.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=micromarkHelpers.getHtmlTagInfo(e);if(o&&!o.close){let e=1;for(let n=r+1;n<t.length;n++){const i=t[n],a=micromarkHelpers.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}>`};addErrorContext_1(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),addErrorDetailIf_1(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?allPunctuation_1: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=micromarkHelpers.getDescendantsByType(o,i);for(const n of e)1!==n.children.length||"data"!==n.children[0].type||r.test(n.text)||addErrorContext_1(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=micromarkHelpers.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&&!micromarkHelpers.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}`;addError_1(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}`;addError_1(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=micromarkHelpers.getDescendantsByType(r,["codeTextData"]);if(e.length>0){const n=micromarkHelpers.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,"",""],f="`"===p[1],h=p[2].length-(f&&!u?1:0),m=h>0,g=c&&m&&o&&u&&!s&&!f,v=r.text;if(c){const e=(g?o:i).startColumn,n=l+(g?o.text.length:0);addErrorContext_1(t,i.startLine,v,!0,!1,[e,n],{editColumn:e,deleteCount:n})}if(m){const e=(g?u:d).endColumn,n=h+(g?u.text.length:0);addErrorContext_1(t,d.endLine,v,!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;addErrorContext_1(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=micromarkHelpers.getDescendantsByType(a,["codeFencedFence"])[0],{startLine:i,text:s}=e,l=null==(n=micromarkHelpers.getDescendantsByType(e,["codeFencedFenceInfo"])[0])?void 0:n.text;l?r.length>0&&!r.includes(l)&&addError_1(t,i,`"${l}" is not allowed`):addErrorContext_1(t,i,s),o&&micromarkHelpers.getDescendantsByType(e,["codeFencedFenceMeta"]).length>0&&addError_1(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=micromarkHelpers.filterByTypes(t,["htmlText"],!0),n=e.length>0&&micromarkHelpers.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(!frontMatterHasTitle(e.frontMatterLines,e.config.front_matter_title)){let i=0;for(const e of o){const{startLine:t,type:o}=e;if(!micromarkHelpers.nonContentTokens.has(o)&&!micromarkHelpers.isHtmlFlowComment(e)){let a=null;if("atxHeading"===o||"setextHeading"===o){micromarkHelpers.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&&addErrorContext_1(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=micromarkHelpers.getDescendantsByType(i,["label","labelText"]),n=micromarkHelpers.getDescendantsByType(i,["reference"]),o=micromarkHelpers.getDescendantsByType(i,["resource"]),a=micromarkHelpers.getDescendantsByType(n,["referenceString"]),s=micromarkHelpers.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 f=!1;l&&(!c&&!u||c&&!d)?f=r(e[0]):d&&!p?f=r(a[0]):!d&&p?f="#"===s[0].text.trim():d||p||(f=!0),f&&addErrorContext_1(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=micromarkHelpers.getHeadingText(d),n=micromarkHelpers.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--:(addErrorDetailIf_1(t,d.startLine,u,r),a=!0))}const u=n.length-o;a||!(u>1||1===u&&"*"!==n[o])||!s&&n.every(e=>"*"===e)||addErrorContext_1(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,f,h){let m,g;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),v};function v(t){return 35===t?(m=a,y(t)):46===t?(m=s,y(t)):h&&markdownSpace(t)?factorySpace(e,v,"whitespace")(t):!h&&markdownLineEndingOrSpace(t)?factoryWhitespace(e,v)(t):null===t||markdownLineEnding(t)||unicodeWhitespace(t)||unicodePunctuation(t)&&45!==t&&95!==t?P(t):(e.enter(i),e.enter(l),e.consume(t),$)}function y(t){const n=m+"Marker";return e.enter(i),e.enter(m),e.enter(n),e.consume(t),e.exit(n),b}function b(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=m+"Value";return e.enter(r),e.consume(t),x}function x(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=m+"Value";return e.exit(n),e.exit(m),e.exit(i),v(t)}return e.consume(t),x}function $(t){return null===t||markdownLineEnding(t)||unicodeWhitespace(t)||unicodePunctuation(t)&&45!==t&&46!==t&&58!==t&&95!==t?(e.exit(l),h&&markdownSpace(t)?factorySpace(e,_,"whitespace")(t):!h&&markdownLineEndingOrSpace(t)?factoryWhitespace(e,_)(t):_(t)):(e.consume(t),$)}function _(t){return 61===t?(e.enter(c),e.consume(t),e.exit(c),C):(e.exit(i),v(t))}function C(t){return null===t||60===t||61===t||62===t||96===t||125===t||h&&markdownLineEnding(t)?n(t):34===t||39===t?(e.enter(u),e.enter(p),e.consume(t),e.exit(p),g=t,S):h&&markdownSpace(t)?factorySpace(e,C,"whitespace")(t):!h&&markdownLineEndingOrSpace(t)?factoryWhitespace(e,C)(t):(e.enter(d),e.enter(f),e.consume(t),g=void 0,w)}function w(t){return null===t||34===t||39===t||60===t||61===t||62===t||96===t?n(t):125===t||markdownLineEndingOrSpace(t)?(e.exit(f),e.exit(d),e.exit(i),v(t)):(e.consume(t),w)}function S(t){return t===g?(e.enter(p),e.consume(t),e.exit(p),e.exit(u),e.exit(i),T):(e.enter(d),E(t))}function E(t){return t===g?(e.exit(d),S(t)):null===t?n(t):markdownLineEnding(t)?h?n(t):factoryWhitespace(e,E)(t):(e.enter(f),e.consume(t),k)}function k(t){return t===g||null===t||markdownLineEnding(t)?(e.exit(f),E(t)):(e.consume(t),k)}function T(e){return 125===e||markdownLineEndingOrSpace(e)?v(e):P(e)}function P(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 h(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?f:p):(e.exit("chunkText"),h(t))}function f(t){return 91===t||92===t||93===t?(e.consume(t),l++,p):p(t)}function h(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?_(o):markdownLineEnding(o)?r.interrupt?t(o):e.attempt(nonLazyLine,f,_)(o):n(o)}function f(t){return null===t?_(t):markdownLineEnding(t)?e.check(nonLazyLine,y,_)(t):(e.enter("directiveContainerContent"),h(t))}function h(t){return e.attempt({tokenize:C,partial:!0},$,i?factorySpace(e,m,"linePrefix",i+1):m)(t)}function m(t){return null===t?$(t):markdownLineEnding(t)?e.check(nonLazyLine,v,$)(t):v(t)}function g(t){if(null===t){const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,$(t)}return markdownLineEnding(t)?e.check(nonLazyLine,b,x)(t):(e.consume(t),g)}function v(t){const n=e.enter("chunkDocument",{contentType:"document",previous:a});return a&&(a.next=n),a=n,g(t)}function y(t){return e.enter("directiveContainerContent"),h(t)}function b(t){e.consume(t);const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,h}function x(t){const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,$(t)}function $(t){return e.exit("directiveContainerContent"),_(t)}function _(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$2={};function gfmAutolinkLiteral(){return{text:text$2}}let code=48;for(;code<123;)text$2[code]=emailAutolink,code++,58===code?code=65:91===code&&(code=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(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$2[43]=emailAutolink,text$2[45]=emailAutolink,text$2[46]=emailAutolink,text$2[95]=emailAutolink,text$2[72]=[emailAutolink,protocolAutolink],text$2[104]=[emailAutolink,protocolAutolink],text$2[87]=[emailAutolink,wwwAutolink],text$2[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(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=push(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=push(l,resolveAll(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=push(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(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={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,f,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 f(t){return e.attempt(o,y,h)(t)}function h(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return a>0&&markdownSpace(t)?factorySpace(e,g,"linePrefix",a+1)(t):g(t)}function g(t){return null===t||markdownLineEnding(t)?e.check(nonLazyContinuation$1,f,y)(t):(e.enter("codeFlowValue"),v(t))}function v(t){return null===t||markdownLineEnding(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),v)}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,f=n,h=0,m=0;const g=[m];for(;f;){for(;e.get(++o)[1]!==f;);i.push(o),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=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&&(m=p+1,g.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),p=g.length;p--;){const t=s.slice(g[p],g[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[h+l[p][0]]=h+l[p][1],h+=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"}),h(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?f:p)}function f(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function h(o){return u||null!==o&&41!==o&&!markdownLineEndingOrSpace(o)?u<c&&40===o?(e.consume(o),u++,h):41===o?(e.consume(o),u--,h):null===o||32===o||40===o||asciiControl(o)?n(o):(e.consume(o),92===o?m:h):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o))}function m(t){return 40===t||41===t||92===t?(e.consume(t),h):h(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,f):63===s?(e.consume(s),o=3,r.interrupt?t:O):asciiAlpha(s)?(e.consume(s),a=String.fromCharCode(s),h):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:O):n(i)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:O):n(o)}function p(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:E:p):n(o)}function f(t){return asciiAlpha(t)?(e.consume(t),a=String.fromCharCode(t),h):n(t)}function h(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),m):r.interrupt?t(s):E(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?g(s):v(s)):(o=1,r.interrupt?t(s):E(s))}return 45===s||asciiAlphanumeric(s)?(e.consume(s),a+=String.fromCharCode(s),h):n(s)}function m(o){return 62===o?(e.consume(o),r.interrupt?t:E):n(o)}function g(t){return markdownSpace(t)?(e.consume(t),g):w(t)}function v(t){return 47===t?(e.consume(t),w):58===t||95===t||asciiAlpha(t)?(e.consume(t),y):markdownSpace(t)?(e.consume(t),v):w(t)}function y(t){return 45===t||46===t||58===t||95===t||asciiAlphanumeric(t)?(e.consume(t),y):b(t)}function b(t){return 61===t?(e.consume(t),x):markdownSpace(t)?(e.consume(t),b):v(t)}function x(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,$):markdownSpace(t)?(e.consume(t),x):_(t)}function $(t){return t===l?(e.consume(t),l=null,C):null===t||markdownLineEnding(t)?n(t):(e.consume(t),$)}function _(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||markdownLineEndingOrSpace(t)?b(t):(e.consume(t),_)}function C(e){return 47===e||62===e||markdownSpace(e)?v(e):n(e)}function w(t){return 62===t?(e.consume(t),S):n(t)}function S(t){return null===t||markdownLineEnding(t)?E(t):markdownSpace(t)?(e.consume(t),S):n(t)}function E(t){return 45===t&&2===o?(e.consume(t),M):60===t&&1===o?(e.consume(t),L):62===t&&4===o?(e.consume(t),A):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),R):!markdownLineEnding(t)||6!==o&&7!==o?null===t||markdownLineEnding(t)?(e.exit("htmlFlowData"),k(t)):(e.consume(t),E):(e.exit("htmlFlowData"),e.check(blankLineBefore,D,k)(t))}function k(t){return e.check(nonLazyContinuationStart,T,D)(t)}function T(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),P}function P(t){return null===t||markdownLineEnding(t)?k(t):(e.enter("htmlFlowData"),E(t))}function M(t){return 45===t?(e.consume(t),O):E(t)}function L(t){return 47===t?(e.consume(t),a="",I):E(t)}function I(t){if(62===t){const n=a.toLowerCase();return htmlRawNames.includes(n)?(e.consume(t),A):E(t)}return asciiAlpha(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),I):E(t)}function R(t){return 93===t?(e.consume(t),O):E(t)}function O(t){return 62===t?(e.consume(t),A):45===t&&2===o?(e.consume(t),O):E(t)}function A(t){return null===t||markdownLineEnding(t)?(e.exit("htmlFlowData"),D(t)):(e.consume(t),A)}function D(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),x):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,f):asciiAlpha(t)?(e.consume(t),v):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?L(e):45===e?d(e):u(e)}function f(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?h:f):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),m):markdownLineEnding(t)?(a=h,I(t)):(e.consume(t),h)}function m(t){return 93===t?(e.consume(t),g):h(t)}function g(t){return 62===t?L(t):93===t?(e.consume(t),g):h(t)}function v(t){return null===t||62===t?L(t):markdownLineEnding(t)?(a=v,I(t)):(e.consume(t),v)}function y(t){return null===t?n(t):63===t?(e.consume(t),b):markdownLineEnding(t)?(a=y,I(t)):(e.consume(t),y)}function b(e){return 62===e?L(e):y(e)}function x(t){return asciiAlpha(t)?(e.consume(t),$):n(t)}function $(t){return 45===t||asciiAlphanumeric(t)?(e.consume(t),$):_(t)}function _(t){return markdownLineEnding(t)?(a=_,I(t)):markdownSpace(t)?(e.consume(t),_):L(t)}function C(t){return 45===t||asciiAlphanumeric(t)?(e.consume(t),C):47===t||62===t||markdownLineEndingOrSpace(t)?w(t):n(t)}function w(t){return 47===t?(e.consume(t),L):58===t||95===t||asciiAlpha(t)?(e.consume(t),S):markdownLineEnding(t)?(a=w,I(t)):markdownSpace(t)?(e.consume(t),w):L(t)}function S(t){return 45===t||46===t||58===t||95===t||asciiAlphanumeric(t)?(e.consume(t),S):E(t)}function E(t){return 61===t?(e.consume(t),k):markdownLineEnding(t)?(a=E,I(t)):markdownSpace(t)?(e.consume(t),E):w(t)}function k(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,T):markdownLineEnding(t)?(a=k,I(t)):markdownSpace(t)?(e.consume(t),k):(e.consume(t),P)}function T(t){return t===o?(e.consume(t),o=void 0,M):null===t?n(t):markdownLineEnding(t)?(a=T,I(t)):(e.consume(t),T)}function P(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||markdownLineEndingOrSpace(t)?w(t):(e.consume(t),P)}function M(e){return 47===e||62===e||markdownLineEndingOrSpace(e)?w(e):n(e)}function L(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"),R}function R(t){return markdownSpace(t)?factorySpace(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(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(i,e.slice(r+1,r+s+3)),i=push(i,[["enter",u,t]]),i=push(i,resolveAll(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=push(i,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),i=push(i,e.slice(o+1)),i=push(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={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,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(){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?x:s;if(i===x&&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?h(t):124===t?(o=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),f):b(t)}function f(t){return markdownSpace(t)?factorySpace(e,h,"whitespace")(t):h(t)}function h(t){return 58===t?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(a+=1,m(t)):null===t||markdownLineEnding(t)?y(t):b(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):b(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(t))}function v(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)):b(n)}function b(e){return n(e)}function x(t){return e.enter("tableRow"),$(t)}function $(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),$):null===n||markdownLineEnding(n)?(e.exit("tableRow"),t(n)):markdownSpace(n)?factorySpace(e,$,"whitespace")(n):(e.enter("data"),_(n))}function _(t){return null===t||124===t||markdownLineEndingOrSpace(t)?(e.exit("data"),$(t)):(e.consume(t),92===t?C:_)}function C(t){return 92===t||124===t?(e.consume(t),_):_(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 f=e[i],h=f[1];"enter"===f[0]?"tableHead"===h.type?(u=!1,0!==d&&(flushTableEnd(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(i,0,[["enter",n,t]])):"tableRow"===h.type||"tableDelimiterRow"===h.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({},h.start),end:Object.assign({},h.end)},p.add(i,0,[["enter",r,t]])),s="tableDelimiterRow"===h.type?2:r?3:1):!s||"data"!==h.type&&"tableDelimiterMarker"!==h.type&&"tableDelimiterFiller"!==h.type?"tableCellDivider"===h.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"===h.type?(u=!0,d=i):"tableRow"===h.type||"tableDelimiterRow"===h.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"!==h.type&&"tableDelimiterMarker"!==h.type&&"tableDelimiterFiller"!==h.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,m)(n)}function d(t){return e.attempt({tokenize:g,partial:!0},m,p)(t)}function p(t){return(i?factorySpace(e,f,"linePrefix",i+1):f)(t)}function f(t){return null===t?m(t):markdownLineEnding(t)?e.attempt(nonLazyContinuation,d,m)(t):(e.enter("mathFlowValue"),h(t))}function h(t){return null===t||markdownLineEnding(t)?(e.exit("mathFlowValue"),f(t)):(e.consume(t),h)}function m(n){return e.exit("mathFlow"),t(n)}function g(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={}.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.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){hasOwnProperty.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$2={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}v(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 h(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(containerConstruct,u,d)(o)}function u(e){return r&&y(),v(a),p(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,i=t.now().offset,h(e)}function p(n){return t.containerState={},e.attempt(containerConstruct,f,h)(n)}function f(e){return a++,n.push([t.currentConstruct,t.containerState]),p(e)}function h(n){return null===n?(r&&y(),v(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),m(n))}function m(n){return null===n?(g(e.exit("chunkFlow"),!0),v(0),void e.consume(n)):markdownLineEnding(n)?(e.consume(n),g(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),m)}function g(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(v(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 v(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$1=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$1={42:list,43:list,45:list,48:list,49:list,50:list,51:list,52:list,53:list,54:list,55:list,56:list,57:list,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={[-5]:lineEnding,[-4]:lineEnding,[-3]:lineEnding,33:labelStartImage,38:characterReference,42:attention,60:[autolink,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$1,flow:flow,flowInitial:flowInitial,insideSpan:insideSpan,string:string,text:text},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:g(function(e,t){v(e,t.from)}),check:g(m),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:g(m,{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(a,e),f(),null!==a[a.length-1])return[];return v(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 f(){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;)h(t.charCodeAt(r._bufferIndex));else h(t)}}function h(e){u=u(e)}function m(e,t){t.restore()}function g(e,t){return function(n,o,i){let a,u,d,f;return Array.isArray(n)?h(n):"tokenize"in n?h([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return h([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function h(e){return a=e,u=0,0===e.length?i:m(e[u])}function m(e){return function(n){f=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 v();return e.tokenize.call(t?Object.assign(Object.create(c),t):c,l,g,v)(n)}}function g(t){return e(d,f),o}function v(e){return f.restore(),++u<a.length?m(a[u]):i}}}function v(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$1(e){const t={constructs:combineExtensions([defaultConstructs,...(e||{}).extensions||[]]),content:n(content),defined:[],document:n(document$2),flow:n(flow$1),lazy:{},string:n(string$1),text:n(text$1)};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}}function getText(e,t){return e.slice(t.start.offset,t.end.offset)}function getEvents(e,t={}){const n=[directive(),gfmAutolinkLiteral(),gfmFootnote(),gfmTable(),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],f=p&&p[1];f&&f.end.line===c.start.line&&f.end.column===c.start.column&&(0===d.length?(f.type="undefinedReferenceCollapsed",f.end=l.end):(c.type="undefinedReferenceFull",c.start=f.start,r.pop()));const h=d.filter(e=>"enter"===e[0]).map(t=>getText(e,t[1])).join("").trim();if(h.length>0&&!h.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$1({...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(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,f=null,h=!1;for(const m of a){const[a,s]=m,{type:g,start:v,end:y}=s,{column:b,line:x}=v,{column:$,line:_}=y,C=getText(e,s);if("enter"!==a||h)"exit"===a&&("htmlFlow"===g&&(h=!1),h||(i&&(Object.freeze(d.children),Object.freeze(d)),d=u.pop()));else{const i=d;if(u.push(i),d={type:g,startLine:x+r,startColumn:b,endLine:_+r,endColumn:$,text:C,children:[],parent:i===c?o||null:i},o&&Object.defineProperty(d,htmlFlowSymbol$1,{value:!0}),i.children.push(d),l.push(d),"htmlFlow"===d.type&&!micromarkHelpers.isHtmlFlowComment(d)){h=!0,p&&f||(p={...n,extensions:[{disable:{null:["codeIndented","htmlFlow"]}}]},f=e.split(newLineRe$1));const r=parseInternal(f.slice(d.startLine-1,d.endLine).join("\n"),t,p,d.startLine-1,d);d.children=r,l=l.concat(r[flatTokensSymbol$1])}}}return Object.defineProperty(s,flatTokensSymbol$1,{value:l}),i&&Object.freeze(s),s}function parse(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=micromarkHelpers.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=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=>hasOverlap(e,p))){let e=[];u.has(a)||(e=micromarkHelpers.filterByTypes(parse(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=>hasOverlap(e,p))||addErrorDetailIf_1(t,a.startLine,d,o,void 0,void 0,[i,s],{editColumn:i,deleteCount:s,insertText:d})}c.push(p)}}}}},altRe=getHtmlAttributeRe("alt"),ariaHiddenRe=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(micromarkHelpers.getDescendantsByType(i,["label","labelText"]).some(e=>0===e.text.length)){const e=i.startLine===i.endLine?[i.startColumn,i.endColumn-i.startColumn]:void 0;addError_1(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=micromarkHelpers.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(nextLinesRe_1,"").length];addError_1(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]),addErrorDetailIf_1(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];isBlankLine_1(r)||addError_1(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=micromarkHelpers.getDescendantsByType(o,["codeFencedFence","codeFencedFenceSequence"])[0],{startLine:r,text:i}=e;"consistent"===n&&(n=fencedCodeBlockStyleFor(i)),addErrorDetailIf_1(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=micromarkHelpers.filterByPredicate(l.micromark.tokens,e=>e.type===n,e=>"htmlFlow"===e.type?[]:e.children);for(const u of c){const e=micromarkHelpers.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])addError_1(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=getHtmlAttributeRe("id"),nameRe=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=micromarkHelpers.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 micromarkHelpers.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=micromarkHelpers.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)&&micromarkHelpers.isDocfxTab(e.parent.parent))});for(const r of e){const e=micromarkHelpers.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||addError_1(t,r.startLine,`Expected: ${d}; Actual: ${l}`,o,a,c)):addError_1(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);addError_1(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];addError_1(t,a+1,`Unused link or image reference definition: "${e}"`,ellipsify_1(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];addError_1(t,o+1,`Duplicate link or image reference definition: "${e}"`,ellipsify_1(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:f}=getReferenceLinkImageData(),h=filterByTypesCached(["autolink","image","link"]);for(const m of h){let e=null,a=null;const{endColumn:h,endLine:g,startColumn:v,startLine:y,text:b,type:x}=m,$="image"===x;let _=!1;if("autolink"===x)a=null==(n=micromarkHelpers.getDescendantsByType(m,[["autolinkEmail","autolinkProtocol"]])[0])?void 0:n.text,e=a,_=!s&&Boolean(a);else if(e=micromarkHelpers.getDescendantsByType(m,["label","labelText"])[0].text,a=null==(r=micromarkHelpers.getDescendantsByType(m,["resource","resourceDestination",["resourceDestinationLiteral","resourceDestinationRaw"],"resourceDestinationString"])[0])?void 0:r.text,a){const t=null==(o=micromarkHelpers.getDescendantsByType(m,["resource","resourceTitle","resourceTitleString"])[0])?void 0:o.text;_=!l||!p&&s&&!$&&!t&&e===a&&autolinkAble(a)}else{const t=0===micromarkHelpers.getDescendantsByType(m,["reference"]).length,n=null==(i=micromarkHelpers.getDescendantsByType(m,["reference","referenceString"])[0])?void 0:i.text,r=void 0===n,o=f.get(n||e);a=o&&o[1],_=a&&(t?!d:r?!u:!c)}if(_){let n,r;if(y===g){n=[v,h-v];let t=null;const o=l&&e,i=s&&!$&&autolinkAble(a);if(!o||!p&&i)i&&(t=`<${removeBackslashEscapes(a)}>`);else{t=`${$?"!":""}[${e.replace(/[[\]]/g,"\\$&")}](${a.replace(/[()]/g,"\\$&")})`}t&&(r={editColumn:n[0],insertText:t,deleteCount:n[1]})}addErrorContext_1(t,y,b.replace(nextLinesRe_1,""),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&&addErrorDetailIf_1(t,e.startLine,n,c,(r?"Missing":"Unexpected")+" leading pipe",void 0,makeRange$1(a.startColumn,e.startColumn)),l!==o&&addErrorDetailIf_1(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=micromarkHelpers.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)),addErrorDetailIf_1(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;isBlankLine_1(n[e-2])||addErrorContext_1(t,e,n[e-1].trim(),void 0,void 0,void 0,{insertText:micromarkHelpers.getBlockQuotePrefixText(r,e)});const o=i.endLine;isBlankLine_1(n[o])||addErrorContext_1(t,o,n[o-1].trim(),void 0,void 0,void 0,{lineNumber:o+1,insertText:micromarkHelpers.getBlockQuotePrefixText(r,o)})}}},allowedChildrenTypes=new Set(["codeText","htmlText"]),defaultProhibitedTexts=["click here","here","link","more"];function normalize(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));if(n.size>0){const e=filterByTypesCached(["link"]);for(const r of e){const e=micromarkHelpers.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(c))){const e=l===i?[s,o-s]:void 0;addErrorContext_1(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 _e of rules){const e=_e.names[0].toLowerCase();_e.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(isString_1)&&!t.some(isEmptyString_1)||(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||isUrl_1(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(newLineRe_1),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=inlineCommentStartRe_1.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 f=getEffectiveConfig(e,o,a);for(const m of e){const e=m.names[0].toUpperCase();c.push(e),s[e]=!!f[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 h=[];for(const[m,g]of c.entries())u.some(e=>e[g])&&h.push(e[m]);return{effectiveConfig:f,enabledRulesPerLineNumber:u,enabledRuleList:h}}function lintContent(e,t,n,r,o,i,a,s,l,c,u,d,p){const f=e=>p(e instanceof Error?e:new Error(e)),h=removeFrontMatter(r=r.replace(/^\uFEFF/,""),s),{frontMatterLines:m}=h;r=h.content;const{effectiveConfig:g,enabledRulesPerLineNumber:v,enabledRuleList:y}=getEnabledRulesPerLineNumber(e,r.split(newLineRe_1),m,c,i,a,t),b=y.some(e=>"markdownit"===e.parser||void 0===e.parser),x=y.some(e=>"micromark"===e.parser),$=e.length!==rules.length,_=x?parse(r,{freezeTokens:$}):[],C=r,w=(r=clearHtmlCommentText(r)).split(newLineRe_1),S=e=>{const t=Object.freeze({markdownit:Object.freeze({tokens:e})}),r=Object.freeze({micromark:Object.freeze({tokens:_})}),o=Object.freeze({}),i={name:n,version:version,lines:Object.freeze(w),frontMatterLines:Object.freeze(m)};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:g[c]};function f(e){throw new Error(`Value of '${e}' passed to onError by '${c}' is incorrect for '${n}'.`)}function h(e){(!e||!isNumber_1(e.lineNumber)||e.lineNumber<1||e.lineNumber>w.length)&&f("lineNumber");const t=e.lineNumber+m.length;if(!v[t][c])return;e.detail&&!isString_1(e.detail)&&f("detail"),e.context&&!isString_1(e.context)&&f("context"),e.information&&!isUrl_1(e.information)&&f("information"),e.range&&(!Array.isArray(e.range)||2!==e.range.length||!isNumber_1(e.range[0])||e.range[0]<1||!isNumber_1(e.range[1])||e.range[1]<1||e.range[0]+e.range[1]-1>w[e.lineNumber-1].length)&&f("range");const n=e.fixInfo,r={};if(n){isObject_1(n)||f("fixInfo"),void 0!==n.lineNumber&&((!isNumber_1(n.lineNumber)||n.lineNumber<1||n.lineNumber>w.length)&&f("fixInfo.lineNumber"),r.lineNumber=n.lineNumber+m.length);const t=n.lineNumber||e.lineNumber;void 0!==n.editColumn&&((!isNumber_1(n.editColumn)||n.editColumn<1||n.editColumn>w[t-1].length+1)&&f("fixInfo.editColumn"),r.editColumn=n.editColumn),void 0!==n.deleteCount&&((!isNumber_1(n.deleteCount)||n.deleteCount<-1||n.deleteCount>w[t-1].length)&&f("fixInfo.deleteCount"),r.deleteCount=n.deleteCount),void 0!==n.insertText&&(isString_1(n.insertText)||f("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=>h({lineNumber:1,detail:`This rule threw an exception: ${e.message||e}`}),b=()=>s.function(p,h);if(s.asynchronous){const e=Promise.resolve().then(b);return l?e.catch(y):e}try{b()}catch(x){if(!l)throw x;y(x)}return null},c=y.filter(e=>e.asynchronous),d=y.filter(e=>!e.asynchronous),h=[...c,...d],b=()=>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=h.map(s);c.length>0?Promise.all(e.slice(0,c.length)).then(b).catch(f):b()}catch(x){f(x)}finally{initialize()}};if(!b||d){const e=b?deferRequire.requireMarkdownItCjs().getMarkdownItTokens(o(),C,w):[];S(e)}else Promise.all([__vitePreload(()=>import("./markdownit-CIPbrWtm.js").then(e=>e.m),[]),new Promise(e=>e(o()))]).then(([e,t])=>{const n=e.getMarkdownItTokens(t,C,w);S(n)}).catch(f)}function lintFile(e,t,n,r,o,i,a,s,l,c,u,d,p){u.readFile(n,"utf8",function(u,f){return u?p(u):lintContent(e,t,n,f,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:cloneIfArray_1(e.names),description:e.description,information:cloneIfUrl_1(e.information),tags:cloneIfArray_1(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?frontMatterRe:e.frontMatter,p=!!e.handleRuleFailures,f=!!e.noInlineConfig,h=void 0===e.resultVersion?3:e.resultVersion,m=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.")}),g=e.fs||fs,v=mapAliasToRuleNames(o),y=newResults(o);let b=!1,x=0;function $(){let e=null;function r(t,r){return x--,t?(b=!0,n(t)):(y[e]=r,$(),null)}if(b);else if(a.length>0)x++,e=a.shift(),lintFile(o,v,e,m,c,u,d,p,f,h,g,t,r);else if(e=l.shift())x++,lintContent(o,v,e,s[e]||"",m,c,u,d,p,f,h,t,r);else if(0===x)return b=!0,n(null,y);return null}$(),$(),$(),$(),$(),$(),$(),$()}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=getPreferredLineEnding_1(e,os),r=e.split(newLineRe_1);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)}const CustomLink=e=>factory$1(Link$1,{...e,onClick:t=>{e.href&&(t.preventDefault(),ik(e.href))},children:e.children}),CustomHeader=e=>factory$1(Typography,{...e,color:"#2196f3",variant:"h5",sx:{pt:1,pb:1},children:e.children}),CustomDivider=e=>factory$1(Divider,{...e,sx:{pt:1,pb:2}}),CustomStrong=e=>factory$1(Typography,{component:"span",fontWeight:"bold",...e,children:e.children}),CustomParagraph_1=compiledBlock(e=>e.v0,{name:"CustomParagraph_1",portals:["v0"]}),CustomParagraph_2=compiledBlock(e=>e.v0,{name:"CustomParagraph_2",portals:["v0"]}),CustomParagraph_3=compiledBlock(e=>e.v0,{name:"CustomParagraph_3",portals:["v0"]}),CustomParagraph=e=>{const{children:t}=e;if("string"==typeof t){const n=t.split("\n").map((e,t,n)=>t<n.length-1?factory$1("span",{children:[e,factory$1("br",{})]}):factory$1("span",{children:e}));return factory$1(CustomParagraph_1,{v0:factory$1(Typography,{...e,children:n})})}if(Array.isArray(t)||"string"!=typeof t){const n=(e,t)=>"string"==typeof e?e.split("\n").map((e,t,n)=>t<n.length-1?factory$1("span",{children:[e,factory$1("br",{})]}):factory$1("span",{children:e})):factory$1("span",{children:e}),r=Array.isArray(t)?t.map(n):n(t);return factory$1(CustomParagraph_2,{v0:factory$1(Typography,{...e,children:r})})}return factory$1(CustomParagraph_3,{v0:factory$1(Typography,{...e,children:t})})},Markdown=({content:e})=>{const[t]=kc(async()=>{try{const{content:t}=await lintPromise({strings:{content:e}});if(!t.length)return e;const n=applyFixes(e,t);return n||e}catch(t){return console.log("Markdown lint failed",t),e}},{onLoadStart:()=>ioc.layoutService.setAppbarLoader(!0),onLoadEnd:()=>ioc.layoutService.setAppbarLoader(!1),deps:[e]});return t?factory$1(M$1,{overrides:{...w$1,a:{component:CustomLink},h1:{component:CustomHeader},h2:{component:CustomHeader},h3:{component:CustomHeader},h4:{component:CustomHeader},h5:{component:CustomHeader},h6:{component:CustomHeader},hr:{component:CustomDivider},p:{component:CustomParagraph},strong:{component:CustomStrong}},children:t}):null},signal_fields=[{type:Mn$1.Paper,transparentPaper:!0,fieldBottomMargin:"1",fields:[{type:Mn$1.Typography,typoVariant:"h6",placeholder:"General Information"},{type:Mn$1.Outline,sx:{mb:3},fields:[{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"symbol",title:"Symbol",readonly:!0,compute:e=>e.symbol||"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"position",title:"Position",readonly:!0,compute:e=>"long"===e.position?"LONG":"short"===e.position?"SHORT":"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"status",title:"Status",readonly:!0,compute:e=>({opened:"Opened",scheduled:"Scheduled",closed:"Closed",cancelled:"Cancelled"}[e.status]||e.status||"Unknown")},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"exchangeName",title:"Exchange",readonly:!0,compute:e=>e.exchangeName||"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"strategyName",title:"Strategy",readonly:!0,compute:e=>e.strategyName||"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"minuteEstimatedTime",title:"Estimated Time (min)",readonly:!0,compute:e=>{var t;return(null==(t=e.minuteEstimatedTime)?void 0:t.toString())||"Not specified"}}]},{type:Mn$1.Typography,typoVariant:"h6",placeholder:"Timestamps"},{type:Mn$1.Outline,sx:{mb:3},fields:[{type:Mn$1.Text,outlined:!1,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",name:"createdAt",title:"Created",readonly:!0,compute:e=>e.createdAt?dayjs(e.createdAt).format("DD/MM/YYYY HH:mm:ss"):""},{type:Mn$1.Text,outlined:!1,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",name:"updatedAt",title:"Updated",readonly:!0,compute:e=>e.updatedAt?dayjs(e.updatedAt).format("DD/MM/YYYY HH:mm:ss"):""},{type:Mn$1.Text,outlined:!1,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",name:"scheduledAt",title:"Scheduled",readonly:!0,isVisible:e=>!!e.scheduledAt,compute:e=>e.scheduledAt?dayjs(e.scheduledAt).format("DD/MM/YYYY HH:mm:ss"):""},{type:Mn$1.Text,outlined:!1,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",name:"pendingAt",title:"Activated",readonly:!0,isVisible:e=>!!e.pendingAt,compute:e=>e.pendingAt?dayjs(e.pendingAt).format("DD/MM/YYYY HH:mm:ss"):"N/A"}]},{type:Mn$1.Typography,typoVariant:"h6",placeholder:"Price Levels"},{type:Mn$1.Outline,sx:{mb:3},fields:[{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"priceOpen",title:"Entry Price",readonly:!0,compute:e=>e.priceOpen?`${e.priceOpen.toFixed(6)}$`:"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"priceTakeProfit",title:"Take Profit",readonly:!0,compute:e=>e.priceTakeProfit?`${e.priceTakeProfit.toFixed(6)}$`:"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"priceStopLoss",title:"Stop Loss",readonly:!0,compute:e=>e.priceStopLoss?`${e.priceStopLoss.toFixed(6)}$`:"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"originalPriceTakeProfit",title:"Original TP",readonly:!0,isVisible:e=>null!=e.originalPriceTakeProfit&&e.originalPriceTakeProfit!==e.priceTakeProfit,compute:e=>e.originalPriceTakeProfit?`${e.originalPriceTakeProfit.toFixed(6)}$`:""},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"originalPriceStopLoss",title:"Original SL",readonly:!0,isVisible:e=>null!=e.originalPriceStopLoss&&e.originalPriceStopLoss!==e.priceStopLoss,compute:e=>e.originalPriceStopLoss?`${e.originalPriceStopLoss.toFixed(6)}$`:""},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"originalPriceOpen",title:"Original Entry",readonly:!0,isVisible:e=>null!=e.originalPriceOpen&&e.originalPriceOpen!==e.priceOpen,compute:e=>null!=e.originalPriceOpen?`${e.originalPriceOpen.toFixed(6)}$`:"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"totalEntries",title:"DCA Entries",readonly:!0,isVisible:e=>null!=e.totalEntries&&e.totalEntries>1,compute:e=>null!=e.totalEntries?String(e.totalEntries):"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"partialExecuted",title:"Partial Closed",readonly:!0,isVisible:e=>e.partialExecuted>0,compute:e=>{var t;return`${(null==(t=e.partialExecuted)?void 0:t.toFixed(2))||0}%`}}]},{type:Mn$1.Typography,typoVariant:"h6",placeholder:"Result (PNL)",isVisible:e=>"closed"===e.status&&e.pnl},{type:Mn$1.Outline,isVisible:e=>"closed"===e.status&&e.pnl,sx:{mb:3},fields:[{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"pnl.pnlPercentage",title:"PNL %",readonly:!0,compute:e=>{var t;const n=null==(t=e.pnl)?void 0:t.pnlPercentage;if(null==n)return"N/A";return`${n>=0?"+":""}${n.toFixed(2)}%`}},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"pnl.priceOpen",title:"Entry Price (w/ fees)",readonly:!0,compute:e=>{var t;return(null==(t=e.pnl)?void 0:t.priceOpen)?`${e.pnl.priceOpen.toFixed(6)}$`:"N/A"}},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"pnl.priceClose",title:"Exit Price",readonly:!0,compute:e=>{var t;return(null==(t=e.pnl)?void 0:t.priceClose)?`${e.pnl.priceClose.toFixed(6)}$`:"N/A"}}]},{type:Mn$1.Typography,typoVariant:"h6",placeholder:"Note",isVisible:e=>!!e.note},{type:Mn$1.Outline,isVisible:e=>!!e.note,sx:{mb:3},child:{type:Mn$1.Component,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"note",element:({note:e})=>factory$1(Box$1,{children:factory$1(Markdown,{content:e||"No note"})})}},{type:Mn$1.Box,sx:{display:"grid",gridTemplateColumns:"auto 1fr"},fields:[{type:Mn$1.Component,element:({id:e})=>factory$1(cS,{label:"Signal ID",content:e})},{type:Mn$1.Div}]}]}],SignalView=({data:e})=>factory$1(Box$1,{sx:{height:"100%",width:"100%",pt:1},children:factory$1(nm,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:factory$1("div",{children:[factory$1(bf,{slots:defaultSlots,fields:signal_fields,handler:()=>e}),factory$1(Box$1,{sx:{paddingBottom:"65px"}})]})})});var defaultBindingOptions={allowDownsampling:!0};function bindToDevicePixelRatio(e,t){return void 0===t&&(t=defaultBindingOptions),new DevicePixelRatioBinding(e,t)}var DevicePixelRatioBinding=function(){function e(e,t){var n=this;this._resolutionMediaQueryList=null,this._resolutionListener=function(e){return n._onResolutionChanged()},this._canvasConfiguredListeners=[],this.canvas=e,this._canvasSize={width:this.canvas.clientWidth,height:this.canvas.clientHeight},this._options=t,this._configureCanvas(),this._installResolutionListener()}return e.prototype.destroy=function(){this._canvasConfiguredListeners.length=0,this._uninstallResolutionListener(),this.canvas=null},Object.defineProperty(e.prototype,"canvasSize",{get:function(){return{width:this._canvasSize.width,height:this._canvasSize.height}},enumerable:!0,configurable:!0}),e.prototype.resizeCanvas=function(e){this._canvasSize={width:e.width,height:e.height},this._configureCanvas()},Object.defineProperty(e.prototype,"pixelRatio",{get:function(){var e=this.canvas.ownerDocument.defaultView;if(null==e)throw new Error("No window is associated with the canvas");return e.devicePixelRatio>1||this._options.allowDownsampling?e.devicePixelRatio:1},enumerable:!0,configurable:!0}),e.prototype.subscribeCanvasConfigured=function(e){this._canvasConfiguredListeners.push(e)},e.prototype.unsubscribeCanvasConfigured=function(e){this._canvasConfiguredListeners=this._canvasConfiguredListeners.filter(function(t){return t!=e})},e.prototype._configureCanvas=function(){var e=this.pixelRatio;this.canvas.style.width=this._canvasSize.width+"px",this.canvas.style.height=this._canvasSize.height+"px",this.canvas.width=this._canvasSize.width*e,this.canvas.height=this._canvasSize.height*e,this._emitCanvasConfigured()},e.prototype._emitCanvasConfigured=function(){var e=this;this._canvasConfiguredListeners.forEach(function(t){return t.call(e)})},e.prototype._installResolutionListener=function(){if(null!==this._resolutionMediaQueryList)throw new Error("Resolution listener is already installed");var e=this.canvas.ownerDocument.defaultView;if(null==e)throw new Error("No window is associated with the canvas");var t=e.devicePixelRatio;this._resolutionMediaQueryList=e.matchMedia("all and (resolution: "+t+"dppx)"),this._resolutionMediaQueryList.addListener(this._resolutionListener)},e.prototype._uninstallResolutionListener=function(){null!==this._resolutionMediaQueryList&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},e.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},e.prototype._onResolutionChanged=function(){this._configureCanvas(),this._reinstallResolutionListener()},e}(),i,n;
225
+ var Z$1=function(){return Z$1=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},Z$1.apply(this,arguments)};function $$1(e,t,n,r){return new(n||(n=Promise))(function(t,o){function i(e){try{s(r.next(e))}catch(t){o(t)}}function a(e){try{s(r.throw(e))}catch(t){o(t)}}function s(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n(function(e){e(r)})).then(i,a)}s((r=r.apply(e,[])).next())})}function ee(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function te(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 ne(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))}var re={variant:"filled",size:"md",radius:"md"},ie=1e4,oe="Loading",ae=Symbol("never-pos"),le=function(e,t,n,r,o,i,a,s,l,c,u,d,p,f,h,m){return Z$1(Z$1(Z$1({},n?{leftSection:reactExports.createElement(IconButton,{disabled:c,disableRipple:!h,tabIndex:a,onClick:function(){o&&o(d,e,t,function(e){return p(e,{skipReadonly:!0})},f)}},reactExports.createElement(n,{data:e,payload:t,disabled:c,readonly:u})),leftSectionProps:{style:{width:"auto"}}}:{}),r&&!l?{rightSection:reactExports.createElement(IconButton,{disabled:c,disableRipple:!m,tabIndex:s,onClick:function(){i&&i(d,e,t,function(e){return p(e,{skipReadonly:!0})},f)}},reactExports.createElement(r,{data:e,payload:t,disabled:c,readonly:u})),rightSectionProps:{style:{width:"auto"}}}:{}),l?{rightSection:reactExports.createElement(IconButton,{disabled:c},reactExports.createElement(CircularProgress,{color:"inherit",size:20})),rightSectionProps:{style:{width:"auto"}}}:{})},ue=["Yes","No"],ce=function(e,t,n,r){return $$1(void 0,void 0,void 0,function(){return ee(this,function(o){switch(o.label){case 0:return Array.isArray(e)?[4,Promise.all(e.map(function(e){return t(e,n,r)}))]:[3,2];case 1:case 3:return[2,o.sent()];case 2:return e?[4,t(e,n,r)]:[3,4];case 4:return[2,null]}})})},de=Symbol("never-pos"),se=[],fe="##:##",ve=Symbol("never-pos"),pe={Choose:function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.description,s=void 0===a?"":a,l=e.title,c=void 0===l?"":l,u=e.placeholder,d=void 0===u?"Not chosen":u,p=e.dirty,f=e.outlined,h=e.loading,m=e.inputRef,g=e.onChange,v=e.choose,y=void 0===v?function(){return"unknown"}:v,b=e.tr,x=void 0===b?function(e){return e}:b,$=Ir(),_=Ur().object,C=te(kc(function(){return $$1(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return[4,ce(r,x,_,$)];case 1:return[2,e.sent()]}})})},{deps:[r]}),2),w=C[0],S=C[1].loading,E=no(function(){return $$1(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return r?(g(null),[2]):[4,y(_,$)];case 1:return e=t.sent(),g(Array.isArray(e)?e.length?e:null:e||null),[2]}})})}),k=E.execute,T=E.loading,P=h||S||T;return reactExports.createElement(TextInput,Z$1({},re,{variant:f?"default":"filled",readOnly:!0,ref:m,label:c,error:p&&(t||n),description:s,style:{opacity:o?.5:void 0},rightSection:reactExports.createElement(ui$1,{sx:{pointerEvents:i?"none":"all",mr:1},disabled:P||o,variant:"outlined",size:"small",color:r?"secondary":"primary",onClick:function(){return $$1(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return[4,k()];case 1:return e.sent(),[2]}})})}},r&&"Deselect",!r&&"Choose"),rightSectionProps:{style:{width:"auto"}},value:P?"Loading":String(w||""),placeholder:d,onClick:function(e){var t;null===(t=e.currentTarget)||void 0===t||t.blur(),r||k()},disabled:o}))},Combo:function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=void 0===o?"":o,a=e.placeholder,s=void 0===a?"":a,l=e.outlined,c=void 0!==l&&l,u=e.itemList,d=void 0===u?[]:u,p=e.watchItemList,f=e.noDeselect,h=e.freeSolo,m=e.title,g=void 0===m?"":m,v=e.dirty,y=e.invalid,b=e.incorrect,x=e.tr,$=void 0===x?function(e){return e.toString()}:x,_=e.onChange,C=Ur().object,w=Ir(),S=te(reactExports.useState(function(){return{options:[],labels:{}}}),2),E=S[0],k=S[1],T=reactExports.useRef(!1),P=il([E],10),M=reactExports.useMemo(function(){return Array.isArray(t)?te(t,1)[0]:t},[t]),L=ol().fallback,I=Ai$1(function(e){return $$1(void 0,void 0,void 0,function(){var t,n,r,o,i,a,s;return ee(this,function(l){switch(l.label){case 0:return t={},d=d||[],r=[[]],o=Set.bind,a=(i=Object).values,"function"!=typeof d?[3,2]:[4,Promise.resolve(d(e,w))];case 1:return s=l.sent(),[3,3];case 2:s=d,l.label=3;case 3:return n=ne.apply(void 0,r.concat([te.apply(void 0,[new(o.apply(Set,[void 0,a.apply(i,[s])]))]),!1])),[4,Promise.all(n.map(function(n){return $$1(void 0,void 0,void 0,function(){var r,o;return ee(this,function(i){switch(i.label){case 0:return r=t,o=n,[4,Promise.resolve($(n,e,w))];case 1:return[2,r[o]=i.sent()]}})})}))];case 4:return l.sent(),h&&M&&!n.includes(M)&&n.push(M),k({labels:t,options:n}),T.current=!0,[4,P()];case 5:return l.sent(),[2]}})})},{fallback:L}),R=I.loading,O=I.execute,A=function(e){return Object.values(e||{}).sort(function(e,t){return t.localeCompare(e)}).join("-")}(M),D=reactExports.useRef(null),N=reactExports.useRef(!0);reactExports.useEffect(function(){if(!N.current){if(D.current===C)return;if(!p)return}D.current=C,N.current=!1,O(C)},[A,n,v,y,b,C,r]);var F=reactExports.useMemo(function(){return E.options.map(function(e){return{value:e,label:E.labels[e]||e}})},[E]);return R||!T.current?reactExports.createElement(Select,Z$1({},re,{searchable:!0,variant:c?"default":"filled",disabled:!0,label:g,error:v&&(y||b),description:i,placeholder:"Loading",comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}})):reactExports.createElement(Select,Z$1({},re,{searchable:!0,value:M,style:{opacity:n?.5:void 0},allowDeselect:!f,variant:c?"default":"filled",onChange:function(e){_(e||null)},label:g,disabled:n,readOnly:r,error:v&&(y||b),description:i,placeholder:s,data:F,comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}}))},ComboArray:function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=void 0===o?"":o,a=e.placeholder,s=void 0===a?"":a,l=e.outlined,c=void 0!==l&&l,u=e.itemList,d=void 0===u?[]:u,p=e.watchItemList,f=e.noDeselect,h=e.freeSolo,m=e.title,g=void 0===m?"":m,v=e.dirty,y=e.invalid,b=e.incorrect,x=e.tr,$=void 0===x?function(e){return e.toString()}:x,_=e.onChange,C=Ur().object,w=Ir(),S=te(reactExports.useState(function(){return{options:[],labels:{}}}),2),E=S[0],k=S[1],T=reactExports.useRef(!1),P=il([E],10),M=reactExports.useMemo(function(){return Array.isArray(t)?te(t,1)[0]:t},[t]),L=ol().fallback,I=Ai$1(function(e){return $$1(void 0,void 0,void 0,function(){var t,n,r,o,i,a,s;return ee(this,function(l){switch(l.label){case 0:return t={},d=d||[],r=[[]],o=Set.bind,a=(i=Object).values,"function"!=typeof d?[3,2]:[4,Promise.resolve(d(e,w))];case 1:return s=l.sent(),[3,3];case 2:s=d,l.label=3;case 3:return n=ne.apply(void 0,r.concat([te.apply(void 0,[new(o.apply(Set,[void 0,a.apply(i,[s])]))]),!1])),[4,Promise.all(n.map(function(n){return $$1(void 0,void 0,void 0,function(){var r,o;return ee(this,function(i){switch(i.label){case 0:return r=t,o=n,[4,Promise.resolve($(n,e,w))];case 1:return[2,r[o]=i.sent()]}})})}))];case 4:return l.sent(),h&&M&&!n.includes(M)&&n.push(M),k({labels:t,options:n}),T.current=!0,[4,P()];case 5:return l.sent(),[2]}})})},{fallback:L}),R=I.loading,O=I.execute,A=function(e){return Object.values(e||{}).sort(function(e,t){return t.localeCompare(e)}).join("-")}(M),D=reactExports.useRef(null),N=reactExports.useRef(!0);reactExports.useEffect(function(){if(!N.current){if(D.current===C)return;if(!p)return}D.current=C,N.current=!1,O(C)},[A,n,v,y,b,C,r]);var F=reactExports.useMemo(function(){return E.options.map(function(e){return{value:e,label:E.labels[e]||e}})},[E]);return R||!T.current?reactExports.createElement(Select,Z$1({},re,{searchable:!0,variant:c?"default":"filled",disabled:!0,label:g,error:v&&(y||b),description:i,placeholder:"Loading",comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}})):reactExports.createElement(Select,Z$1({},re,{searchable:!0,value:M,allowDeselect:!f,variant:c?"default":"filled",onChange:function(e){_(e?[e]:null)},label:g,disabled:n,readOnly:r,error:v&&(y||b),description:i,placeholder:s,data:F,style:{opacity:n?.5:void 0},comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}}))},Complete:function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.inputType,s=void 0===a?"text":a,l=e.inputMode,c=void 0===l?"text":l,u=e.inputPattern,d=void 0===u?void 0:u,p=e.description,f=void 0===p?"":p,h=e.keepRaw,m=void 0!==h&&h,g=e.title,v=void 0===g?"":g,y=e.placeholder,b=void 0===y?"":y,x=e.inputAutocomplete,$=void 0===x?"off":x,_=e.dirty,C=e.loading,w=e.tip,S=void 0===w?function(){return["unset"]}:w,E=e.tipSelect,k=e.autoFocus,T=e.outlined,P=e.onChange,M=e.fieldReadonly,L=e.inputFormatterSymbol,I=void 0===L?"0":L,R=e.inputFormatterAllowed,O=e.inputFormatterReplace,A=e.inputFormatterTemplate,D=void 0===A?"":A,N=e.inputFormatter,F=void 0===N?function(e){return yl(e,D,{symbol:I,allowed:R,replace:O})}:N,z=e.withContextMenu,B=tl().isMobile,j=Ir(),H=Ur(),V=H.object,U=H.changeObject,W=uo().requestSubject,Y=ol().fallback,q=void 0===Y?function(e){throw e}:Y,G=bi$1(),K=G.elementRef,X=G.size,Z=reactExports.useRef(null),J=te(reactExports.useState(null),2),Q=J[0],oe=J[1],ie=function(){oe(null)},ae=te(reactExports.useState(-1),2),se=ae[0],le=ae[1],ce=te(reactExports.useState(!1),2),ue=ce[0],pe=ce[1],fe=te(reactExports.useState([]),2),he=fe[0],me=fe[1],ge=C||ue,ve=zr(r),ye=te(ji$1(r,500),1)[0],be=zr(S),xe=zr(V),$e=to$1(P),_e=el({data:V,payload:j,itemList:void 0,tr:void 0,tip:S,keepRaw:!1,onValueChange:P,placeholder:b,title:v,type:Mn$1.Complete,value:r}),Ce=reactExports.useMemo(function(){var e=de;return{render:function(){if("text"===s){var t=Z.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=de)}},pos:function(){var t,n=Z.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<D.length&&D[n]!==I;n++)t+=1;return t}(e)),e}}},[]);reactExports.useLayoutEffect(function(){if(D){var e=Z.current,t=function(){return Ce.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}}},[Z.current]),reactExports.useLayoutEffect(function(){(D||O||R)&&Ce.render()},[r]);var we=reactExports.useMemo(function(){return Gn$1(function(e){return $$1(void 0,void 0,void 0,function(){return ee(this,function(t){switch(t.label){case 0:return le(-1),[4,$e(e)];case 1:return t.sent(),[2]}})})})},[]),Se=reactExports.useMemo(function(){return Gn$1(function(){return $$1(void 0,void 0,void 0,function(){var e,t,n,r,o;return ee(this,function(i){switch(i.label){case 0:pe(!0),i.label=1;case 1:return i.trys.push([1,5,6,7]),"function"!=typeof be.current?[3,3]:[4,be.current(ve.current||"",xe.current,j)];case 2:return t=i.sent(),[3,4];case 3:t=be.current,i.label=4;case 4:if(e=t,!Array.isArray(e))throw new Error("CompleteField tip invalid result");return!m&&ve.current&&(n=String(ve.current||"").toLowerCase(),r=n.split(" "),e=e.filter(function(e){var t=String(e).toLowerCase().split(" "),n=!0;return r.forEach(function(e){n=n&&t.some(function(t){return t.includes(e)})}),n})),e=e.slice(0,100),le(-1),me(ne([],te(new Set(e)),!1)),[3,7];case 5:return o=i.sent(),q(o),[3,7];case 6:return pe(!1),[7];case 7:return[2]}})})})},[]);reactExports.useEffect(function(){open&&Se()},[ye,open]);var Ee=function(){var e;ie(),le(-1),null===(e=Z.current)||void 0===e||e.setSelectionRange(null,null)};return reactExports.useEffect(function(){return z&&W.subscribe(function(){Ee()})},[]),reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("div",{ref:K},reactExports.createElement(TextInput,Z$1({},re,{variant:T?"default":"filled",ref:Z,label:v,error:_&&(t||n),description:f,pattern:d,readOnly:i,style:{opacity:o?.5:void 0},rightSection:reactExports.createElement(IconButton,{onClick:function(e){var t;e.preventDefault(),e.stopPropagation(),ge||open||!r||(we(""),null===(t=Z.current)||void 0===t||t.setSelectionRange(null,null))},disabled:o},ge&&reactExports.createElement(CircularProgress,{color:"inherit",size:20}),!ge&&!open&&!!r&&reactExports.createElement(default_1$i,null)),rightSectionProps:{style:{width:"auto"}},type:s,inputMode:c,autoFocus:k,autoComplete:$,value:String(r||""),placeholder:b,onChange:function(e){var t=e.target,n=t.value;if(D||O||R){n="";for(var r=0;r<t.value.length;r++)n+=t.value[r],n=F(n);Ce.pos()}P(n)},onClick:function(e){var t=e.clientX,n=e.clientY,r=e.target;if(!M)if(B)_e();else{var o=document.elementFromPoint(t,n);oe(o||r)}},onKeyDown:function(e){(function(t){var n;if("Escape"===t)return ie(),le(-1),e.currentTarget.blur(),!0;if("ArrowDown"===t)return le(function(e){return Math.min(Math.max(e+1,0),he.length-1)}),!0;if("ArrowUp"===t)return le(function(e){return Math.min(Math.max(e-1,0),he.length-1)}),!0;if("Enter"===t){var r=he.find(function(e,t){return t===se});if(r)return we(r),null===(n=Z.current)||void 0===n||n.setSelectionRange(r.length,r.length),ie(),le(-1),!0}return!1})(e.key)&&e.preventDefault()},disabled:o}))),reactExports.createElement(Popover$1,{open:!!Q,anchorEl:Q,onClose:Ee,anchorOrigin:{vertical:"bottom",horizontal:"left"},disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0},!!Q&&reactExports.createElement(vi$1,{component:List,sx:{width:X.width,height:he.length?Math.min(36*he.length,250):36,mb:1,maxHeight:"45vh"},minRowHeight:36},!he.length&&reactExports.createElement(ListItem,{disableGutters:!0,dense:!0},reactExports.createElement(ListItemButton,{disableRipple:!0,disableTouchRipple:!0},reactExports.createElement(ListItemText,{primary:ge?"Loading":"No tips"}))),he.map(function(e,t){return reactExports.createElement(ListItem,{disableGutters:!0,dense:!0,key:"".concat(e,"-").concat(t)},reactExports.createElement(ListItemButton,{selected:t===se,onClick:function(t){t.preventDefault(),t.stopPropagation(),we(e),E&&E(e,xe.current,j,U),ie()}},reactExports.createElement(ListItemText,{primary:e})))}))))},Date:function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.outlined,i=e.disabled,a=e.readonly,s=e.description,l=void 0===s?"":s,c=e.placeholder,u=void 0===c?"DD/MM/YYYY":c,d=e.title,p=void 0===d?"Text":d,f=e.dirty,h=e.inputRef,m=e.onChange,g=reactExports.useMemo(function(){if(r){var e=tM.parseDate(r);if(!e)return null;var t=J$1();return(t=(t=(t=t.set("date",e.day)).set("month",e.month-1)).set("year",e.year)).toDate()}return null},[r]);return reactExports.createElement(DateInput,Z$1({},re,{variant:o?"default":"filled",label:p,ref:h,readOnly:a,disabled:i,valueFormat:"DD/MM/YYYY",error:f&&(t||n),description:l,value:g,placeholder:u,style:{opacity:i?.5:void 0},popoverProps:{withinPortal:!0,shadow:"xl",zIndex:ie},onChange:function(e){if(e){var t=J$1(e),n=t.get("date"),r=t.get("month")+1,o=t.get("year");m(new tM.Date(n,r,o).toString())}else m(null)}}))},Items:function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=e.placeholder,a=e.outlined,s=void 0!==a&&a,l=e.itemList,c=void 0===l?[]:l,u=e.freeSolo,d=e.watchItemList,p=e.dirty,f=e.invalid,h=e.incorrect,m=e.title,g=e.tr,v=void 0===g?function(e){return e.toString()}:g,y=e.onChange,b=Ur().object,x=Ir(),$=te(reactExports.useState(function(){return{options:[],labels:{}}}),2),_=$[0],C=$[1],w=reactExports.useRef(!1),S=il([_],10),E=reactExports.useMemo(function(){if("string"==typeof t)return[t];if(t){var e=Object.values(t);return _n$1(e)?[]:e}return[]},[t]),k=reactExports.useRef(E),T=reactExports.useMemo(function(){return sl(k.current,E)?k.current:(k.current=E,E)},[E]),P=ol().fallback,M=Ai$1(function(e){return $$1(void 0,void 0,void 0,function(){var t,n,r,o,i,a,s;return ee(this,function(l){switch(l.label){case 0:return t={},c=c||[],r=[[]],o=Set.bind,a=(i=Object).values,"function"!=typeof c?[3,2]:[4,Promise.resolve(c(e,x))];case 1:return s=l.sent(),[3,3];case 2:s=c,l.label=3;case 3:return n=ne.apply(void 0,r.concat([te.apply(void 0,[new(o.apply(Set,[void 0,a.apply(i,[s])]))]),!1])),[4,Promise.all(n.map(function(n){return $$1(void 0,void 0,void 0,function(){var r,o;return ee(this,function(i){switch(i.label){case 0:return r=t,o=n,[4,Promise.resolve(v(n,e,x))];case 1:return[2,r[o]=i.sent()]}})})}))];case 4:return l.sent(),u&&T.forEach(function(e){n.includes(e)||n.push(e)}),C({options:n,labels:t}),w.current=!0,[4,S()];case 5:return l.sent(),[2]}})})},{fallback:P}),L=M.loading,I=M.execute,R=function(e){return Object.values(e||{}).sort(function(e,t){return t.localeCompare(e)}).join("-")}(T),O=reactExports.useRef(null),A=reactExports.useRef(!0);reactExports.useEffect(function(){if(!A.current){if(O.current===b)return;if(!d)return}O.current=b,A.current=!1,I(b)},[R,n,p,f,h,b,r]);var D=reactExports.useMemo(function(){return _.options.map(function(e){return{value:e,label:_.labels[e]||e}})},[_]);return L||!w.current?reactExports.createElement(MultiSelect,Z$1({},re,{searchable:!0,variant:s?"default":"filled",disabled:!0,label:m,error:p&&(f||h),description:o,placeholder:"Loading",comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}})):reactExports.createElement(MultiSelect,Z$1({},re,{searchable:!0,value:T,variant:s?"default":"filled",onChange:function(e){y((null==e?void 0:e.length)?e:null)},label:m,disabled:n,readOnly:r,error:p&&(f||h),description:o,placeholder:i,style:{opacity:n?.5:void 0},data:D,comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}}))},Text:function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.inputType,s=void 0===a?"text":a,l=e.inputMode,c=void 0===l?"text":l,u=e.inputPattern,d=void 0===u?void 0:u,p=e.description,f=void 0===p?"":p,h=e.title,m=void 0===h?"":h,g=e.leadingIcon,v=e.trailingIcon,y=e.leadingIconClick,b=e.trailingIconClick,x=e.leadingIconTabIndex,$=e.trailingIconTabIndex,_=e.leadingIconRipple,C=void 0===_||_,w=e.trailingIconRipple,S=void 0===w||w,E=e.inputRows,k=void 0===E?1:E,T=e.placeholder,P=void 0===T?"":T,M=e.inputAutocomplete,L=void 0===M?"off":M,I=e.inputFormatterSymbol,R=void 0===I?"0":I,O=e.inputFormatterAllowed,A=e.inputFormatterReplace,D=e.inputFormatterTemplate,N=void 0===D?"":D,F=e.inputFormatter,z=void 0===F?function(e){return yl(e,N,{symbol:R,allowed:O,replace:A})}:F,B=e.dirty,j=e.outlined,H=e.loading,V=e.autoFocus,U=e.inputRef,W=e.onChange,Y=Ir(),q=Ur(),G=q.object,K=q.changeObject,X=reactExports.useRef(),Z=reactExports.useMemo(function(){var e=ae;return{render:function(){if("text"===s){var t=X.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=ae)}},pos:function(){var t,n=X.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<N.length&&N[n]!==R;n++)t+=1;return t}(e)),e}}},[]);return reactExports.useLayoutEffect(function(){if(N){var e=X.current,t=function(){return Z.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}}},[X.current]),reactExports.useLayoutEffect(function(){(N||A||O)&&Z.render()},[r]),k>1?reactExports.createElement(Textarea,Z$1({},re,{ref:function(e){X.current=e,U&&U(e)},label:m,error:B&&(t||n),autosize:!0,minRows:k,maxRows:k,description:f,inputMode:c,autoFocus:V,readOnly:i,autoComplete:L,style:{opacity:o?.5:void 0},value:H?oe:String(r||""),placeholder:P},le(G,Y,g,v,y,b,x,$,H,o,!!i,(r||"").toString(),W,K,C,S),{onChange:function(e){var t=e.target;return W(t.value)},disabled:o})):reactExports.createElement(TextInput,Z$1({},re,{variant:j?"default":"filled",ref:function(e){X.current=e,U&&U(e)},style:{opacity:o?.5:void 0},label:m,error:B&&(t||n),description:f,pattern:d,type:s,inputMode:c,autoFocus:V,autoComplete:L,readOnly:i,value:H?oe:String(r||""),placeholder:P},le(G,Y,g,v,y,b,x,$,H,o,!!i,(r||"").toString(),W,K,C,S),{onChange:function(e){var t=e.target,n=t.value;if(N||A||O){n="";for(var r=0;r<t.value.length;r++)n+=t.value[r],n=z(n);Z.pos()}W(n)},disabled:o}))},Time:function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.description,s=void 0===a?"":a,l=e.title,c=void 0===l?"Text":l,u=e.placeholder,d=void 0===u?tM.TIME_PLACEHOLDER:u,p=e.dirty,f=e.outlined,h=e.inputRef,m=e.onChange,g=e.withContextMenu,v=uo().requestSubject,y=reactExports.useRef(),b=reactExports.useRef(!1),x=reactExports.useRef(!1),$=te(reactExports.useState(null),2),_=$[0],C=$[1],w=function(){C(null)},S=te(reactExports.useState(tM.parseTime(r||"")?r:""),2),E=S[0],k=S[1],T=zr(E);reactExports.useEffect(function(){x.current?x.current=!1:tM.parseTime(r||"")?(b.current=!0,k(r)):T.current&&(b.current=!0,k(""))},[r]);var P=zr(r);reactExports.useEffect(function(){if(b.current)b.current=!1;else{var e=tM.parseTime(E||"");e?(x.current=!0,m(tM.serializeTime(e))):P.current&&(x.current=!0,m(""))}},[E]);var M=reactExports.useMemo(function(){if(E){var e=tM.parseTime(E);if(!e)return;var t=J$1();return(t=t.set("hour",e.hour)).set("minute",e.minute)}},[E]),L=reactExports.useMemo(function(){var e=ve;return{render:function(){var t=y.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=ve)},pos:function(){var t,n=y.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<5&&"#"!==fe[n];n++)t+=1;return t}(e)),e}}},[]);return reactExports.useLayoutEffect(function(){var e=y.current,t=function(){return L.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}},[y.current]),reactExports.useLayoutEffect(function(){L.render()},[E]),reactExports.useEffect(function(){return g&&v.subscribe(w)},[]),reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(TextInput,Z$1({},re,{variant:f?"default":"filled",ref:function(e){y.current=e,h&&h(e)},type:"text",readOnly:i,rightSection:reactExports.createElement(IconButton,{onClick:function(e){var t=e.clientX,n=e.clientY,r=e.target,o=document.elementFromPoint(t,n);C(o||r)},disabled:o},reactExports.createElement(default_1$j,null)),rightSectionProps:{style:{width:"auto"}},style:{opacity:o?.5:void 0},disabled:o,placeholder:d,value:E,label:c,error:p&&(t||n),description:s,onChange:function(e){return function(e){for(var t="",n=0;n<e.length;n++)t+=e[n],t=yl(t,fe,{allowed:/\d/,symbol:"#"});L.pos(),k(t)}(e.target.value)}})),reactExports.createElement(Popover$1,{open:!!_,anchorEl:_,onClose:w,anchorOrigin:{vertical:"bottom",horizontal:"right"}},reactExports.createElement(yc,{date:M,onChange:function(e){if(e){var t=e.get("hour"),n=e.get("minute");k(new tM.Time(t,n).toString())}else k(null)}})))},Tree:function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.description,s=void 0===a?"":a,l=e.outlined,c=void 0!==l&&l,u=e.title,d=void 0===u?"":u,p=e.placeholder,f=void 0===p?"":p,h=e.dirty,m=e.loading,g=e.onChange,v=e.itemTree,y=void 0===v?se:v,b=e.watchItemTree,x=Ur().object,$=Ir(),_=te(reactExports.useState(function(){return{options:[],labels:{}}}),2),C=_[0],w=_[1],S=reactExports.useRef(!1),E=il([C],10),k=reactExports.useMemo(function(){if("string"==typeof r)return[r];if(r){var e=Object.values(r);return _n$1(e)?[]:e}return[]},[r]),T=reactExports.useRef(k),P=reactExports.useMemo(function(){return sl(T.current,k)?T.current:(T.current=k,k)},[k]),M=ol().fallback,L=Ai$1(function(e){return $$1(void 0,void 0,void 0,function(){var t,n,r;return ee(this,function(o){switch(o.label){case 0:return t={},n=[],"function"!=typeof y?[3,2]:[4,y(e,$)];case 1:return r=o.sent(),[3,3];case 2:r=y,o.label=3;case 3:return function(e){void 0===e&&(e=[]);var t=[],n=function(e){return void 0===e&&(e=[]),e.forEach(function(e){var r=e.child||[];n(ne([],te(r),!1)),t.push(e)})};return n(e),t}(r).forEach(function(e){var r=e.label,o=e.value;e.child||(n.push(o),t[o]=r)}),w({options:n,labels:t}),S.current=!0,[4,E()];case 4:return o.sent(),[2]}})})},{fallback:M}),I=L.loading,R=L.execute,O=function(e){return Object.values(e||{}).sort(function(e,t){return t.localeCompare(e)}).join("-")}(P),A=reactExports.useRef(null),D=reactExports.useRef(!0);reactExports.useEffect(function(){if(!D.current){if(A.current===x)return;if(!b)return}A.current=x,D.current=!1,R(x)},[O,o,h,t,n,x,i]);var N=reactExports.useMemo(function(){return C.options.map(function(e){return{value:e,label:C.labels[e]||e}})},[C]);return I||m||!S.current?reactExports.createElement(MultiSelect,Z$1({},re,{searchable:!0,variant:c?"default":"filled",disabled:!0,label:d,error:h&&(t||n),description:s,placeholder:"Loading",comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}})):reactExports.createElement(MultiSelect,Z$1({},re,{searchable:!0,value:P,variant:c?"default":"filled",onChange:function(e){g((null==e?void 0:e.length)?e:null)},label:d,disabled:o,readOnly:i,error:h&&(t||n),description:s,placeholder:f,data:N,style:{opacity:o?.5:void 0},comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}}))},YesNo:function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=void 0===o?"":o,a=e.placeholder,s=void 0===a?"":a,l=e.noDeselect,c=e.title,u=void 0===c?"":c,d=e.tr,p=void 0===d?function(e){return e}:d,f=e.outlined,h=e.dirty,m=e.invalid,g=e.incorrect,v=e.onChange,y=te(reactExports.useState({}),2),b=y[0],x=y[1],$=reactExports.useRef(!1),_=Ir(),C=Ur().object,w=reactExports.useMemo(function(){return!0===t?"Yes":!1===t?"No":null},[t]),S=ol().fallback,E=Ai$1(function(){return $$1(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return e={},[4,Promise.all(ue.map(function(t){return $$1(void 0,void 0,void 0,function(){var n,r;return ee(this,function(o){switch(o.label){case 0:return n=e,r=t,[4,Promise.resolve(p(t,C,_))];case 1:return[2,n[r]=o.sent()]}})})}))];case 1:return t.sent(),x(e),$.current=!0,[2]}})})},{fallback:S}),k=E.loading,T=E.execute;reactExports.useEffect(function(){T()},[]);var P=reactExports.useMemo(function(){return ue.map(function(e){return{value:e,label:b[e]}})},[b]);return k||!$.current?reactExports.createElement(Select,Z$1({},re,{variant:f?"default":"filled",disabled:!0,label:u,error:h&&(m||g),description:i,placeholder:"Loading",comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}})):reactExports.createElement(Select,Z$1({},re,{value:w,allowDeselect:!l,variant:f?"default":"filled",onChange:function(e){v("Yes"===e||"No"!==e&&null)},label:u,disabled:n,readOnly:r,error:h&&(m||g),description:i,placeholder:s,data:P,style:{opacity:n?.5:void 0},comboboxProps:{withinPortal:!0,shadow:"xl",zIndex:ie}}))},Switch:function(e){var t=e.disabled,n=e.value,r=e.onChange,o=e.title,i=e.switchActiveLabel;return reactExports.createElement(Switch,{size:"md",mt:"xs",mb:"xs",style:{opacity:t?.5:void 0},checked:Boolean(n),disabled:t,onChange:function(){return r(!n)},label:i||o})},Radio:function(e){var t=e.disabled,n=e.onChange,r=e.title,o=e.radioValue,i=e.readonly,a=e.value,s=e.name,l=void 0===s?"":s,c=te(gl(),2),u=c[0],d=c[1],p=zr(u),f=reactExports.useMemo(function(){return u[l]===o},[u]),h=reactExports.useCallback(function(e){return d(function(t){var n;return Z$1(Z$1({},t),((n={})[l]=e,n))})},[]),m=reactExports.useCallback(function(e){h(e),n(e)},[]);return reactExports.useEffect(function(){var e=p.current;a!==e[l]&&h(a)},[a]),reactExports.createElement(Radio,{size:"md",mt:"xs",mb:"xs",checked:f,readOnly:i,style:{opacity:t?.5:void 0},disabled:t,onChange:function(){i||m(o||null)},label:r})},Slider:function(e){var t=e.disabled,n=e.value,r=e.onChange,o=e.minSlider,i=e.maxSlider,a=e.sliderSteps,s=e.stepSlider,l=e.labelFormatSlider;return reactExports.createElement(Slider,{size:"xl",mt:"xs",mb:"xs",style:{opacity:t?.5:void 0},step:s,label:l,value:n,min:o,max:i,disabled:t,marks:a,onChange:function(e){return r(e)}})},CheckBox:function(e){var t=e.disabled,n=e.onChange,r=e.title,o=e.value;return reactExports.createElement(Checkbox,{size:"md",mt:"xs",mb:"xs",disabled:t,style:{opacity:t?.5:void 0},checked:Boolean(o),onChange:function(){return n(!o)},label:r})}};const defaultSlots={Choose:pe.Choose,Combo:pe.Combo,ComboArray:pe.ComboArray,Complete:pe.Complete,Date:pe.Date,Items:pe.Items,Text:pe.Text,Time:pe.Time,Tree:pe.Tree,YesNo:pe.YesNo,Switch:pe.Switch,Radio:pe.Radio,Slider:pe.Slider,CheckBox:pe.CheckBox},OneSlotFactory=({children:e})=>factory$1(ru$1,{...defaultSlots,children:e}),ErrorProvider=({children:e})=>{const[t,n]=reactExports.useState(!1);return reactExports.useEffect(()=>ioc.errorService.errorSubject.subscribe(()=>{n(!0)}),[]),factory$1(Fragment,{children:[e,!!t&&factory$1(ErrorView,{})]})},Object$=Object,Map$=Map,Set$=Set,SetHas$=Set$.prototype.has,SetAdd$=Set$.prototype.add,MapHas$=Map$.prototype.has,MapGet$=Map$.prototype.get,MapSet$=Map$.prototype.set,ChildFlag=1,AttributeFlag=2,EventFlag=4,StyleAttributeFlag=8,SvgAttributeFlag=16,BlockFlag=32,TEXT_NODE_CACHE="__t",EVENT_PATCH="__p",EVENTS_REGISTRY="__e",IS_NON_DIMENSIONAL=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,XLINK_NS="http://www.w3.org/1999/xlink",XML_NS="http://www.w3.org/2000/xmlns/",X_CHAR=120,NON_PROPS=new Set$(["href","list","form","tabIndex","download"]),VOID_ELEMENTS=new Set$(["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","isindex","keygen","link","menuitem","meta","nextid","param","source","track","wbr"]);if("undefined"==typeof window)throw new Error("See http://million.dev/docs/install to install the compiler.");const document$=document;document$.createElement("template");const HTM_TEMPLATE=document$.createElement("template"),HTM_TEMPLATE_CONTENT=HTM_TEMPLATE.content,SVG_TEMPLATE=document$.createElementNS("http://www.w3.org/2000/svg","svg"),node$=Node.prototype,element$=Element.prototype,characterData$=CharacterData.prototype,getOwnPropertyDescriptor$=Object$.getOwnPropertyDescriptor,insertBefore$=node$.insertBefore,cloneNode$=node$.cloneNode,replaceChild$=node$.replaceChild,remove$$1=element$.remove,addEventListener$=node$.addEventListener,removeAttribute$=element$.removeAttribute,setAttribute$=element$.setAttribute,setAttributeNS$=element$.setAttributeNS,setTextContent$=getOwnPropertyDescriptor$(node$,"textContent").set,firstChild$=getOwnPropertyDescriptor$(node$,"firstChild").get,nextSibling$=getOwnPropertyDescriptor$(node$,"nextSibling").get,characterDataSet$=getOwnPropertyDescriptor$(characterData$,"data").set,stringToDOM=(e,t)=>{(t?SVG_TEMPLATE:HTM_TEMPLATE).innerHTML=e;return(t?SVG_TEMPLATE:HTM_TEMPLATE_CONTENT).firstChild};document$[EVENTS_REGISTRY]=new Set$;const createEventListener=(e,t,n)=>{let r=t.toLowerCase(),o=!1;r.endsWith("capture")&&(r=r.slice(0,-7),o=!0);const i=`$$${r}`;SetHas$.call(document$[EVENTS_REGISTRY],r)||(addEventListener$.call(document$,r,e=>{let t=e.target;for(;t;){const n=t[i];n&&(Object$.defineProperty(e,"currentTarget",{configurable:!0,get:()=>t}),n(e)),t=t.parentNode}},{capture:o}),SetAdd$.call(document$[EVENTS_REGISTRY],r));const a=t=>{var n;t?"key"in t&&t.key===(null==(n=e[i])?void 0:n.key)||(e[i]=t):e[i]=null};return a(n),a},childAt=(e,t)=>{let n=firstChild$.call(e);if(t)for(let r=0;r<t&&n;++r)n=nextSibling$.call(n);return n},visitedNodes=new WeakSet,removeComments=e=>{var t;if(visitedNodes.has(e))return;8===e.nodeType&&(null==(t=e.parentNode)||t.removeChild(e));let n=firstChild$.call(e);for(;n;)removeComments(n),n=n.nextSibling;visitedNodes.add(e)},insertText=(e,t,n)=>{const r=document$.createTextNode(t),o=childAt(e,n);return insertBefore$.call(e,r,o),r},setText=(e,t)=>{characterDataSet$.call(e,t)},setStyleAttribute=(e,t,n)=>{"number"!=typeof n||IS_NON_DIMENSIONAL.test(t)?e.style[t]=n:"string"==typeof n?e.style.cssText=n:t.startsWith("-")?e.style.setProperty(t,String(n)):e.style[t]=null==n?"":`${String(n)}px`},setSvgAttribute=(e,t,n)=>{(t=t.replace(/xlink(?:H|:h)/,"h").replace(/sName$/,"s")).startsWith("xmlns")?setAttributeNS$.call(e,XML_NS,t,String(n)):t.startsWith("xlink")&&setAttributeNS$.call(e,XLINK_NS,"href",String(n))},setAttribute=(e,t,n)=>{const r=null==n;if(n=r?"":n,!(t in e)||void 0===e[t]||null===e[t]||e instanceof SVGElement||!SetHas$.call(NON_PROPS,t))r||""===n||!1===n&&!t.includes("-")?removeAttribute$.call(e,t):setAttribute$.call(e,t,String(n));else try{e[t]=n}catch(s){}const o=e instanceof HTMLInputElement,i=e instanceof HTMLSelectElement,a=e instanceof HTMLTextAreaElement;"value"===t&&(o||i||a)&&(setAttribute$.call(e,t,String(n)),e.value=n)},aliases=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]);function getAttributeAlias(e){return aliases.get(e)||e}var __defProp$1=Object.defineProperty,__defNormalProp$1=(e,t,n)=>t in e?__defProp$1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__publicField$1=(e,t,n)=>(__defNormalProp$1(e,"symbol"!=typeof t?t+"":t,n),n);class AbstractBlock{constructor(){__publicField$1(this,"r"),__publicField$1(this,"e"),__publicField$1(this,"l"),__publicField$1(this,"g"),__publicField$1(this,"_u"),__publicField$1(this,"_t"),__publicField$1(this,"d"),__publicField$1(this,"k"),__publicField$1(this,"c")}}const renderToTemplate=(e,t=[],n=[])=>{var r,o;if("string"==typeof e)return e;if("number"==typeof e||"bigint"==typeof e||!0===e)return String(e);if(null==e||!1===e)return"";if("object"==typeof e&&"$"in e)return t.push({p:n,e:[{t:ChildFlag,n:null,v:null,h:e.$,i:0,l:null,p:null,b:null}],i:[]}),"<slot/>";let i="",a="";const s={p:n,e:[],i:[]};for(let c in e.props){const t=e.props[c];if("key"===c||"ref"===c||"children"===c)continue;const n=getAttributeAlias(c);if(n&&(c=n),"className"===c&&(c="class"),c.startsWith("on")){"$"in t?s.e.push({t:EventFlag,n:c.slice(2),v:null,h:t.$,i:null,l:null,p:null,b:null}):s.i.push({t:EventFlag,n:c.slice(2),v:null,h:null,i:null,l:t,p:null,b:null});continue}if(t){if("object"==typeof t&&"$"in t){"style"===c?s.e.push({t:StyleAttributeFlag,n:c,v:null,h:t.$,i:null,l:null,p:null,b:null}):c.charCodeAt(0)===X_CHAR?s.e.push({t:SvgAttributeFlag,n:c,v:null,h:t.$,i:null,l:null,p:null,b:null}):s.e.push({t:AttributeFlag,n:c,v:null,h:t.$,i:null,l:null,p:null,b:null});continue}if("style"===c&&"object"==typeof t){let e="";for(const n in t){if("object"==typeof t[n]){s.e.push({t:StyleAttributeFlag,n:n,v:null,h:t[n].$,i:null,l:null,p:null,b:null});continue}let r="";for(let e=0,t=n.length;e<t;++e){const t=n.charCodeAt(e);r+=t<97?`-${String.fromCharCode(t+32)}`:n[e]}e+=`${r}:${String(t[n])};`}i+=` style="${e}"`;continue}i+=` ${c}="${String(t)}"`}}if(SetHas$.call(VOID_ELEMENTS,e.type))return s.e.length&&t.push(s),`<${e.type}${i} />`;let l=!1;for(let c=0,u=(null==(r=e.props.children)?void 0:r.length)||0,d=0;c<u;++c){const r=null==(o=e.props.children)?void 0:o[c];if(null==r||!1===r)continue;if("object"==typeof r&&"$"in r){s.e.push({t:ChildFlag,n:null,v:null,h:r.$,i:c,l:null,p:null,b:null});continue}if(r instanceof AbstractBlock){s.i.push({t:BlockFlag,n:null,v:null,h:null,i:c,l:null,p:null,b:r});continue}if("string"==typeof r||"number"==typeof r||"bigint"==typeof r){const e="number"==typeof r||"bigint"==typeof r?String(r):r;if(l){s.i.push({t:ChildFlag,n:null,v:e,h:null,i:c,l:null,p:null,b:null});continue}l=!0,a+=e,d++;continue}l=!1;const i=n.slice();i.push(d++),a+=renderToTemplate(r,t,i)}return(s.i.length||s.e.length)&&t.push(s),`<${e.type}${i}>${a}</${e.type}>`};var __defProp=Object.defineProperty,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__publicField=(e,t,n)=>(__defNormalProp(e,t+"",n),n);const mapArray=e=>new ArrayBlock(e);class ArrayBlock extends AbstractBlock{constructor(e){super(),__publicField(this,"b"),this.b=e}v(){}p(e){const t=this.b,n=e.b,r=t.length,o=n.length,i=this.t();if(this===e)return i;if(0===o&&0===r)return i;if(this.b=n,0===o)return arrayRemove$.call(this),i;if(0===r)return arrayMount$.call(e,i),i;let a,s=0,l=0,c=r-1,u=o-1,d=t[0],p=n[0],f=t[c],h=n[u];for(;s<=c&&l<=u;){if(!d){d=t[++s];continue}if(!f){f=t[--c];continue}const e=d.k,r=p.k;if(e===r){patch$.call(d,p),n[l]=d,d=t[++s],p=n[++l];continue}const o=f.k,m=h.k;if(o===m){patch$.call(f,h),n[u]=f,f=t[--c],h=n[--u];continue}if(e===m){patch$.call(d,h),n[u]=d;const e=n[u+1];move$.call(d,e,(null==e?void 0:e.l)||null),d=t[++s],h=n[--u];continue}if(o===r){patch$.call(f,p),n[l]=f;const e=t[s];move$.call(f,e,(null==e?void 0:e.l)||null),f=t[--c],p=n[++l];continue}if(!a){a=new Map$;for(let e=s;e<=c;e++)MapSet$.call(a,t[e].k,e)}const g=a.get(r);if(void 0===g)mount$.call(p,i,d.l||null);else{const e=t[g];move$.call(e,d,null),patch$.call(e,p),n[l]=e,t[g]=null}p=n[++l]}if(s<=c||l<=u)if(s>c){const e=n[u+1];for(let t=l;t<=u;++t)mount$.call(n[t],i,e?e.l:null)}else for(let m=s;m<=c;++m)remove$.call(t[m]);return i}m(e,t=null){if(this._t)return this._t;for(let n=0,r=this.b.length;n<r;++n){const r=this.b[n];mount$.call(r,e,t)}return this._t=e,e}x(){const e=this.t();if(e)setTextContent$.call(e,"");else for(let t=0,n=this.b.length;t<n;++t)remove$.call(this.b[t]);this.b=[]}u(){return!0}s(){return this.b.map(e=>e.s()).join("")}t(){return this._t||(this._t=this.b[0].t()),this._t}}const array$=ArrayBlock.prototype,arrayMount$=array$.m,arrayPatch$=array$.p,arrayRemove$=array$.x,HOLE_PROXY=new Proxy({},{get:(e,t)=>({$:t})}),block$1=(e,t,n,r)=>{const o=e(HOLE_PROXY),i=[],a=stringToDOM(renderToTemplate(t?t(o):o,i),r);return removeComments(a),(e,t,r)=>new Block(a,i,e,t??(null==e?void 0:e.key)??null,r??n??null,null)},patch=(e,t)=>{if(("b"in e||"b"in t)&&arrayPatch$.call(e,t),e.l||mount$.call(e,void 0,null,null),e.k&&e.k===t.k||e.r===t.r)return patch$.call(e,t);const n=mount$.call(t,e.t(),e.l,null);return remove$.call(e),e.k=t.k,n};class Block extends AbstractBlock{constructor(e,t,n,r,o,i){super(),this.r=e,this.d=n,this.e=t,this.k=r,this.c=Array(t.length),this._u=o||null,this.g=i||null}m(e,t=null,n){var r,o;if(this.l)return this.l;const i=n??cloneNode$.call(this.r,!0),a=null==(r=this.g)?void 0:r.call(this,i);a&&(this.c=a);for(let s=0,l=this.e.length;s<l;++s){const e=this.e[s],t=(null==a?void 0:a[s])??getCurrentElement(e.p,i,this.c,s);for(let o=0,i=e.e.length;o<i;++o){const r=e.e[o],a=this.d[r.h];if(r.t&ChildFlag){if(a instanceof AbstractBlock){const e=childAt(t,r.i);n?a.m(t,e,e):a.m(t,e);continue}if(t[TEXT_NODE_CACHE]||(t[TEXT_NODE_CACHE]=new Array(i)),a&&"object"==typeof a&&"foreign"in a){if(n){const e=childAt(t,r.i);a.reset(e)}const e=a.current;t[TEXT_NODE_CACHE][o]=e,n||insertBefore$.call(t,e,childAt(t,r.i));continue}if(n){t[TEXT_NODE_CACHE][o]=childAt(t,r.i);continue}t[TEXT_NODE_CACHE][o]=insertText(t,null==a||!1===a?"":String(a),r.i)}else if(r.t&EventFlag){const e=createEventListener(t,r.n,a);t[EVENT_PATCH+r.n]=e}else if(r.t&AttributeFlag)setAttribute(t,r.n,a);else if(r.t&StyleAttributeFlag)if("string"==typeof a||"number"==typeof a)setStyleAttribute(t,r.n,a);else for(const e in a)setStyleAttribute(t,e,a[e]);else setSvgAttribute(t,r.n,a)}const r=null==(o=e.i)?void 0:o.length;if(r)for(let o=0;o<r;++o){const r=e.i[o];if(r.t&ChildFlag)r.v&&!n&&insertText(t,r.v,r.i);else if(r.t&EventFlag)createEventListener(t,r.n,r.l);else{const e=childAt(t,r.i);n?r.b.m(t,e,e):r.b.m(t,e)}}}return e&&!n&&insertBefore$.call(e,i,t),this.l=i,i}p(e){var t,n;const r=this.l;if(!e.d)return r;const o=this.d;if(!shouldUpdate$.call(this,o,e.d))return r;this.d=e.d;for(let i=0,a=this.e.length;i<a;++i){const a=this.e[i],s=this.c[i]??getCurrentElement(a.p,r,this.c,i);for(let r=0,l=a.e.length;r<l;++r){const l=a.e[r],c=o[l.h],u=e.d[l.h];if(u!==c)if(l.t&EventFlag)s[EVENT_PATCH+l.n](u);else if(l.t&ChildFlag){if(c instanceof AbstractBlock){const o=null==(n=null==(t=e.e)?void 0:t[i])?void 0:n.e[r],a=e.d[o.h];c.p(a);continue}if(u&&"object"==typeof u&&"foreign"in u){const e=s[TEXT_NODE_CACHE][r];if(u.unstable&&c!==u){const t=u.current;s[TEXT_NODE_CACHE][r]=t,replaceChild$.call(s,t,e)}else u.current=e;continue}setText(s[TEXT_NODE_CACHE][r],null==u||!1===u?"":String(u))}else if(l.t&AttributeFlag)setAttribute(s,l.n,u);else if(l.t&StyleAttributeFlag)if("string"==typeof u||"number"==typeof u)setStyleAttribute(s,l.n,u);else for(const e in u)u[e]!==c[e]&&setStyleAttribute(s,e,u[e]);else setSvgAttribute(s,l.n,u)}}return r}v(e=null,t=null){insertBefore$.call(this.t(),this.l,e?e.l:t)}x(){remove$$1.call(this.l),this.l=null}u(e,t){return!this._u||this._u(e,t)}s(){var e;return String(null==(e=this.l)?void 0:e.outerHTML)}t(){var e;return this._t||(this._t=null==(e=this.l)?void 0:e.parentElement),this._t}}const getCurrentElement=(e,t,n,r)=>{const o=e.length;if(!o)return t;const i=n&&void 0!==r;if(i&&n[r])return n[r];for(let a=0;a<o;++a){const n=e[a];t=childAt(t,n)}return i&&(n[r]=t),t},block$=Block.prototype,mount$=block$.m,patch$=block$.p,move$=block$.v,remove$=block$.x,shouldUpdate$=block$.u,experimental_options={noSlot:!1},RENDER_SCOPE="slot",SVG_RENDER_SCOPE="g",Effect=({effect:e,deps:t})=>(reactExports.useEffect(e,t||[]),null),REGISTRY=new Map,scopedContext=reactExports.createContext(!1),processProps=(e,t,n)=>{const r={ref:t};let o=0;for(const i in e){const t=e[i];reactExports.isValidElement(t)||Array.isArray(t)&&t.length&&reactExports.isValidElement(t[0])?r[i]=renderReactScope(t,!1,n,o++):r[i]=e[i]}return r},wrap=(e,t)=>reactExports.createElement(RENDER_SCOPE,{suppressHydrationWarning:!0,id:t},e),renderReactScope=(e,t,n,r,o)=>{var i;const a=null==(i=null==n?void 0:n[r])?void 0:i.current,s=reactExports.isValidElement(e)&&"function"==typeof e.type&&"_c"in e.type,l=s&&e.type._c;if("undefined"==typeof window)return s?l?e:wrap(wrap(e),o):wrap(e,o);if(l){const t=e.type(e.props);if(REGISTRY.has(t.type)){const e=REGISTRY.get(t.type);if("function"==typeof e)return e(t.props)}}const c=a??null??document.createElement(RENDER_SCOPE),u={foreign:!0,current:c,portal:reactDomExports.createPortal(reactExports.createElement(reactExports.Fragment,{children:e}),c,o),reset:e=>{e.childNodes.forEach(t=>e.removeChild(t))},unstable:t};return n&&(n[r]=u),u},unwrap=e=>{var t;if("object"!=typeof e||null===e||!("type"in e))return"number"==typeof e?String(e):e;let n=e.type;if("function"==typeof n)return unwrap(n(e.props??{}));if("object"==typeof n&&"$"in n)return n;const r={...e.props};"css"in r&&"__EMOTION_TYPE_PLEASE_DO_NOT_USE__"in r&&(r.style=r.css.styles,n=r.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,delete r.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,delete r.css);const o=null==(t=e.props)?void 0:t.children;return null!=o&&(r.children=flatten(e.props.children).map(e=>unwrap(e))),{type:n,props:r}},flatten=e=>{if(null==e)return[];if("object"==typeof e&&"type"in e&&e.type===reactExports.Fragment)return flatten(e.props.children);if(!Array.isArray(e)||"object"==typeof e&&"$"in e)return[e];const t=e.flat(1/0),n=[];for(let r=0,o=t.length;r<o;++r)n.push(...flatten(t[r]));return n},useLayoutEffect="undefined"==typeof window?reactExports.useEffect:reactExports.useLayoutEffect;function traverse(e,t,n){if(!e||t(e))return e;let r=e.return;for(;r;){const e=traverse(r,t);if(e)return e;r=null}}function useFiber(){const e=reactExports.useRef();return reactExports.useState(()=>{const t=Function.prototype.bind;Function.prototype.bind=function(n,r){return null===n&&"function"==typeof(null==r?void 0:r.type)&&(e.current=r,Function.prototype.bind=t),t.apply(this,arguments)}}),e.current}function useNearestParent(e){const t=useFiber(),n=reactExports.useRef({el:null,depth:0});return useLayoutEffect(()=>{var r;n.current.el=null==(r=traverse(t,t=>(n.current.depth++,"string"==typeof t.type&&void 0===e)))?void 0:r.stateNode},[t]),n}function useContainer(){const e=useFiber(),t=reactExports.useRef({el:null,depth:0});return useLayoutEffect(()=>{var n;t.current.el=null==(n=traverse(e,e=>{var n;return t.current.depth++,null!=(null==(n=e.stateNode)?void 0:n.containerInfo)}))?void 0:n.stateNode.containerInfo},[e]),t}const block=(e,t={})=>{const n=(null==t?void 0:t.experimental_noSlot)??experimental_options.noSlot;let r=null==t?void 0:t.block;const o=(null==t?void 0:t.svg)?SVG_RENDER_SCOPE:RENDER_SCOPE;e&&(r=block$1(e,unwrap,null==t?void 0:t.shouldUpdate,null==t?void 0:t.svg));const i=(e,i)=>{var a,s;const l=useContainer(),c=useNearestParent(),u=e._hmr,d=reactExports.useRef(null),p=reactExports.useRef(null),f=reactExports.useRef([]);e=processProps(e,i,f.current),null==(a=p.current)||a.call(p,e);const h=reactExports.useCallback(()=>{var o,i,a;if(!d.current&&!n)return;const s=r(e,e.key);return u&&(null==(o=d.current)?void 0:o.textContent)&&(d.current.textContent=""),n&&(d.current=(null==(i=c.current)?void 0:i.el)??(null==(a=l.current)?void 0:a.el),(e.scoped||c.current&&l.current&&c.current.depth>l.current.depth)&&(d.current=l.current.el),d.current.childNodes.length&&console.error(new Error(`\`experimental_options.noSlot\` does not support having siblings at the moment.\nThe block element should be the only child of the \`${cloneNode$.call(d.current).outerHTML}\` element.\nTo avoid this error, \`experimental_options.noSlot\` should be false`))),(null===p.current||u)&&(mount$.call(s,d.current,null),p.current=e=>{patch(s,r(e,e.key,null==t?void 0:t.shouldUpdate))}),()=>{remove$.call(s)}},[]),m=reactExports.useMemo(()=>n?null:reactExports.createElement((null==t?void 0:t.as)??o,{ref:d}),[]),g=f.current.length,v=new Array(g);for(let t=0;t<g;++t)v[t]=null==(s=f.current[t])?void 0:s.portal;return reactExports.createElement(reactExports.Fragment,{},m,reactExports.createElement(Effect,{effect:h,deps:u?[u]:[]}),v)};return MapHas$.call(REGISTRY,i)||MapSet$.call(REGISTRY,i,block),(null==t?void 0:t.name)&&(e&&(e.displayName=`Million(Render(${t.name}))`),i.displayName=`Million(Block(${t.name}))`),i},MillionArray=({each:e,children:t,memo:n,svg:r,as:o,...i})=>{const a=reactExports.useRef(null),[s]=reactExports.useState(()=>({current:Array(e.length)})),l=reactExports.useRef(null),c=reactExports.useRef({each:null,children:null,mounted:!1}),[,u]=reactExports.useState(!1);if(l.current&&(e!==c.current.each||!n)){const r=createChildren(e,t,c,s,n);arrayPatch$.call(l.current,mapArray(r))}const d=r?SVG_RENDER_SCOPE:RENDER_SCOPE,p=reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(o??d,{...i,ref:a}),...s.current.map(e=>e.portal));return reactExports.useEffect(()=>{if(!a.current||l.current)return;if(c.current.mounted)return;const r=createChildren(e,t,c,s,n);l.current=mapArray(r),MapHas$.call(REGISTRY,p)||MapSet$.call(REGISTRY,p,l.current),arrayMount$.call(l.current,a.current),c.current.mounted=!0,u(!0)},[a.current]),p},typedMemo=reactExports.memo;typedMemo(MillionArray);const createChildren=(e,t,n,r,o)=>{var i;const a=Array(e.length),s=n.current;for(let l=0,c=e.length;l<c;++l){if(o&&s.each&&s.each[l]===e[l]){a[l]=null==(i=s.children)?void 0:i[l];continue}const n=t(e[l],l);if(MapHas$.call(REGISTRY,n.type)){s.block||(s.block=MapGet$.call(REGISTRY,n.type)),a[l]=s.block(n.props,r,l);continue}if("function"==typeof n.type&&"_c"in n.type){const e=n.type(n.props);if(MapHas$.call(REGISTRY,e.type)){const t=MapGet$.call(REGISTRY,e.type);if("function"==typeof t){a[l]=t(e.props);continue}}}const c=block$1(e=>null==e?void 0:e.scope),u=(e,t,r)=>c({scope:renderReactScope(reactExports.createElement(n.type,e),!1,t.current,r)},n.key?String(n.key):void 0);MapSet$.call(REGISTRY,n.type,u),s.block=u,a[l]=u(n.props,r,l)}return s.each=e,s.children=a,a};function isEqual(e,t){return e===t||e!=e&&t!=t}function shouldCompiledBlockUpdate(e,t){for(const n in e)if(!isEqual(e[n],t[n]))return!0;return!1}function compiledBlock(e,{portals:t,...n}){const r=`CompiledBlock(Inner(${n.name}))`,o=block(t=>e(t),{...n,name:r,shouldUpdate:shouldCompiledBlockUpdate}),i=(null==t?void 0:t.length)||0,a=t&&i>0?e=>{const n=reactExports.useContext(scopedContext),[r]=reactExports.useState(()=>[]),a={...e,scoped:n};for(let o=0;o<i;o++){const e=t[o],n=renderReactScope(a[e],!1,r,o);a[e]=n}const s=[];for(let t=0,o=r.length;t<o;t++)s[t]=r[t].portal;return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(o,a),s)}:e=>reactExports.createElement(o,e);return n.name&&(a.displayName=`Million(CompiledBlock(Outer(${n.name})))`),a}var j$1;function B$1(e){if(!j$1){if(!(typeof document<"u"))return;j$1=document.createElement("textarea")}var t="&"+e+";";j$1.innerHTML=t;var n=j$1.value;return n!==t?n:void 0}"undefined"!=typeof window&&(window.__MILLION_DATA__={version:"3.1.11"});var C$3={},Z6=Object.defineProperty,G6=(e,t)=>{for(var n in t)Z6(e,n,{get:t[n],enumerable:!0,configurable:!0,set:e=>t[n]=()=>e})},C$2=32,l$1=9,V0=13,d$1=10,t0=96,e1=126,g1=91,D9=94,C1=62,T9=35,D1=45,d1=61,k1=92,S9=42,$9=95,j9=60,E9=64,H9=93,F9=33,x9=38,P9=58,i1=102,c1=104,x1=119,r9=116,B$=112,zZ=115,_Z=160,qZ=12,I9=46,Z9=47,DZ=43,jZ=124,HZ=123,FZ=40,OZ=41,N$=120,y$=88,G9=48,Y9=57,m1=65,h1=90,a1=97,r1=122,K1=128,WZ=32,Y6={blockQuote:0,breakLine:1,breakThematic:2,codeBlock:3,codeInline:4,footnote:5,footnoteReference:6,frontmatter:7,gfmTask:8,heading:9,htmlBlock:10,htmlComment:11,htmlSelfClosing:12,image:13,link:14,orderedList:15,paragraph:16,ref:17,refCollection:18,table:19,text:20,textFormatted:21,unorderedList:22},O$1=Y6,P$={};function L$(e){if(!c$1(e,"---"))return null;let t=3;for(;t<e.length&&(" "===e[t]||"\t"===e[t]);)t++;if(t<e.length&&"\r"===e[t]&&t++,t>=e.length||"\n"!==e[t])return null;t++;let n=!1;for(;t<e.length;){let r=t;for(;t<e.length&&"\n"!==e[t]&&"\r"!==e[t];)t++;if(t>=e.length)break;let o=t;if("\r"===e[t]&&t++,t<e.length&&"\n"===e[t]&&t++,c$1(e,"---",r))return{endPos:t,hasValidYaml:n};let i=e.indexOf(":",r);-1!==i&&i<o&&(n=!0)}return null}G6(P$,{startsWith:()=>c$1,slugify:()=>J1,skipWhitespace:()=>g0,shouldFilterTag:()=>$$,sanitizer:()=>s1,parseFrontmatterBounds:()=>L$,normalizeInput:()=>p1,normalizeCRLF:()=>j6,isVoidElement:()=>K9,isUnicodeWhitespace:()=>V9,isUnicodePunctuation:()=>t9,isAlnumCode:()=>o9,isASCIIWhitespace:()=>g9,isASCIIPunctuation:()=>_6,inlineCharTypeTable:()=>f9,includes:()=>V6,htmlAttrsToJSXProps:()=>s9,hasKeys:()=>e9,getTag:()=>H6,getOverrideProps:()=>F6,get:()=>x$,findLineEnd:()=>I$1,extractPlainText:()=>wZ,endsWith:()=>n9,decodeEntityReferences:()=>M9,charClassTable:()=>W9,applyTagFilterToText:()=>Z$,VOID_ELEMENTS:()=>R$,SHOULD_RENDER_AS_BLOCK_R:()=>T$,SANITIZE_R:()=>O9,NAMED_CODES_TO_UNICODE:()=>K6,HTML_TO_JSX_MAP:()=>AZ,HTML_CHAR_CODE_R:()=>vZ,ATTRIBUTES_TO_SANITIZE:()=>S$});var K6=C$3,vZ=/&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi,AZ={class:"className",for:"htmlFor",allowfullscreen:"allowFullScreen",allowtransparency:"allowTransparency",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",classid:"classId",colspan:"colSpan",contenteditable:"contentEditable",contextmenu:"contextMenu",crossorigin:"crossOrigin",enctype:"encType",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",inputmode:"inputMode",keyparams:"keyParams",keytype:"keyType",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",novalidate:"noValidate",radiogroup:"radioGroup",readonly:"readOnly",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",usemap:"useMap"};function s9(e){var t={};for(var n in e){var r=n.toLowerCase();t[AZ[r]||n]=e[n]}return t}var T$=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/;function M9(e){return-1===e.indexOf("&")?e:e.replace(vZ,(e,t)=>{var n=B$1(t);if(n)return n;if("#"===t[0]){var r="x"===t[1]||"X"===t[1]?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return 0===r||r>=55296&&r<=57343||r>1114111?"�":r<=65535?String.fromCharCode(r):String.fromCharCode(55296+(r-65536>>10),56320+(r-65536&1023))}return e})}var O9=/(javascript|vbscript|data(?!:image)):/i;function s1(e){if(O9.test(e))return null;if(-1===e.indexOf("%"))return e;try{let t=decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"");if(O9.test(t))return null}catch(t){return null}return e}var c0={},e0,x0;for(e0=[192,193,194,195,196,197,224,225,226,227,228,229,230,198],x0=0;x0<e0.length;x0++)c0[e0[x0]]="a";for(c0[231]=c0[199]="c",c0[240]=c0[208]="d",e0=[200,201,202,203,233,232,234,235],x0=0;x0<e0.length;x0++)c0[e0[x0]]="e";for(e0=[207,239,206,238,205,237,204,236],x0=0;x0<e0.length;x0++)c0[e0[x0]]="i";for(c0[209]=c0[241]="n",e0=[248,216,339,338,213,245,212,244,211,243,210,242],x0=0;x0<e0.length;x0++)c0[e0[x0]]="o";for(e0=[220,252,219,251,218,250,217,249],x0=0;x0<e0.length;x0++)c0[e0[x0]]="u";function o9(e){return e>=G9&&e<=Y9||e>=m1&&e<=h1||e>=a1&&e<=r1}function J1(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(o9(r))r>=m1&&r<=h1?t.push(String.fromCharCode(r+WZ)):t.push(e[n]);else if(r===C$2||r===D1)t.push("-");else{var o=c0[r];o&&t.push(o)}}return t.join("")}function V6(e,t){return-1!==e.indexOf(t)}function c$1(e,t,n){return e.startsWith(t,n)}function n9(e,t,n){return e.startsWith(t,(void 0===n?e.length:n)-t.length)}c0[376]=c0[255]=c0[221]=c0[253]="y";var R$=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr","circle","ellipse","line","path","polygon","polyline","rect","use","stop","animate","animateTransform","set"]);function K9(e){let t=e.toLowerCase();if(R$.has(t))return!0;let n=t.indexOf(":");return-1!==n&&(t=t.slice(n+1),R$.has(t))}var S$=["src","href","data","formAction","srcDoc","action"],E$=1,X9=2,MZ=1,U6=2,Q6=3,z6=4,W9=function(){let e,t=new Uint8Array(128);for(t[l$1]=t[d$1]=t[qZ]=t[V0]=t[C$2]=E$,e=F9;e<=Z9;e++)t[e]=X9;for(e=P9;e<=E9;e++)t[e]=X9;for(e=g1;e<=t0;e++)t[e]=X9;for(e=HZ;e<=e1;e++)t[e]=X9;return t}(),f9=function(){let e=new Uint8Array(128);return e[k1]=U6,e[g1]=z6,e[S9]=e[$9]=e[e1]=e[d1]=Q6,e[t0]=e[j9]=e[E9]=e[H9]=e[d$1]=e[C$2]=e[F9]=MZ,e[i1]=e[c1]=e[x1]=MZ,e}();function _6(e){return e<K1&&0!==(W9[e]&X9)}function g9(e){return e<K1&&0!==(W9[e]&E$)}var q6=/[\p{P}\p{S}]/u,D6=new RegExp("\\p{Zs}","u");function V9(e){if(!e)return!0;let t=e.charCodeAt(0);return t<K1?0!==(W9[t]&E$):D6.test(e)}function t9(e){if("number"==typeof e)return e<K1&&0!==(W9[e]&X9);if(!e)return!1;let t=e.charCodeAt(0);return t<K1?0!==(W9[t]&X9):q6.test(e)}function I$1(e,t){let n=e.indexOf("\n",t);return-1===n?e.length:n>0&&e.charCodeAt(n-1)===V0?n-1:n}var J9=[];function p1(e){var t=e.indexOf("\r"),n=e.indexOf("\0");if(-1===t&&-1===n)return e;var r=e.length;J9.length=0;var o=0,i=0;for(i=-1===t?n:-1===n||t<n?t:n;i<r;i++){var a=e.charCodeAt(i);a===V0?(o<i&&J9.push(e.slice(o,i)),i+1<r&&e.charCodeAt(i+1)===d$1&&i++,J9.push("\n"),o=i+1):0===a&&(o<i&&J9.push(e.slice(o,i)),J9.push("�"),o=i+1)}return o<r&&J9.push(e.slice(o)),J9.join("")}function j6(e){return p1(e)}function g0(e,t,n){let r=n??e.length;for(;t<r&&(" "===e[t]||"\t"===e[t]);)t++;return t}function e9(e){if(!e)return!1;for(var t in e)return!0;return!1}function x$(e,t,n){for(var r=e,o=t.split("."),i=0;i<o.length&&void 0!==(r=null==r?void 0:r[o[i]]);)i++;return r||n}function H6(e,t){if(!t)return e;let n=x$(t,e,void 0);return"string"==typeof n?n:"object"==typeof n&&n.component?n.component:e}function F6(e,t){if(!t)return{};let n=x$(t,e,void 0);return"object"==typeof n&&n.props?n.props:{}}function wZ(e,t){for(var n="",r=0,o=e.length;r<o;r++){var i=e[r],a=i.type;if(a===t.text||a===t.codeInline){var s=i.text;s&&(n+=s)}else a===t.textFormatted||a===t.link?i.children&&(n+=wZ(i.children,t)):a===t.image&&i.alt&&(n+=i.alt)}return n}function $$(e){var t=e.toLowerCase();return"title"===t||"textarea"===t||"style"===t||"xmp"===t||"iframe"===t||"noembed"===t||"noframes"===t||"script"===t||"plaintext"===t}function Z$(e){return e.replace(/<(\/?)(title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)(\s|>|\/)/gi,function(e,t,n,r){return"&lt;"+t+n+r})}function O6(e){console.warn(e)}function A9(e,t,n,r){for(var o=b$2(n),i=e.length,a=r??i-t,s=0;s<a&&t+s<i&&b$2(e,t+s)===o;)s++;return s}function BZ(e,t,n,r,o){if(0===o?n>=r:t<=r)return!1;let i=0===o?e[n]:e[t-1],a=0===o?t>0?e[t-1]:null:n<e.length?e[n]:null;var s=b$2(i);if(s<K1?g9(s):V9(i))return!1;var l=a?b$2(a):null,c=null===a||"\n"===a||"\r"===a||null===l||(l<K1?g9(l):V9(a));return!q$(s,i)||(!!c||!!a&&q$(b$2(a),a))}function Q$(e){for(var t="",n=0;n<e.length;)if("\\"===e[n]&&n+1<e.length){var r=e[n+1];t+=t9(b$2(r))?r:"\\"+r,n+=2}else t+=e[n++];return M9(t)}function k$2(e,t){return t>=e.length?t:e.charCodeAt(t)===V0&&t+1<e.length&&e.charCodeAt(t+1)===d$1?t+2:(e.charCodeAt(t),t+1)}function W6(e,t){if(e>=K1)return 0;var n=f9[e];return!t||1!==n||e!==i1&&e!==c1&&e!==x1?n:0}function M6(e,t,n,r,o,i){if(!n.length||n[n.length-1].type!==O$1.blockQuote)return null;let a=g0(r,0,r.length);if(a>=r.length||">"!==r[a])return null;let s=uZ(e,t,o,i);if(!s)return null;let l=n[n.length-1],c=s;return c.children&&l.children.push(...c.children),c.endPos}function z$(e,t,n,r){return{type:O$1.heading,level:e,children:t,id:r(n)}}var p$=/\\(.)/g,v6=/\s+#+\s*$/,n$=/^(?:(\d{1,9})([.)])\s+(.*)$|(\d{1,9})([.)])\s*$|([-*+])\s+(.*)$|([-*+])\s*$)/,u$=/^(\d{1,9})([.)])(\s+|$)/,l$=/^([*+\-])(\s+|$)/,H$=/^<([a-z][^ >/\n\r]*) ?([^>]*?)>/i,gZ=/^<([a-z][^ >/]*) ?(?:[^>/]+[^/]|)>/i,b$2=function(e,t=0){return e.charCodeAt(t)},_$=function(e){return o9(b$2(e))},d$=function(e){return g9(b$2(e))},j1=function(e){return" "===e||"\t"===e},C9=function(e){return" "===e||"\t"===e||"\n"===e||"\r"===e},q$=function(e,t){return t9(e<K1?e:t)},A6=function(e){var t=b$2(e);return _$(e)||t===D1||t===$9||t===P9||t===I9};function i$(e,t){var n=e.length;if(t>=n)return null;if(!U9(b$2(e[t])))return null;for(var r=t,o=t;o<n;){if(!((l=b$2(e[o]))>=a1&&l<=r1||l>=m1&&l<=h1||l>=G9&&l<=Y9||l===D1)){var i=b$2(e[o]);if(i===C$2||i===l$1||i===d$1||i===V0||i===C1||i===Z9)break;return null}o++}if(o===r)return null;for(var a=e.slice(r,o),s=0;s<a.length;s++){var l;if(!((l=b$2(a[s]))>=a1&&l<=r1||l>=m1&&l<=h1||l>=G9&&l<=Y9||l===D1))return null}return{tagName:a,tagLower:a.toLowerCase(),nextPos:o}}function n1(e,t){var n=U$(e,t);return n&&"tag"===n.kind?{tagName:n.tagName||"",tagLower:n.tagNameLower||"",attrs:n.attrs||"",endPos:n.endPos,isClosing:n.isClosing||!1,isSelfClosing:n.isSelfClosing||!1,hasNewline:n.hasNewline,hasSpaceBeforeSlash:!1,whitespaceBeforeAttrs:n.whitespaceBeforeAttrs||""}:null}function w6(e,t,n){for(var r=1,o=t;r>0&&o<e.length;){var i=e.indexOf("<",o);if(-1===i)return null;var a=n1(e,i);if(a){if(a.isClosing&&a.tagLower===n&&0===--r)return[i,a.endPos];a.isClosing||a.isSelfClosing||a.tagLower!==n||r++,o=a.endPos}else o=i+1}return null}var B6=/^\{.*\}$/,F$=/\n\n/,O$=/^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m,N6=/<\/?(?:pre|script|style|textarea)\b/i,CZ=/^<[A-Z]/,y6=/\n$/,b6=new Set(["#",">","-","*","+","`","|","0","1","2","3","4","5","6","7","8","9"]);function R6(e,t,n,r){let o=t;for(;o<n;)if("\\"===e[o]&&o+1<n)o+=2;else{if(e[o]===r)return o;o++}return-1}function NZ(e,t){var n=t.indexOf(":");if(n>0){var r=t.slice(n+1).trim(),o=r.length;if(o>=2){var i=r[0];'"'!==i&&"'"!==i||r[o-1]!==i||(r=r.slice(1,-1))}e.push([t.slice(0,n).trim(),r])}}function L6(e){var t=[];if(!e)return t;for(var n="",r=0,o="",i=0;i<e.length;i++){var a=e[i];if('"'===a||"'"===a)o?a===o&&(o="",r--):(o=a,r++);else if("("===a&&n9(n,"url"))r++;else if(")"===a&&r>0)r--;else if(";"===a&&0===r){NZ(t,n),n="";continue}n+=a}return NZ(t,n),t}function T6(tag,key,value,sanitizeUrlFn,options){if("style"===key)return L6(value).reduce(function(e,[t,n]){let r=sanitizeUrlFn(n,tag,t);return null!=r&&(e[t.replace(/(-[a-z])/g,e=>e[1].toUpperCase())]=r),e},{});if(value.match(B6)){if(value=value.slice(1,value.length-1),value=value?value.replace(p$,"$1"):value,value.length>0){let e=value[0];if("["===e||"{"===e)try{return JSON.parse(value)}catch(Z2){return value}}if("true"===value)return!0;if("false"===value)return!1;if(options.evalUnserializableExpressions)try{return eval(`(${value})`)}catch($2){return value}return value}return-1!==S$.indexOf(key)?sanitizeUrlFn(value?value.replace(p$,"$1"):value,tag,key):"true"===value||"false"!==value&&value}function u1(e,t,n,r){let o={};if(!e||!e.trim())return o;let i=[],a=0,s=e.length;for(;a<s;){for(;a<s&&C9(e[a]);)a++;if(a>=s)break;let t=a;for(;a<s&&A6(e[a]);)a++;if(a===t){a++;continue}let n=e.slice(t,a);for(;a<s&&C9(e[a]);)a++;if(a>=s||"="!==e[a]){i.push(n);continue}for(a++;a<s&&C9(e[a]);)a++;if(a>=s){i.push(n+"=");break}let r=a,o=e[a];if('"'===o||"'"===o)for(a++;a<s;){if(e[a]===o){if(a+1>=s){a++;break}let t=e[a+1];if(C9(t)||"/"===t){a++;break}}a++}else if("{"===o){let t=1;for(a++;a<s&&t>0;){if("{"===e[a])t++;else if("}"===e[a]&&(t--,0===t)){a++;break}a++}}else for(;a<s&&!C9(e[a]);)a++;i.push(n+"="+e.slice(r,a))}if(!(null==i?void 0:i.length))return o;let l=t.toLowerCase();for(let d=0;d<i.length;d++){let e=i[d],t=e.indexOf("=");if(-1!==t){let i=e.slice(0,t).trim(),a=i.toLowerCase();if("ref"===a)continue;let s=(e=>{let t=e[0];return('"'===t||"'"===t)&&e.length>=2&&e[e.length-1]===t?e.slice(1,-1):e})(e.slice(t+1).trim());if("href"===a&&"a"===l||"src"===a&&"img"===l){let e=r.sanitizer(s,l,a);if(null==e){O6(`Stripped unsafe ${a} on <${n}>`);continue}o[i]=e}else{let e=T6(l,a,s,r.sanitizer,r);o[i]=e}}else"style"!==e&&(o[e]=!0)}if(-1!==e.indexOf("%"))try{if(O9.test(decodeURIComponent(e)))for(var c in o)delete o[c]}catch(u){}else if(O9.test(e))for(var c in o)delete o[c];return o}var p9=function(e){return b6.has(e)};function S6(e,t,n){let r=t+1;for(;r<e.length&&"]"!==e[r];)"\\"===e[r]&&r+1<e.length?r+=2:r++;if(r>=e.length)return{shouldSkip:!1,newPos:0};let o=t+1,i=r,a=o<i&&("\n"===e[o]||"\r"===e[o]),s=i>o&&("\n"===e[i-1]||"\r"===e[i-1]),l=r+1;if(l=g0(e,l),l>=e.length||":"!==e[l])return{shouldSkip:!1,newPos:0};if((a||s)&&n){let t=l+1;for(t=g0(e,t),t<e.length&&"\n"===e[t]&&(t=g0(e,t+1));t<e.length&&"\n"!==e[t];)t++;return t<e.length&&t++,{shouldSkip:!0,newPos:t}}return E6(e,l)}function E6(e,t){let n=t+1;for(n=g0(e,n),n<e.length&&"\n"===e[n]&&(n=g0(e,n+1));n<e.length&&"\n"!==e[n];)n++;if(n>=e.length)return{shouldSkip:!1,newPos:0};n++;let r=g0(e,n);if(r>=e.length||'"'!==e[r]&&"'"!==e[r])return{shouldSkip:!1,newPos:0};let o=e[r],i=r+1;for(;i<e.length&&e[i]!==o&&"\n"!==e[i];)"\\"===e[i]&&i+1<e.length?i+=2:i++;if(i>=e.length||e[i]!==o)return{shouldSkip:!1,newPos:0};let a=g0(e,i+1);return a<e.length&&"\n"!==e[a]&&"\r"!==e[a]?{shouldSkip:!0,newPos:n}:{shouldSkip:!1,newPos:0}}function kZ(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.type===O$1.link)return!0;if(n.type===O$1.textFormatted){var r=n;if(r.children&&kZ(r.children))return!0}}return!1}function c$(e){for(var t="",n=0,r=e.length;n<r;n++){var o=e[n],i=o.type;if(i===O$1.text)t+=o.text;else if(i===O$1.image){var a=o;a.alt&&(t+=a.alt)}else if(i===O$1.textFormatted){var s=o;s.children&&(t+=c$(s.children))}else if(i===O$1.link){var l=o;l.children&&(t+=c$(l.children))}}return t}var x6=new Set([" ","\t","\r","\n","\f","\v"]),C6,G2;function l1(e,t,n,r,o){for(var i=[],a=[],s=[],l=t,c=t,u=o.disableAutoLink||r.inAnchor,d=!1,p=!!r.inAnchor,f=!!o.disableParsingRawHTML,h=o.optimizeForStreaming,m=-1,g=-1,v=[],y=function(t,a){if(h&&r.inHTML)return!1;if(!p){var s=f$(e,l,r,o,"<");if(s)return b(l),i.push(s),l=s.endPos,c=l,!0}if(f)return!1;var u=M$(e,l,r,o);if(u){b(l);var d=i.length;return i.push(u),v&&v.push(d),l=u.endPos,c=l,!0}if(h&&-1===g&&l+1<n){var m=b$2(e,l+1);(m>=m1&&m<=h1||m>=a1&&m<=r1||m===Z9||m===F9)&&(g=l)}var y=n1(e,l);if(!y)return!1;var x=l+(y.isClosing?2:1);if(x>=e.length||j1(e[x]))return!1;var $=e.indexOf(">",l+1);if(-1!==$){var _=l+1;if($-_>=7)if(c$1(e,"http://",_)||c$1(e,"https://",_))for(var C=_;C<$;C++)if(j1(e[C]))return!1}if(U9(b$2(e,x))&&x+1<e.length&&":"===e[x+1])return!1;if(y.isClosing&&y.attrs.trim().length)return!1;if(y.attrs.length)for(var w=!1,S="",E=0;E<y.attrs.length;E++){var k=y.attrs[E];if(w&&k===S)w=!1;else if(w||'"'!==k&&"'"!==k){if("*"===k||"#"===k||"!"===k){for(var T=E+1;T<y.attrs.length&&"="!==y.attrs[T]&&" "!==y.attrs[T]&&"\t"!==y.attrs[T];)T++;if(T<y.attrs.length&&"="===y.attrs[T])return!1}}else w=!0,S=k}var P=e.slice(l,y.endPos),M=y.tagName.toLowerCase(),L=P,I=L.indexOf(">");if(-1!==I){var R="</"+M+">",O=(L=L.slice(I+1)).indexOf(R);-1!==O&&(L=L.slice(0,O))}var A=[];if(L.trim()&&o){var D={...r,inline:!1,inHTML:!0},N=L.trim();F$.test(N)||O$.test(N)||H$.test(N)?A=d9(N,D,o):N&&(D.inline=!0,A=l1(N,0,N.length,D,o))}var F=u1(y.whitespaceBeforeAttrs+y.attrs,M,y.tagName,o),z={type:O$1.htmlBlock,tag:y.tagName,attrs:F,children:A,rawText:P,text:L,verbatim:!0,endPos:y.endPos};return b(l),i.push(z),c=l=z.endPos,!0},b=function(t){if(t>c){var n=e.slice(c,t);i.push({type:O$1.text,text:d?M9(n):n}),c=t,d=!1}};l<n;){if(0!==W6(pe=b$2(e,l),u)){if(pe===t0){for(var x=l,$=0;l+$<n&&b$2(e,l+$)===t0;)$++;if($>0){for(var _=l+$,C=-1,w=_;w<n;){for(;w<n&&b$2(e,w)!==t0;)w++;if(w>=n)break;for(var S=0;w+S<n&&b$2(e,w+S)===t0;)S++;S>$&&(S=$);var E=w+S;if(S===$&&(w<=_||b$2(e,w-1)!==t0)&&(E>=n||b$2(e,E)!==t0)){C=w,w=E;break}w++}if(-1!==C){for(var k=e.slice(_,C),T=!1,P=0;P<k.length;P++){var M=b$2(k,P);if(M===d$1||M===V0){T=!0;break}}var L=k;if(T&&(L=k.replace(/\r\n/g," ").replace(/\r/g," ").replace(/\n/g," ")),L.length>0){var I=b$2(L,0),R=b$2(L,L.length-1);if(I===C$2&&R===C$2)for(var O=1;O<L.length-1;O++)if(b$2(L,O)!==C$2){L=L.slice(1,L.length-1);break}}b(x),i.push({type:O$1.codeInline,text:L}),c=l=w;continue}if(h&&-1===m){m=x,b(x),n=x;break}l=_;continue}}if(!(p||u||pe!==i1&&pe!==c1&&pe!==x1)){var A=null,D=l+1<n?b$2(e,l+1):0,N=l+2<n?b$2(e,l+2):0,F=l+3<n?b$2(e,l+3):0,z=l+4<n?b$2(e,l+4):0,B=l+5<n?b$2(e,l+5):0;if(pe===c1&&D===r9&&N===r9&&F===B$?A="h":pe===x1&&D===x1&&N===x1&&F===I9?A="w":pe===i1&&D===r9&&N===B$&&F===P9&&z===Z9&&B===Z9&&(A="f"),A){var j=f$(e,l,r,o,A);if(j){b(l),i.push(j),l=j.endPos,c=l;continue}}}if(!p&&!u&&pe===E9){var H=f$(e,l,r,o,"@");if(H&&"emailStart"in H){var{emailStart:V,endPos:U}=H,W=[];for(E=a.length-1;E>=0;E--){(G=a[E]).sourcePos>=V&&G.sourcePos<U&&(G.nodeIndex>=0&&G.nodeIndex<i.length&&(i.splice(G.nodeIndex,1),W.push(G.nodeIndex)),a.splice(E,1))}if(V<c){for(w=i.length-1;w>=0;w--)if(i[w].type===O$1.text){i.splice(w,1),W.push(w);break}c=V}if(W.length){W.sort(function(e,t){return e-t});for(var Y=0,q=0;q<a.length;q++){for(var G=a[q];Y<W.length&&W[Y]<G.nodeIndex;)Y++;G.nodeIndex-=Y}}b(V),i.push(H),c=l=U;continue}}if(pe!==j9||!y()){if(pe===k1){if(l+1<n&&b$2(e,l+1)===d$1){for(var K=l+2;K<n&&b$2(e,K)===C$2;)K++;if(K>=n){l++;continue}for(b(l),i.push({type:O$1.breakLine}),l+=2;l<n&&b$2(e,l)===C$2;)l++;c=l;continue}var X=l+1<n?e[l+1]:"";if(X&&-1!=="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".indexOf(X)){b(l),i.push({type:O$1.text,text:"&"===X?"&​":X}),c=l+=2;continue}}if(pe!==g1)if(pe===H9&&s.length>0){var Z=s[s.length-1],J=Z.pos+("image"===Z.type?2:1),Q=l;b(l);var ee=l+1,te=t$(i,Z),ne="link"===Z.type&&kZ(te),re=!1;if(!ne&&ee<n&&"("===e[ee]){var oe=g6(e,ee+1);if(oe){yZ(i,a,s,Z,J,Q,o.sanitizer(Q$(oe.target),"a","href"),oe.title?Q$(oe.title):void 0),l=oe.endPos,c=l;continue}}var ie=r.refs||{},ae=null,se=l;if(ee<n&&"["===e[ee]){var le=ee+1;for(w=le;w<n&&"]"!==e[w];)w++;w<n&&(ae=e.slice(le,w),se=w,re=!0)}re&&""!==ae||(ae=e.slice(J,Q));var ce=hZ(ae);if(!ne&&ie&&ie[ce]){var ue=ie[ce];yZ(i,a,s,Z,J,Q,ue.target,ue.title),c=l=se+1;continue}var de=Z.resultIdx;if(s.pop(),i.length=de,h){if(i.push(...te),ee<n&&"("===e[ee])return i}else"image"===Z.type&&i.push({type:O$1.text,text:"!"}),i.push({type:O$1.text,text:"["},...te,{type:O$1.text,text:"]"});for(P=0;P<a.length;P++)a[P].nodeIndex>=de&&a[P].nodeIndex++;l++,c=l}else if(pe!==S9&&pe!==$9&&pe!==e1&&pe!==d1)if(pe!==d$1)for(pe===x9&&(d=!0),l++;l<n;){var pe;if((pe=b$2(e,l))>=K1)break;if(pe===x9&&(d=!0),0!==(Oe=f9[pe])){if(1!==Oe||pe!==i1&&pe!==c1&&pe!==x1||!u)break;l++}else l++}else{Ie=l-1;for(var fe=0;Ie>=c&&b$2(e,Ie)===C$2;)fe++,Ie--;if(fe>=2){for(K=l+1;K<n&&b$2(e,K)===C$2;)K++;if(K>=n){b(Ie+1),l=n,c=n;continue}for(b(Ie+1),i.push({type:O$1.breakLine}),l++;l<n&&b$2(e,l)===C$2;)l++;c=l;continue}var he=l>c?b$2(e,l-1):0;Pe=l+1<n?b$2(e,l+1):0;b(l>c&&he===C$2&&Pe===C$2?l-1:l),i.push({type:O$1.text,text:"\n"}),c=l+1,l>t&&he===C$2&&c<n&&b$2(e,c)===C$2&&c++,l=c}else{var me=e[l],ge=l,ve=A9(e,l,me);if(("~"===me||"="===me)&&2!==ve){l++;continue}var ye=ge+ve,be=BZ(e,ge,ye,n,0),xe=BZ(e,ge,ye,t,1),$e=be,_e=xe;if("_"===me&&be&&xe){if(ge>0){var Ce=e[ge-1],we=b$2(Ce);$e=q$(we,Ce)}if(ye<n){var Se=e[ye],Ee=b$2(Se);_e=q$(Ee,Se)}}b(ge),a.push({nodeIndex:i.length,type:me,length:ve,canOpen:$e,canClose:_e,active:!0,sourcePos:ge,inAnchor:p}),i.push({type:O$1.text,text:e.slice(ge,ge+ve)}),c=l=ge+ve}else{if(!p){if(l+1<n&&"^"===e[l+1]){for(var ke=l+2;ke<n&&"]"!==e[ke];)ke++;if(ke<n){var Te=e.slice(l+2,ke);b(l),i.push({type:O$1.footnoteReference,target:`#${o.slugify(Te)}`,text:Te}),c=l=ke+1;continue}}var Pe;if(r.inList&&l+2<n&&b$2(e,l+2)===H9)if((Pe=b$2(e,l+1))===C$2||Pe===N$||Pe===y$){b(l),i.push({type:O$1.gfmTask,completed:Pe===N$||Pe===y$}),c=l+=3;continue}}var Me=!1;if(l>t&&"!"===e[l-1]){for(var Le=0,Ie=l-2;Ie>=t&&"\\"===e[Ie];Ie--)Le++;if(!(1&Le)&&(Me=!0,c<l-1&&b(l-1),i.length>0&&i[i.length-1].type===O$1.text)){var Re=i[i.length-1];Re.text.endsWith("!")&&(Re.text=Re.text.slice(0,-1),Re.text||i.pop())}}Me||b(l),c=l+1,(!p||Me)&&s.push({type:Me?"image":"link",pos:Me?l-1:l,resultIdx:i.length,inAnchor:p}),l++}}}else for(pe===x9&&(d=!0),l++;l<n&&!((pe=b$2(e,l))>=K1);){var Oe;if(pe===x9&&(d=!0),0!==(Oe=f9[pe])){if(u&&1===Oe&&(pe===i1||pe===c1||pe===x1)){l++;continue}break}l++}}if(b(l),a.length&&rZ(i,a),h){for(var Ae=i.length,De=v.length-1;De>=0;De--){var Ne=v[De];if(Ne<i.length&&i[Ne].type===O$1.htmlBlock){var Fe=i[Ne];if(!(K9(Fe.tag)||Fe.children&&0!==Fe.children.length)){i.splice(Ne,1),Ne<Ae&&Ae--;for(P=0;P<a.length;P++)a[P].nodeIndex>Ne&&a[P].nodeIndex--;for(P=De+1;P<v.length;P++)v[P]>Ne&&v[P]--}}}if(-1!==m&&m<Ae)for(var ze=i.length-1;ze>=0;ze--)if(i[ze].type===O$1.text){Ae=ze;break}if(-1!==g&&g<Ae)for(ze=i.length-1;ze>=0;ze--)if(i[ze].type===O$1.text){Ae=ze;break}for(w=a.length-1;w>=0;w--)if(a[w].active&&a[w].nodeIndex<Ae){i.splice(a[w].nodeIndex,1),a[w].nodeIndex<Ae&&Ae--;for(E=0;E<w;E++)a[E].nodeIndex>a[w].nodeIndex&&a[E].nodeIndex--}return Ae<i.length&&(i.length=Ae),i}if(s.length){s.sort(function(e,t){return e.resultIdx-t.resultIdx});for(w=0;w<s.length;w++)i.splice(s[w].resultIdx+w,0,{type:O$1.text,text:"image"===s[w].type?"![":"["})}return i}function P6(e,t,n,r,o){for(var i=!1,a=0;a<t.length;a++)if(t[a].sourcePos>=r&&t[a].sourcePos<o){i=!0;break}if(i){var s=t$(e,n),l=[];for(a=0;a<t.length;a++){var c=t[a];c.sourcePos>=r&&c.sourcePos<o&&l.push({nodeIndex:c.nodeIndex-n.resultIdx,type:c.type,length:c.length,canOpen:c.canOpen,canClose:c.canClose,active:c.active,sourcePos:c.sourcePos,inAnchor:c.inAnchor})}rZ(s,l),e.length=n.resultIdx;for(var u=0;u<s.length;u++)e.push(s[u]);var d=[];for(a=0;a<t.length;a++)(t[a].sourcePos<r||t[a].sourcePos>=o)&&d.push(t[a]);t.length=0;for(u=0;u<d.length;u++)t.push(d[u])}}function I6(e,t,n,r){return"link"===e.type?{type:O$1.link,target:n,title:r,children:t}:{type:O$1.image,target:n||"",alt:c$(t),title:r}}function t$(e,t){return e.slice(t.resultIdx)}function yZ(e,t,n,r,o,i,a,s){P6(e,t,r,o,i);var l=t$(e,r);n.pop(),e.length=r.resultIdx,e.push(I6(r,l,a,s))}function f6(e,t,n){let r=g0(e,t),o=r<e.length&&"<"===e[r];o&&r++;let i,a,s=r;if(o&&r<e.length&&">"===e[r])return{target:"",endPos:r+1,hadSpace:!1};var l=!1;if(o){for(a=r;a<e.length&&">"!==e[a];){let t=e[a];if("\n"===t||"\r"===t||"<"===t)return null;"\\"!==t?a++:a+=2}if(a>=e.length||">"!==e[a])return null;a++;let t=s;for(;t<a-1&&j1(e[t]);)t++;let n=a-1;for(;n>t&&j1(e[n-1]);)n--;i=e.slice(t,n),r=a}else{let t=0;for(a=r;a<e.length;){let n=e[a];if(" "===n||"\t"===n||"\n"===n){l=!0;break}if("("!==n)if(")"!==n)a++;else{if(a>0&&"\\"===e[a-1]){a++;continue}if(0===t)break;t--,a++}else{if(a>0&&"\\"===e[a-1]){a++;continue}t++,a++}}i=e.slice(s,a),r=a}return{target:i,endPos:r,hadSpace:l}}function bZ(e,t,n,r){let o,i=t,a=0;for(;i<e.length;){let t=e[i];if(j1(t))i++;else{if("\n"!==t){if(V9(t))break;break}if(a>=1)break;a++,i++}}if(n&&!r&&(i>=e.length||'"'!==e[i]&&"'"!==e[i]&&"("!==e[i]))return{title:void 0,endPos:i};if(i<e.length){let t=e[i];if('"'===t||"'"===t){i++;let n=i;for(;i<e.length&&e[i]!==t;)"\\"===e[i]&&i++,i++;i<e.length&&(o=e.slice(n,i),i++)}else if("("===t){i++;let t=i,n=1;for(;i<e.length&&n>0;)"\\"===e[i]&&i+1<e.length?i++:"("===e[i]?n++:")"===e[i]&&n--,i++;0===n&&(o=e.slice(t,i-1))}}return i=g0(e,i),{title:o,endPos:i}}function g6(e,t,n){let r=f6(e,t);if(!r)return null;let o=t;o=g0(e,o);let i=o<e.length&&"<"===e[o];if(i&&""===r.target&&r.endPos===o+2){let t=bZ(e,r.endPos,!1,i);return t.endPos>=e.length||")"!==e[t.endPos]?null:{target:"",title:t.title,endPos:t.endPos+1}}let a=bZ(e,r.endPos,r.hadSpace,i);return a.endPos>=e.length||")"!==e[a.endPos]?null:{target:r.target,title:a.title,endPos:a.endPos+1}}function U9(e){return e>=m1&&e<=h1||e>=a1&&e<=r1}function mZ(e){let t=e.indexOf(":");if(t<2||t>32)return!1;if(!U9(b$2(e)))return!1;for(let n=1;n<t;n++){let t=e[n];if(b$2(t),!_$(t)&&"+"!==t&&"."!==t&&"-"!==t)return!1}return!0}function RZ(e,t,n){return 0===t||-1!==(n?" \t\n\r*_~(":" \t\n*_~(").indexOf(e[t-1])}function G$(e,t,n,r,o){let i=r(e,"a","href");return i?{type:O$1.link,target:i,children:[{type:O$1.text,text:t}],endPos:n,...void 0!==o?{emailStart:o}:{}}:null}function I$(e,t,n,r,o){if(n.inAnchor||2!==o&&r.disableAutoLink)return null;if(2===o){if("<"!==e[t])return null;let n=t+1;for(;n<e.length&&">"!==e[n];){let t=b$2(e,n);if(t===C$2||t===l$1||t===d$1||t===V0||t<C$2)return null;n++}if(n>=e.length||">"!==e[n])return null;let o=e.slice(t+1,n);if(!o.length)return null;let i=-1!==o.indexOf("\\"),a=mZ(o),s=c$1(o,"http://")||c$1(o,"https://"),l=!1;if(!a&&!s&&o.length>=7){let e=o[0];if("m"===e||"M"===e){let e=o.toLowerCase();if(c$1(e,"mailto:")){l=!0;let t=e.indexOf(":");return G$("mailto:"+o.slice(t+1),o,n+1,r.sanitizer)}}}let c=!i&&-1!==o.indexOf("@")&&-1===o.indexOf("//")&&!a;if(!(s||l||c||a))return null;let u=o;return l||a||s||!c||(u="mailto:"+o),G$(u,o,n+1,r.sanitizer)}if(1===o){let n=t;for(;n>0&&(_$(e[n-1])||-1!==".+-_".indexOf(e[n-1]));)n--;if(n>=t||!RZ(e,n,!0))return null;let o=t+1,i=!1;for(;o<e.length;){let t=e[o];if("."===t)i=!0,o++;else{if(!_$(t)&&"-"!==t&&"_"!==t)break;o++}}if(!i||o<=t+1)return null;for(;o>t+1&&"."===e[o-1];)o--;if(o>t+1&&("-"===e[o-1]||"_"===e[o-1]))return null;if(o-(t+1)<1e4){if(e.indexOf(".",t+1)>=o||-1===e.indexOf(".",t+1))return null}else if(-1===e.slice(t+1,o).indexOf("."))return null;let a=e.slice(n,o);return G$("mailto:"+a,a,o,r.sanitizer,n)}let i=c$1(e,"http://",t)||c$1(e,"https://",t),a=!i&&c$1(e,"ftp://",t),s=!i&&!a&&c$1(e,"www.",t);if(!(i||a||s)||!RZ(e,t,!1))return null;for(var l=t+(i?b$2(e,t+4)===zZ?8:7:a?6:4),c=l;l<e.length;){let t=b$2(e,l);if(t===C$2||t===l$1||t===d$1||t===j9||t===C1)break;l++}if(l<=c)return null;let u=l;for(;u>c;){let t=e[u-1];if(u>c+1&&"\\"===e[u-2])break;if("?"===t||"!"===t||"."===t||","===t||":"===t||"*"===t||"_"===t||"~"===t)u--;else if(";"===t){let t=u-2;for(;t>=c&&"&"!==e[t]&&" "!==e[t];)t--;if(t>=c&&"&"===e[t]){let n=e.slice(t+1,u-1);if(n.length>=2&&n.length<=10&&/^[a-zA-Z0-9]+$/.test(n)&&("lt"===n||"gt"===n||n.length>=3&&(c$1(n,"amp")||c$1(n,"apos")||c$1(n,"quot")||c$1(n,"nbsp")||/^[a-z]{3,10}$/.test(n))))break;u=t;break}u--}else{if(")"!==t)break;{let t=0,n=0;for(let r=c;r<u;r++)"("===e[r]&&t++,")"===e[r]&&n++;if(!(n>t))break;u--}}}if((l=u)<=c)return null;for(var d=c,p=-1,f=-1;d<l;){let t=b$2(e,d);if(!(t>=m1&&t<=h1||t>=a1&&t<=r1||t>=G9&&t<=Y9||t===D1||t===$9||t===I9))break;t===I9&&(f=p,p=d),d++}if(d===c||-1===p)return null;-1===f&&(f=c-1);for(let m=f+1;m<p;m++)if("_"===e[m])return null;for(let m=p+1;m<d;m++)if("_"===e[m])return null;let h=e.slice(t,l);return G$(s?"http://"+h:h,h,l,r.sanitizer)}function f$(e,t,n,r,o){return"<"===o?I$(e,t,n,r,2):"h"===o||"f"===o||"w"===o?I$(e,t,n,r,0):"@"===o?I$(e,t,n,r,1):null}function hZ(e){var t=e.trim().replace(/[\s\t\n\r]+/g," ");return-1!==t.indexOf("ẞ")?t.replace(/\u1E9E/g,"ss").toLowerCase():t.toLowerCase()}function k6(e,t,n){if(t+3>=e.length||"["!==e[t])return null;let r=e[t+1];return" "!==r&&"x"!==r&&"X"!==r||"]"!==e[t+2]?null:{type:O$1.gfmTask,completed:"x"===r.toLowerCase(),endPos:t+3}}function e$(e,t,n,r){let{inline:o,inList:i,inBlockQuote:a}=t;void 0!==r.inline&&(t.inline=r.inline),void 0!==r.list&&(t.inList=r.list),void 0!==r.inBlockQuote&&(t.inBlockQuote=r.inBlockQuote);let s=d9(e,t,n);return t.inline=o,t.inList=i,t.inBlockQuote=a,s}function u9(e,t,n,r,o){return W$(r,!0,()=>l1(e,t,n,r,o))}function l9(e,n,r,o){var i=e[n];if(void 0===i)return null;var a=n,s=null,l=i,c=null,u=b$2(i),d=u===C$2||u===l$1;if(d){if((a=n+(s=t(e,n,c=I$1(e,n))).charCount)>=e.length)return X$(e,n);l=e[a]}if((s?s.spaceEquivalent:0)>=4)return d?X$(e,n):null;var p=b$2(l);if(p===C1){var f=uZ(e,n,r,o);if(f)return f}else{if(p===$9)return D$(e,n);if(p===D1||p===S9||p===DZ){var h=D$(e,n);if(h)return h;if(m=o$(e,n,r,o))return m}else if(p>=G9&&p<=Y9){var m;if(m=o$(e,n,r,o))return m}else{if(p===T9)return m6(e,a,r,o);if(p===g1)return B9(e,a,r,o,a+1<e.length&&b$2(e,a+1)===D9);if(p===j9&&!o.disableParsingRawHTML)return M$(e,a,r,o);if(p===t0||p===e1){if(c||(c=I$1(e,n)),s||(s=t(e,n,c)),s.spaceEquivalent<=3)return $Z(e,a,r,o)}else if(p===jZ)return aZ(e,n,r,o)}}return d?X$(e,n):null}function d9(e,n,r){let o=[],i=0;for(;i<e.length;){for(;i<e.length&&"\n"===e[i];)i++;if(i>=e.length)break;var a=e[i];if(n.inList&&o.length>0){var s=o[o.length-1];if((null==s?void 0:s.type)===O$1.paragraph){var l=s,c=b$2(a);if(c===D1||c===d1||c===C$2||c===l$1){var u=I$1(e,i),d=e.slice(i,u),p=t(e,i,u);if(p.spaceEquivalent<4)if(cZ(o,d.slice(p.charCount).trim(),r)){i=u+(u<e.length&&"\n"===e[u]?1:0);continue}}}}var f=l9(e,i,n,r);if(f)o.push(f),i=f.endPos;else{var h=pZ(e,i,n,r);if(h)o.push(h),i=h.endPos;else{if(e.slice(i).trim()){if(n.inBlockQuote&&o.length>0){let t=function(e){if(e.type===O$1.blockQuote){var n=e;if(n.children&&n.children.length>0){var r=n.children[n.children.length-1];if(r.type===O$1.paragraph)return r}}else if(e.type===O$1.orderedList||e.type===O$1.unorderedList){var o=e;if(o.items&&o.items.length>0){var i=o.items[o.items.length-1];if(i&&i.length>0){var a=i[i.length-1],s=t(a);if(s)return s}}}return null};for(var m=o.length-1;m>=0;m--){if(l=t(o[m]))if(v=a$(e,i,n,r)){var g=v;l.children&&g.children&&l.children.push({type:O$1.text,text:"\n"},...g.children),i=v.endPos;continue}}}var v;if(v=a$(e,i,n,r)){o.push(v),i=v.endPos;continue}}i++}}}return o}function m6(e,n,r,o){if(r.inline)return null;let i=t(e,n,I$1(e,n),3);if(i.spaceEquivalent>3&&!r.inList)return null;var a=n+i.charCount;if(a>=e.length||"#"!==e[a])return null;let s=A9(e,a,"#",6);if((a+=s)>=e.length)return null;let l=e[a];if("\n"===l||"\r"===l){let t=I$1(e,a);return{...z$(s,[],"",o.slugify),endPos:t+(t<e.length?1:0)}}if(" "!==l&&"\t"!==l)return null;let c=a,u=I$1(e,c);var d=e.slice(c,u).replace(v6,"").trim();return{...z$(s,u9(d,0,d.length,r,o),d,o.slugify),endPos:u+(u<e.length?1:0)}}function pZ(e,t,n,r){if(n.inline||n.inBlockQuote||n.inList)return null;let o=I$1(e,t);if(o>=e.length)return null;let i=k$2(e,o),a=-1,s=null;for(var l=0;i<e.length&&l<10;l++){let t=I$1(e,i);if(t>=e.length)break;for(var c=i;c<t&&(b$2(e,c)===C$2||b$2(e,c)===l$1||b$2(e,c)===V0);)c++;if(c>=t)break;for(var u=0,d=i;d<t&&u<3&&b$2(e,d)===C$2;)u++,d++;if(d<t){let n=b$2(e,d);if(n===d1||n===D1){let r=e[d];for(var p=0,f=!1,h=d;h<t;){let t=b$2(e,h);if(t===n){if(f){p=0;break}p++}else{if(t!==C$2&&t!==l$1){p=0;break}f=!0}h++}if(p>=1){a=t,s=r;break}}}i=k$2(e,t)}if(!s)return null;let m=b$2(e,t);if(m===T9||m===C1||"|"===e[t])return null;let g=t;for(var v=t,y=!1;v<i;){let t=I$1(e,v);if(t>=i)break;for(var b=v;b<t&&(b$2(e,b)===C$2||b$2(e,b)===l$1||b$2(e,b)===V0);)b++;b<t&&(y=!0,g=t),v=k$2(e,t)}if(!y)return null;let x=e.slice(t,g);for(var $=0,_=x.length;$<_&&(x.charCodeAt($)===C$2||x.charCodeAt($)===l$1||x.charCodeAt($)===V0||x.charCodeAt($)===d$1);)$++;for(;_>$&&(x.charCodeAt(_-1)===C$2||x.charCodeAt(_-1)===l$1||x.charCodeAt(_-1)===V0||x.charCodeAt(_-1)===d$1);)_--;let C=x.slice($,_);return C?{...z$("="===s?1:2,u9(C,0,C.length,n,r),C,r.slugify),endPos:a+(a<e.length?1:0)}:null}function a$(e,n,r,o){if(r.inline)return null;if(o.optimizeForStreaming&&"|"===e[n]){for(var i=Math.min(500,e.length-n),a=e.substr(n,i),s=0,l=!1,c=0;c<a.length;c++)"|"===a[c]&&s++,"-"!==a[c]&&":"!==a[c]||(l=!0);if(s>=3&&l){for(var u=I$1(e,n);u<e.length;){var d=k$2(e,u);if(d>=e.length)break;var p=I$1(e,d),f=e.slice(d,p);if(-1===f.indexOf("|")&&-1===f.indexOf("-"))break;if(u=p,p>=e.length)break}return{type:O$1.paragraph,children:[],endPos:k$2(e,u)}}}let h=n,m=e.length;for(;h<m;){let n=I$1(e,h),i=!0;for(let t=h;t<n;t++){let n=b$2(e,t);if(n!==C$2&&n!==l$1&&n!==V0){i=!1;break}}if(i){h=n;break}if(n>=m){h=m;break}let a=k$2(e,n);if(a>=m){h=m;break}let s=I$1(e,a),l=!0,c="";for(let t=a;t<s;t++){let n=b$2(e,t);if(n!==C$2&&n!==l$1&&n!==V0){l=!1,""===c&&(c=e[t]);break}}if(l){h=n;break}let u=!1,d=t(e,a,s),p=4===d.spaceEquivalent&&4===d.charCount;if("<"===c&&!p&&!o.disableParsingRawHTML){let t=a,n=0;for(;t<s&&n<3;){let r=b$2(e,t);if(r!==C$2&&r!==l$1)break;n++,t++}if(t<s&&"<"===e[t]){var g=M$(e,t,{...r,inline:!1},o);g&&(u=!("canInterruptParagraph"in g)||g.canInterruptParagraph)}}if(p)u=!1;else if(!u&&c&&p9(c))if("["===c){u=!(a+1>=m||"^"!==e[a+1])}else if("*"===c||"+"===c)if(D$(e,a))u=!0;else{let t=a+1<m?e[a+1]:"";u=!(!t||!j1(t))}else{let n=l9(e,a,r,o);n&&(u=n.type===O$1.codeBlock?!(t(e,a,s).spaceEquivalent>=4):n.type===O$1.unorderedList||n.type===O$1.orderedList?n.type!==O$1.orderedList||1===n.start:"-"===c||n.type!==O$1.ref)}if(u){h=n;break}h=k$2(e,n)}if(h<=n)return null;for(var v=n,y=h;v<y;){let t=b$2(e,v);if(t!==C$2&&t!==l$1)break;v++}var b;if(y>I$1(e,v)){for(var x=[],$=v,_=0;$<y;){var C=I$1(e,$);if(C>y&&(C=y),0===_)x.push(e.slice($,C));else{for(var w=0;w<4&&$+w<C&&b$2(e,$+w)===C$2;)w++;var S=4===w?$+4:$;x.push(e.slice(S,C))}if(C<y){let t=b$2(e,C);t===V0||t===d$1?(x.push("\n"),$=k$2(e,C)):$=y}else $=y;_++}b=x.join("")}else b=e.slice(v,y);for(var E=b.length;E>0;){var k=b.charCodeAt(E-1);if(k!==C$2&&k!==l$1)break;E--}E<b.length&&(b=b.slice(0,E));let T=!1;for(let t=0;t<b.length;t++){let e=b.charCodeAt(t);if(e!==C$2&&e!==l$1&&e!==d$1&&e!==V0){T=!0;break}}if(!T)return null;for(var P=b,M=h,L=-1,I=h-1;I>=v;){if(b$2(e,I)===d$1){L=I;break}I--}if(L>=0){for(var R=!1,O=v;O<L;O++){let t=b$2(e,O);if(t!==C$2&&t!==l$1&&t!==d$1&&t!==V0){R=!0;break}}if(!R){for(var A=L+1;A<e.length;){let t=b$2(e,A);if(t!==C$2&&t!==l$1)break;A++}if(A-(L+1)<4&&A<e.length&&"["===e[A]){var D={...r,inline:!1},N=B9(e,A,D,o,!1);if(N){var F=0;for(I=v;I<=L;){let t=e.indexOf("\n",I);if(-1===t||t>L)break;F++,I=t+1}var z=0,B=0;for(I=0;I<b.length;){let e=b.indexOf("\n",I);if(-1===e)break;if(++B===F){z=e+1;break}I=e+1}z>0&&(P=b.slice(0,z-1)),M=N.endPos,r.refs=D.refs}}}}let j=u9(P,0,P.length,r,o);var H={type:O$1.paragraph,children:j,endPos:M};if(j.length>0){for(var V=[],U=j.length-1;U>=0;U--){var W=j[U];if(W.type===O$1.htmlSelfClosing&&!0===W.isClosingTag)V.push(U);else{if(W.type!==O$1.text)break;var Y=W;if(Y.text&&Y.text.trim().length>0)break}}if(V.length>=3){var q=V[V.length-1],G=j.slice(q+1);j.splice(q+1),H.removedClosingTags=G}}return H}function h6(e,t){if(0!==t)return null;let n=L$(e);if(!(null==n?void 0:n.hasValidYaml))return null;let r=n.endPos-1;r>0&&"\r"===e[r-1]&&r--;let o=p1(e.slice(0,r));return{type:O$1.frontmatter,text:o,endPos:n.endPos}}function D$(e,n,r,o){let i=I$1(e,n),a=t(e,n,i,3);if(a.spaceEquivalent>3)return null;var s=n+a.charCount;if(s>=i)return null;let l=e[s];if("-"!==l&&"*"!==l&&"_"!==l)return null;for(var c=0,u=s;u<i;){var d=e[u];if(d===l)c++;else if(" "!==d&&"\t"!==d)return null;u++}return c<3?null:{type:O$1.breakThematic,endPos:k$2(e,i)}}function t(e,t,n,r){let o=0,i=0,a=t;for(;a<n;){var s=b$2(e,a);if(s!==C$2&&s!==l$1)break;if(void 0!==r&&o>=r)break;o+=s===l$1?4-o%4:1,i++,a++}return{spaceEquivalent:o,charCount:i}}function LZ(e,t,n,r){let o=0,i=0,a=r;for(let d=t;d<n&&i<4;d++){var s=b$2(e,d);if(s===l$1){let e=4-a%4;if(i+=e,o++,a+=e,i>=4)break}else{if(s!==C$2)break;if(i++,o++,a++,i>=4)break}}let l=e.slice(t+o,n);for(var c=0,u=t;u<n&&("\t"===e[u]&&c++,!(c>=2));u++);return c>=2&&c$1(l,"\t")&&r>0&&(l=" "+l.slice(1)),l}function X$(e,n,r){let o=t(e,n,I$1(e,n));if(o.spaceEquivalent<4)return null;let i=o.spaceEquivalent,a=I$1(e,n+o.charCount),s=n,l=0;for(var c=s-1;c>=0&&"\n"!==e[c]&&"\r"!==e[c];)c--;for(c++;c<s;)"\t"===e[c]?l=l+4-l%4:l++,c++;let u=LZ(e,s,a,l),d=k$2(e,a);if(d>=e.length)return u.trim()?{type:O$1.codeBlock,text:u,endPos:d}:null;var p=[];p.push(u);let f=d;for(;f<e.length;){let n=I$1(e,f);if(w1(e,f,n)){let r=n+1;if(r<e.length){let n=t(e,r,I$1(e,r)),o=e[r+n.charCount];if(o&&"\n"!==o&&(n.spaceEquivalent<4||">"===o&&n.spaceEquivalent<i))break}p.push("\n")}else{if(t(e,f,n).spaceEquivalent<4)break;let r=LZ(e,f,n,0);p.push("\n"),p.push(r)}f=k$2(e,n)}let h=p.join("");return h=h.replace(y6,""),h.trim()?{type:O$1.codeBlock,text:h,endPos:f}:null}function $Z(e,n,r,o){let i=e[n];if("`"!==i&&"~"!==i)return null;let a=A9(e,n,i);if(a<3)return null;let s=n;for(;s>0&&b$2(e,s-1)!==d$1;)s--;let l=t(e,s,n),c=l.spaceEquivalent,u=c;if(4===c&&4===l.charCount&&(c=0,u=4),c>=4)return null;let d=g0(e,n+a),p=I$1(e,d),f=e.slice(d,p).trim();if("`"===i&&-1!==f.indexOf("`"))return null;f=f.replace(p$,"$1");let h=f.indexOf(" "),m=h>0?f.slice(0,h):f,g=h>0?f.slice(h+1).trim():"",v=g&&/=\s*["']/.test(g)?u1(g,"code","code",o):void 0,y=k$2(e,p),b=y,x=!1;for(;b<e.length;){let t=I$1(e,b),n=b,r=0;for(;n<t;){let t=b$2(e,n);if(t===C$2){if(r++,n++,r>=4)break}else{if(t!==l$1)break;if(r+=4-r%4,n++,r>=4)break}}if(r<4){let r=A9(e,n,i,t-n);if(r>=a){let o=n+r;for(;o<t;){let t=b$2(e,o);if(t!==C$2&&t!==l$1)break;o++}if(o===t){x=!0;break}if(r>=3&&o<t){let o=n+r;if(!(o<t)||b$2(e,o)!==C$2&&b$2(e,o)!==l$1){let n=!0;if("`"===i&&-1!==e.slice(o,t).indexOf("`")&&(n=!1),n)break}}}}else if(4===u&&0===c&&4===r){let r=A9(e,n,i,t-n);if(r>=a&&w1(e,n+r,t)){x=!0;break}}b=k$2(e,t)}let $=b>y&&"\n"===e[b-1]?b-1:b;$>y&&"\r"===e[$-1]&&$--;let _=p1(e.slice(y,$));u&&(_=r$(_,u));let C=x&&b<e.length?k$2(e,I$1(e,b)):b;return{type:O$1.codeBlock,text:_,lang:m,attrs:v,endPos:C}}function p6(e,t,n){for(var r=0;r<e.length;r++)if(!d$(e[r])){let r=e$(e,t,n,{inline:!1,inBlockQuote:!0});for(var o=0;o<r.length;o++){let e=r[o];"endPos"in e&&delete e.endPos}return r}return[]}function uZ(e,n,r,o){if(r.inline)return null;let i=n;for(;i<e.length&&(" "===e[i]||"\t"===e[i]);)i++;if(i>=e.length||">"!==e[i])return null;let a=n;for(var s=[],l=void 0,c=-1,u=!1,d=null,p=null,f=0,h=!1;a<e.length;){let n=I$1(e,a),i=a;for(;i<n&&(" "===e[i]||"\t"===e[i]);)i++;if(i<n&&">"===e[i]){let r=i+1;r<n&&" "===e[r]&&r++;let o=t(e,r,n).spaceEquivalent>=4,a=!1,l=null,v=0;if(r<n){let t=e[r];if("`"===t||"~"===t){let o=0,i=r;for(;i<n&&e[i]===t&&o<20;)o++,i++;o>=3&&(a=!0,l=t,v=o)}}u&&"fenced"===d&&l===p&&v>=f?(u=!1,d=null,p=null,f=0):(o||a)&&(u=!0,d=o?"indented":"fenced",p=l,f=v);var m=!o&&!a;if(m)for(var g=r;g<n;g++)if(!d$(e[g])){m=!1;break}h=m,-1!==c||m||(c=s.length);let y=i+1;if(y<n&&"\t"===e[y]){s.push(" ");let t=4;for(let r=y+1;r<n;r++){let n=e[r];if(b$2(n)===l$1){let e=4-t%4;1===e?s.push(" "):2===e?s.push(" "):3===e?s.push(" "):s.push(" ".repeat(e)),t+=e}else s.push(n),t++}n<e.length&&s.push("\n")}else{let t=y;t<n&&" "===e[t]&&t++,s.push(e.slice(t,n)),n<e.length&&s.push("\n")}}else{var v=!0;for(g=a;g<n;g++)if(!d$(e[g])){v=!1;break}if(v||u)break;if(0===t(e,a,n).spaceEquivalent){let t=l9(e,a,r,o);if(t&&t.type!==O$1.ref&&t.type!==O$1.codeBlock)break;if(h)break}s.push(e.slice(a,n)),n<e.length&&s.push("\n")}a=k$2(e,n)}if(a===n)return null;s.length>0&&"\n"===s[s.length-1]&&s.pop();let y=s.join("");if(y.length>=4&&y.charCodeAt(0)===g1&&y.charCodeAt(1)===F9){let e=y.indexOf("]\n",2);e>2&&(l=y.slice(2,e),y=y.slice(e+2))}let b=p6(y,r,o),x={type:O$1.blockQuote,children:b,endPos:a};return l&&(x.alert=l),x}function r$(e,t){return e.split("\n").map(function(e){if(0===e.length)return e;let n=t,r=0,o=0,i=0;for(;o<e.length&&r<n;)if(" "===e[o])r++,i++,o++;else{if("\t"!==e[o])break;{let t=4-i%4;if(!(r+t<=n)){let i=n-r,a=Math.max(0,t-i);return" ".repeat(a)+e.slice(o+1)}r+=t,i+=t,o++}}return e.slice(o)}).join("\n")}function K$(e,t,n,r,o=!0){let i=(o?"\n":"")+e,a=u9(i,0,i.length,n,r);t.length>0&&t[t.length-1].type===O$1.paragraph?t[t.length-1].children.push(...a):t.push(...a)}function k9(e){return e.some(function(e){return e.type===O$1.codeBlock||e.type===O$1.paragraph||e.type===O$1.blockQuote||e.type===O$1.orderedList||e.type===O$1.unorderedList||e.type===O$1.heading})}function g$(e){return!!e.match(n$)}function lZ(e){var t;if(0===e.length)return e;var n=e[e.length-1];return(n.type===O$1.orderedList||n.type===O$1.unorderedList)&&(null==(t=n.items)?void 0:t.length)>0?lZ(n.items.slice(-1)[0]):e}function s$(e,t,n,r,o,i,a){if(!c$1(o,"["))return null;var s={inline:!1,refs:i.refs||{}},l=B9(e,t+r.charCount,s,a,!1);return l?l.endPos:null}function TZ(e,t,n,r){return!(1!==e.length||!n)&&(0===e[0].length&&(!!t||!t&&""===r.trim()))}function SZ(e,t){var n=e.index||0;return t?n+e[1].length+e[2].length+1:n+e[1].length+1}function j$(e,t,n,r,o){for(var i=0,a=r+o,s=t;s<n&&i<4;){var l=b$2(e,s);if(l===C$2)i++,a++;else{if(l!==l$1)break;var c=4-a%4;if(i+c>4)break;i+=c,a+=c}s++}return{contentStartColumn:a,contentStartPos:s}}function C$(e){var t=e.match(n$);return t?t[1]?{match:[e,t[1],t[2],t[3]],ordered:!0,listItemRegex:u$}:t[4]?{match:[e,t[4],t[5],""],ordered:!0,listItemRegex:u$}:t[6]?{match:[e,t[6],t[7]],ordered:!1,listItemRegex:l$}:t[8]?{match:[e,t[8],""],ordered:!1,listItemRegex:l$}:null:null}function o1(e,t,n,r,o,i,a){if(t.spaceEquivalent!==i)return!1;var s=e.match(a);if(s)return n?s[2]===o:s[1]===r;var l=e.match(n$);return!!l&&(n?l[4]&&l[5]===o:l[8]===r)}function dZ(e,t,n,r){for(var o=t,i=n,a=t[0];i<e.length;){var s=I$1(e,i),l=e.slice(i,s),c=c$1(l," ".repeat(r))?l.slice(r):l;if(c$1(c.trim(),a)&&A9(c.trim(),0,a)>=3)return{content:o,endPos:k$2(e,s)};o+="\n"+c,i=k$2(e,s)}return{content:o,endPos:i}}function Y$(e,n,r,o,i,a,s,l,c,u,d,p,f){var h=u?void 0:c[1],m=u?c[2]:void 0,g=u?u$:l$,v=d;if(!d)for(var y=k$2(e,a);y<e.length;){var b=I$1(e,y),x=e.slice(y,b),$=t(e,y,b),_=$.spaceEquivalent;if(w1(e,y,b)){var C=k$2(e,b);if(C<e.length)if(t(e,C,I$1(e,C)).spaceEquivalent+1>(E=j$(e,i+l+(S=SZ(c,u)),a,s,S).contentStartColumn)){v=!0;break}break}if(_<=s){var w=x.slice($.charCount).match(g);if(w&&(u?w[2]===m:w[1]===h))break}y=k$2(e,b)}var S,E=j$(e,i+l+(S=SZ(c,u)),a,s,S).contentStartColumn,k=o,T=k$2(e,a);if(c$1(o,"```")||c$1(o,"~~~")){var P=dZ(e,o,T,u?c[1].length+c[2].length+1:c[1].length+1);k=P.content,T=P.endPos}return n.push(iZ(k,v,p,f)),r.push(E),{newCurrentPos:T,itemHasBlankLine:v}}function EZ(e,t,n,r,o,i){if(o>r||i.disableParsingRawHTML)return!1;let a=t+n;return!(a>=e.length||"<"!==e[a])&&u6(e,a)}function u6(e,t){if(t>=e.length||"<"!==e[t])return!1;let n=e.length,r=t+1;if(r<n&&"/"===e[r]&&r++,r>=n)return!1;if(!U9(b$2(e,r)))return!1;for(r++;r<n;){let t=e[r],n=b$2(e,r);if(">"===t||" "===t||"\t"===t||"\n"===t||"\r"===t||"/"===t)break;if(!("-"===t||"_"===t||U9(n)||n>=48&&n<=57))return!1;r++}let o=0;for(;r<n;){let t=e[r],i=b$2(e,r);if(1===o)'"'===t&&(o=0),r++;else if(2===o)"'"===t&&(o=0),r++;else if('"'===t)o=1,r++;else if("'"===t)o=2,r++;else{if(">"===t)return!0;if("/"===t&&r+1<n&&">"===e[r+1])return!0;if(10===i||13===i)return!1;r++}}return!1}function xZ(e,n,r,o,i,a,s,l,c,u,d,p){let f=o,h=!1;for(;f<e.length;){let o=I$1(e,f),m=t(e,f,o),g=m.spaceEquivalent;if(w1(e,f,o)){h=!0,f=k$2(e,o);continue}let v=e.slice(f+m.charCount,o);if(g<=i&&o1(v,m,a,s,l,i,c))break;if(!(g>=r))break;{if(p&&h){let t=s$(e,f,o,m,v,u,d);if(t){f=t,h=!1;continue}}let t=V$(e,f,o,m,r-1,r,n,h,u,d,void 0);if(t.processed){f=t.newPos,h=t.wasBlank;continue}}}return f}function PZ(e,t,n,r){let o=e$(e,n,r,{inline:!1,list:!0});if(o.length>0)return t||1!==o.length||o[0].type!==O$1.paragraph?o:o[0].children;let i=W$(n,!0,()=>l1(e,0,e.length,n,r));return t&&i.length>0?[{type:O$1.paragraph,children:i}]:i}function iZ(e,t,n,r){let o=k6(e,0);if(!o||!(o.endPos>=e.length||" "===e[o.endPos]))return PZ(e,t,n,r);let i=o.endPos<e.length?o.endPos+1:o.endPos,a=PZ(e.slice(i),t,n,r),s=[o];return o.endPos<e.length&&s.push({type:O$1.text,text:" "}),s.push(...a),s}function IZ(e,t){if(!e[0])return!1;let n=e[0].indexOf(t);if(-1===n)return!1;let r=n+t.length;if(r>=e[0].length)return!1;let o=e[0][r];return!!o&&b$2(o)===_Z}function cZ(e,t,n){if(0===e.length)return!1;let r=e[e.length-1],o=t.trim();if(!c$1(o,"=")&&!c$1(o,"-")||o.length<1||!/^[=-]+[ \t]*$/.test(o))return!1;let i=[],a="";if(r.type===O$1.paragraph){let e=r;i=e.children,a=e.children.map(e=>e.type===O$1.text?e.text:"").join("").trim()}else if(r.type===O$1.text){let t=[],n=e.length-1;for(;n>=0&&e[n].type===O$1.text;)t.unshift(e[n]),n--;t.length>0&&(i=t,a=t.map(e=>e.text).join("").trim())}if(!a)return!1;let s="="===o[0]?1:2;if(r.type===O$1.paragraph)e.pop();else if(r.type===O$1.text)for(;e.length>0&&e[e.length-1].type===O$1.text;)e.pop();return e.push(z$(s,i,a,n.slugify)),!0}function V$(e,t,n,r,o,i,a,s,l,c,u,d){let p=r.spaceEquivalent,f=e.slice(t+r.charCount,n);if(p>=o+4){let n=X$(e,t);if(n){let e=n,t=r$(e.text||"",i);return a.push({...e,text:t}),{processed:!0,newPos:e.endPos,wasBlank:!1}}}if(p+1>=i&&p-(i-1)<=3){let o=t+r.charCount;if(o<n){let t=e[o];if("`"===t||"~"===t){let t=$Z(e,o,l,c);if(t){let e=t,n=r$(e.text||"",i-1);return a.push({...e,text:n,endPos:e.endPos}),{processed:!0,newPos:e.endPos,wasBlank:!1}}}if("|"===t){let t=aZ(e,o,l,c);if(t){let e=t;return a.push(e),{processed:!0,newPos:e.endPos,wasBlank:!1}}}}}if(f.length>0&&("-"===f[0]||"*"===f[0]||"+"===f[0]||f[0]>="0"&&f[0]<="9")&&/^([-*+]|\d{1,9}[.)])\s+/.test(f)){let t=u9(f,0,f.length,l,c);return a.push({type:O$1.text,text:"\n"},...t),{processed:!0,newPos:k$2(e,n),wasBlank:!1}}let h=M6(e,t,a,f,l,c);if(null!==h)return{processed:!0,newPos:h,wasBlank:!1};let m=e$(f,l,c,{inline:!1,list:!0});if(m.length>0){if(u&&m[0].type===O$1.paragraph){let e=m[0];a.push({type:O$1.text,text:"\n"},...e.children),m.length>1&&a.push(...m.slice(1))}else if(!s&&m[0].type===O$1.paragraph&&a.length>0){let e=a[a.length-1],t=m[0];e.type===O$1.paragraph?e.children.push({type:O$1.text,text:"\n"},...t.children):e.type===O$1.heading?a.push(...t.children):k9(a)?a.push(...m):a.push({type:O$1.text,text:" "},...t.children),m.length>1&&a.push(...m.slice(1))}else a.push(...m);return{processed:!0,newPos:k$2(e,n),wasBlank:!1}}if(s){let e=W$(l,!0,()=>l1(f,0,f.length,l,c));a.push({type:O$1.paragraph,children:e})}else K$(f,a,l,c);return{processed:!0,newPos:k$2(e,n),wasBlank:!1}}function o$(e,n,r,o){if(r.inline)return null;var i=r.inList;if(r.inList=!0,n>0){var a=b$2(e,n-1);if(a!==d$1&&a!==V0)return r.inList=i,null}var s=I$1(e,n);if((Le=t(e,n,s)).spaceEquivalent>3&&!r.inList)return r.inList=i,null;var l=e.slice(n,s),c=Le.charCount,u=C$(Ie=l.slice(c));if(!u)return r.inList=i,null;var{match:d,ordered:p,listItemRegex:f}=u,h=Le.spaceEquivalent,m=p?parseInt(d[1],10):void 0,g=p?d[2]:void 0,v=p?void 0:d[1],y=p?""===d[3]:""===d[2];function b(t,n){if(0===t)return!0;if(b$2(e,t-1)!==d$1)return!1;if(!n)return!0;for(var r=t-2;r>=0;){var o=b$2(e,r);if(o!==C$2&&o!==l$1)break;r--}return r<0||b$2(e,r)===d$1}if(y&&!b(n,!0))return r.inList=i,null;if(p&&1!==m&&!b(n,!1))return null;if(!p&&IZ(d,v))return null;var x=d.index||0,$=p?x+d[1].length+d[2].length+1:y?x+d[1].length:x+d[1].length+1,_=j$(e,n+c+$,s,h,$).contentStartColumn,C=h+x+d[1].length,w=p?C+d[2].length+1:y?C:C+1,S=[],E=[];function k(e,t,n){return n?e>=t:e>t}function T(){return S[S.length-1]}function P(){return E[E.length-1]??_}function M(t,n){let i=lZ(n),a=r.inList;r.inList=!0;let s=o$(e,t,r,o);return r.inList=a,s?(i.push(s),s):null}for(var L=k$2(e,s),I=L,R=!1;I<e.length;){var O=I$1(e,I),A=e.slice(I,O);if(""===A.trim()){for(var D=k$2(e,O);D<e.length;){if((te=b$2(e,D))===d$1);else if(!x6.has(e[D]))break;D++}var N=I$1(e,D),F=e.slice(D,N),z=t(e,D,N),B=F.slice(z.charCount);if(o1(B,z,p,v,g,h,f))R=!0;else{var j=s$(e,D,N,z,B,r,o);if(j){for(var H=j;H<e.length&&b$2(e,H)===d$1;)H++;if(H<e.length){var V=I$1(e,H),U=e.slice(H,V),W=t(e,H,V);o1(U.slice(W.charCount),W,p,v,g,h,f)&&(R=!0)}}}break}var Y=t(e,I,O),q=C$(A.slice(Y.charCount));if(!q)break;var G=q.match;if(p){if(G[2]!==g)break}else if(G[1]!==v)break;I=k$2(e,O)}var K=p?d[3]:d[2];K=K.trimStart();for(var X=n+c+(d.index||0),Z=p?X+d[1].length+d[2].length:X+d[1].length,J=Z;J<e.length;){if((te=b$2(e,J))!==C$2&&te!==l$1)break;J++}for(var Q=0,ee=Z;ee<s;){var te;if((te=b$2(e,ee))===l$1)Q+=4-Q%4;else{if(te!==C$2)break;Q++}ee++}var ne=!1;if(Z<e.length&&b$2(e,Z)===l$1){for(var re=1,oe=Z+1;oe<e.length&&b$2(e,oe)===l$1;)re++,oe++;re>=2&&(K=" "+K,ne=!0)}p||(y=y&&0===Q),Q>=4&&!ne&&(K=" ".repeat(Q-1)+K.trimStart()),K.trim();let ie=R;if(!R&&L<e.length)for(var ae=L;ae<e.length;){var se=I$1(e,ae),le=e.slice(ae,se);if(w1(e,ae,se)){for(var ce=k$2(e,se);ce<e.length;){var ue=I$1(e,ce);if(!w1(e,ce,ue))break;ce=k$2(e,ue)}if(ce<e.length){var de=t(e,ce,e.length),pe=de.spaceEquivalent;if(pe>=h){for(var fe=e.slice(ce,I$1(e,ce)).slice(de.charCount).match(f),he=fe&&(p?fe[2]===g:fe[1]===v),me=null,ge=L;ge<ae;ge=I$1(e,ge)+1){var ve=I$1(e,ge),ye=t(e,ge,ve),be=e.slice(ge,ve).slice(ye.charCount).match(f);if(be&&ye.spaceEquivalent>h&&ye.spaceEquivalent>=_&&(p?be[2]===g:be[1]===v)){var xe=ye.spaceEquivalent+1,$e=p?xe+be[1].length+be[2].length+1:xe+be[1].length+1,_e=ge+ye.charCount+be[0].length;me=j$(e,_e,ve,xe,$e-xe).contentStartColumn;break}}!he&&pe>=(Q>=5?w:_)&&(null===me||pe+1<me)&&(ie=!0)}}break}var Ce=t(e,ae,se),we=Ce.spaceEquivalent,Se=le.slice(Ce.charCount).match(f);if(Se&&(p?Se[2]===g:Se[1]===v)&&we<=h)break;ae=k$2(e,se)}var Ee=K;if(c$1(K,"```")||c$1(K,"~~~")){var ke=p?d[1].length+d[2].length+1:d[1].length+1,Te=dZ(e,K,L,ke);Ee=Te.content,L=Te.endPos}var Pe=!y&&""===K.trim()&&Q>0&&Q<5;if(!ie){var Me=">"===(Ee.length>0?Ee[0]:"");for(n=L;n<e.length;){var Le;s=I$1(e,n);if(""===(l=e.slice(n,s)).trim())break;if((Le=t(e,n,s)).spaceEquivalent<w)break;var Ie=l.slice(Le.charCount);if(Le.spaceEquivalent<=h&&o1(Ie,Le,p,v,g,h,f))break;if(g$(Ie)&&Le.spaceEquivalent>h)break;var Re=Ie.length>0?Ie[0]:"";if(">"===Re&&!(">"===Re&&Me)||"#"===Re||c$1(Ie,"```")||c$1(Ie,"~~~"))break;Ee+="\n"+Ie,L=n=k$2(e,s)}}if(S.push(iZ(Ee,ie,r,o)),E.push(_),ie&&(Q>=5||Pe)){let t=T();L=xZ(e,t,w,L,h,p,v,g,f,r,o,!0)}else if(!ie){let n=w-1;for(;L<e.length;){let i=I$1(e,L),a=e.slice(L,i),s=t(e,L,i),l=s.spaceEquivalent,c=a.slice(s.charCount);if(""===a.trim()||l<=h&&o1(c,s,p,v,g,h,f)||g$(c)&&l>h||l<n)break;let u=T(),d=V$(e,L,i,s,n,_,u,!1,r,o,!0);if(!d.processed)break;L=d.newPos}}for(var Oe=!1;L<e.length;){let n=I$1(e,L),i=e.slice(L,n),a=t(e,L,n),s=a.charCount,l=a.spaceEquivalent;if(""===i.trim())R=!0,Oe=!0,L=k$2(e,n);else{if(l<h){let t=i.slice(s);if(t.startsWith("<")&&EZ(e,L,s,h,l,o))break;let c=t.trim();if(c.length>0&&S.length>0&&!p9(c[0])&&!o1(t,a,p,v,g,h,f)){let i=T();if(i.length>0){let a=i[i.length-1];if(!Oe&&(a.type===O$1.paragraph||a.type===O$1.text)){K$(t,i,r,o),Oe=!1,L=k$2(e,n);continue}}}break}{let c=i.slice(s);if(S.length>0){if(l+1>=(E[S.length-1]||_)&&!o1(c,a,p,v,g,h,f)){let t=T();if(t.length>0&&cZ(t,c,o)){L=k$2(e,n);continue}}}if(D$(e,L))break;if(Oe){let t=s$(e,L,n,a,c,r,o);if(t){L=t,Oe=!1;continue}}if(l<=h){if(c.startsWith("<")&&EZ(e,L,s,h,l,o))break;if(!o1(c,a,p,v,g,h,f)){if(l===h&&!Oe){let t=c.trim();if(t.length>0&&!p9(t[0])){let t=l9(e,L,r,o);if(t&&t.type!==O$1.paragraph)break;let i=T();if(i.length>0&&!k9(i)){K$(c,i,r,o,!0),Oe=!1,L=k$2(e,n);continue}}}break}}if(TZ(S,y,Oe,K))break;let u=C$(c),d=u?u.match:null,m=d&&(p?d[2]===g:d[1]===v);if(m&&l>3&&Oe)break;if(m&&l<=h+3){if(l>=4&&Oe)break;if(l===h){let t=p?d[3]:d[2];if(t=t.trimStart(),L=Y$(e,S,E,t,L,n,l,s,d,p,R,r,o).newCurrentPos,Oe=!1,""===t.trim()){let t=S[S.length-1],n=P();L=xZ(e,t,n,L,h,p,v,g,f,r,o)}continue}if(l>h){if(Oe){let t=p?d[3]:d[2];t=t.trimStart(),L=Y$(e,S,E,t,L,n,l,s,d,p,R,r,o).newCurrentPos,Oe=!1;continue}let i=T(),c=k(l+1,P(),k9(i));if(c){let e=M(L,i);if(e){L=e.endPos,Oe=!1;continue}}if(!c&&m){let i=p?d[3]:d[2];if(i=i.trimStart(),!R){let r=k$2(e,n);for(;r<e.length;){let n=I$1(e,r),o=e.slice(r,n),i=t(e,r,n),a=i.spaceEquivalent;if(""===o.trim()){let r=k$2(e,n);if(r<e.length){if(t(e,r,e.length).spaceEquivalent+1>l+(p?d[1].length+d[2].length+1:d[1].length+1))break}break}if(a<=h){let e=o.slice(i.charCount).match(f);if(e&&(p?e[2]===g:e[1]===v)&&a<=h)break}r=k$2(e,n)}}L=Y$(e,S,E,i,L,n,l,s,d,p,R,r,o).newCurrentPos,Oe=!1;continue}if(!c&&!m)break;{let t=T(),i=0===t.length;if(i&&TZ(S,y,Oe,K))break;let s=t.some(e=>e.type===O$1.codeBlock||e.type===O$1.paragraph||e.type===O$1.blockQuote||e.type===O$1.orderedList||e.type===O$1.unorderedList||e.type===O$1.heading),c=i&&1===S.length?w:_;if(!(s?l>=c:l>c))break;{let t=V$(e,L,n,a,c,_,T(),Oe,r,o,void 0);if(t.processed){Oe=t.wasBlank,L=t.newPos;continue}}}}else if(l===h){if(!p&&d&&IZ(d,d[1]))break;let t=p?d[3]:d[2];t=t.trimStart(),L=Y$(e,S,E,t,L,n,h,s,d,p,R,r,o).newCurrentPos,Oe=!1}}else{if(!(l>h))break;{let t=T();if(g$(c)){if(k(l+1,P(),k9(t))){let e=M(L,t);if(e){L=e.endPos,Oe=!1;continue}}if(!(l-h>3))break;{let i=t.length>0?t[t.length-1]:null;if(i&&(i.type===O$1.paragraph||i.type===O$1.text)){K$(c,t,r,o),Oe=!1,L=k$2(e,n);continue}}}else{let e=M(L,t);if(e){L=e.endPos,Oe=!1;continue}}let i=_;if(!(k9(t)?l>=i-1:l>i-1))break;{let t=V$(e,L,n,a,i-1,_,T(),Oe,r,o,void 0);if(t.processed){Oe=t.wasBlank,L=t.newPos;continue}}}}}}}if(R&&S.length>1&&S[0].length>0&&S[0][0].type!==O$1.paragraph)for(var Ae=1;Ae<S.length;Ae++)if(S[Ae].length>0&&S[Ae][0].type===O$1.paragraph){for(var De=!1,Ne=0;Ne<S[0].length;Ne++){var Fe=S[0][Ne].type;if(Fe===O$1.codeBlock||Fe===O$1.heading||Fe===O$1.blockQuote||Fe===O$1.orderedList||Fe===O$1.unorderedList||Fe===O$1.htmlBlock||Fe===O$1.breakThematic){De=!0;break}}De||(S[0]=[{type:O$1.paragraph,children:S[0]}]);break}let ze=p?{type:O$1.orderedList,items:S,ordered:!0,start:m}:{type:O$1.unorderedList,items:S,ordered:!1};return r.inList=i,{...ze,endPos:L}}function aZ(e,t,n,r){if(n.inline)return null;let o=[],i=t;for(;i<e.length;){let t=I$1(e,i);if(w1(e,i,t))break;let n=e.slice(i,t).trim();if(!(-1!==n.indexOf("|")||o.length>=3&&n&&!p9(n[0])))break;o.push(n),i=k$2(e,t)}if(o.length<2)return null;let a=e=>"|"===e[0]&&"|"===e[e.length-1]?e.slice(1,-1):e,s=e=>{let t=[],n="",r=!1;for(let o=0;o<e.length;o++){let i=e[o];"\\"===i&&o+1<e.length&&"|"===e[o+1]?(n+="|",o++):"`"===i?(r=!r,n+=i):"|"!==i||r?n+=i:(t.push(n.trim()),n="")}return t.push(n.trim()),t},l=s(a(o[0]));if(!l.length)return null;let c=s(a(o[1]));if(c.length!==l.length||c.some(e=>!/^:?-+:?$/.test(e)))return null;let u=c.map(e=>{let t=":"===e[0],n=":"===e[e.length-1];return t&&n?"center":t?"left":n?"right":null});if(r.optimizeForStreaming&&2===o.length)return null;let d=e=>W$(n,!0,()=>e.map(e=>l1(e,0,e.length,n,r))),p=d(l),f=o.slice(2).map(e=>{let t=-1!==e.indexOf("|")?s(a(e)):[e.trim()],n=l.length;for(;t.length<n;)t.push("");return t.length=n,d(t)});return{type:O$1.table,header:p,cells:f,align:u,endPos:i}}G2=C6||={},G2[G2.URI=0]="URI",G2[G2.EMAIL=1]="EMAIL",G2[G2.ANGLE=2]="ANGLE";var l6=["div","p","section","article","aside","nav","header","footer","main","h1","h2","h3","h4","h5","h6","blockquote","ul","ol","li","dl","dt","dd","table","thead","tbody","tfoot","tr","td","th","form","fieldset","hr","pre","details","summary","figure","figcaption"],d6=new Set(["pre","script","style","textarea"]);function m9(e){return-1!==l6.indexOf(e.toLowerCase())}function w9(e){return d6.has(e)}function w1(e,t,n){for(var r=t;r<n;r++){let t=b$2(e,r);if(t!==C$2&&t!==l$1&&t!==V0)return!1}return!0}function W$(e,t,n){let r=e.inline;e.inline=t;try{return n()}finally{e.inline=r}}function k$(e,t,n){for(var r=t;r<n;){var o=I$1(e,r);if(w1(e,r,o))return r;r=k$2(e,o)}return n}function m$(e,t,n){return{type:O$1.htmlComment,text:p1(e),endPos:t,...n}}function v9(e,t,n,r,o,i,a,s,l){var c=p1(t);s&&(s.forceBlock||s.optimizeForStreaming)&&t&&!i&&(new RegExp("^<"+e.toLowerCase()+"(\\s[^>]*)?>$","i").test(t.trim())&&(c=""));var u=c,d=e.toLowerCase();if(new RegExp("^<"+d+"[\\s>]","i").test(u)){var p=u.indexOf(">");if(-1!==p){var f="</"+d+">",h=(u=u.slice(p+1)).indexOf(f);-1!==h&&(u=u.slice(0,h))}}else{var m="</"+d+">",g=u.indexOf(m);-1!==g&&(u=u.slice(0,g))}var v=[];if(u&&s&&!s.optimizeForStreaming){var y=l||{inline:!1,inHTML:!0,inAnchor:!1},b=u.trim(),x=F$.test(b),$=O$.test(b),_=H$.test(b);if(x||$||_)v=d9(b,{...y,inline:!1,inHTML:!0,inAnchor:y.inAnchor||"a"===d},s);else if(b){var C={...y,inline:!0,inHTML:!0,inAnchor:y.inAnchor||"a"===d};v=l1(b,0,b.length,C,s)}}return{type:O$1.htmlBlock,tag:e,attrs:r||{},rawAttrs:o,children:v,rawText:c,text:u,verbatim:!0,isClosingTag:i,canInterruptParagraph:a,endPos:n}}function h9(e){let t=O$.test(e),n=F$.test(e),r=N6.test(e);return t||n&&!r}function fZ(e,t,n,r,o,i,a,s,l,c){if(!s.inHTML&&!s.inline&&!n9(o,"\n")){let e=i,t=a.length;for(;e<t;){let t=I$1(a,e);if(w1(a,e,t))break;let n=a.slice(e,t).trim();if(n.length>0&&p9(n[0])){let t=M$(a,e,s,c);if(t){e=t.endPos;continue}let n=n1(a,e);if(n){e=n.endPos;continue}return null}e=k$2(a,t)}}let u=t,d=w9(u);var p=!d&&!K9(t),f=void 0;if(o){var h=o.indexOf(">");if(-1!==h){var m=o.slice(0,h+1);-1!==m.indexOf("\n")&&(f=m);for(var g=h,v=1;v<h;v++){var y=m[v];if(" "===y||"\t"===y||"\n"===y||">"===y){g=v;break}}n=m.slice(g,h)}}var b={...u1(n.replace(/^[\s\n\r\t]+/,""),t,e,c)},x=!1,$=!1;if(p&&r.length>0){var _="</"+u;if((P=r.indexOf(_))>=0){for(var C=P+_.length;C<r.length&&(" "===r[C]||"\t"===r[C]);)C++;if(C<r.length&&">"===r[C]){var w=r.slice(0,P);h9(w)?(r=w,$=!0):x=!0}}if(!$){var S=r.length-1;if("\n"===r[S]){for(S--;S>=0&&(" "===r[S]||"\t"===r[S]||"\r"===r[S]);)S--;S>=0&&"\n"===r[S]&&(x=!0)}}}var E=d||p&&x&&!h9(r),k=p1(r),T=k;if(E){k.length>0&&"\n"===k[0]&&(T=k=k.slice(1)),k.length>0&&"\n"===k[k.length-1]&&(T=k=k.slice(0,-1));var P;_="</"+u+">";-1!==(P=k.indexOf(_))&&(k=k.slice(0,P))}let M=k.match(/^([ \t]*)/),L=M?M[1]:"",I=new RegExp(`^${L.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`,"gm"),R=k.replace(I,""),O=F$.test(R),A=O$.test(R),D="p"===u,N=H$.test(R),F=D?O:O||A||s.inHTML&&N,z=[];if(R)if(F||N){z=d9(R,{...s,inline:!1,inHTML:!0,inAnchor:s.inAnchor||"a"===u},c)}else{let e={...s,inline:!0,inHTML:!!c.optimizeForStreaming||s.inHTML,inAnchor:s.inAnchor||"a"===u};z=l1(R,0,R.length,e,c)}var B=void 0;return E&&(B=void 0!==f?f+T:T),{type:O$1.htmlBlock,tag:E?t:e,attrs:b,rawAttrs:n,children:z,rawText:B,text:R,verbatim:E,canInterruptParagraph:!0,endPos:i}}function M$(e,t,n,r){if("<"!==e[t])return null;if(r.optimizeForStreaming&&n.inHTML)return null;if(n.inline,t+1<e.length)if("?"===e[t+1]){var o=U$(e,t);if(o&&"pi"===o.kind)return m$(o.text||"",o.endPos,{raw:!0})}else if("!"===e[t+1]){if(t+3<e.length&&"\x3c!--"===e.slice(t,t+4)){n.inline;var i=U$(e,t);if(i&&"comment"===i.kind){var a=i.text||"",s=!1;return"\x3c!--\x3e"===a?(a="",s=!0):"\x3c!---\x3e"===a?(a="-",s=!0):a.startsWith("\x3c!--")&&a.endsWith("--\x3e")&&(a=a.slice(4,-3)),n.inline,m$(a,i.endPos,{endsWithGreaterThan:s})}}var l=U$(e,t);if(l&&("declaration"===l.kind||"cdata"===l.kind))return m$(l.text||"",l.endPos,{raw:!0})}if(t+1<e.length){let n=e[t+1];if(" "===n||"\n"===n||"\t"===n||"\r"===n)return null}var c=e.indexOf(">",t+1);if(-1!==c){var u=e.slice(t+1,c),d=-1!==u.indexOf(" ")||-1!==u.indexOf("\t");if(!d&&(c$1(u,"http://")||c$1(u,"https://")))return null;if(!d&&mZ(u))return null}var p,f,h=n1(e,t);if(!h&&!n.inline){for(var m=e.length,g=I$1(e,t),v=t,y=0;v<g&&y<3&&(" "===e[v]||"\t"===e[v]);)y++,v++;if(v>=g||"<"!==e[v])return null;if(v+1<g)if(tt=i$(e,v+1)){var b=m9(nt=tt.tagName);if(!b)return null;for(var x=tt.nextPos,$=!1,_=!1,C="",w=g,S=!1;w<m&&!S;){for(var E=!1;x<w;){var k=e[x];if(_)k===C&&(_=!1,C=""),"\n"!==k&&"\r"!==k||($=!0),x++,E=!0;else if('"'===k||"'"===k)_=!0,C=k,x++,E=!0;else if("\n"===k||"\r"===k){$=!0,x++,E=!0;var T=I$1(e,x);if(T===x)break;w=T}else{if(">"===k){x++,S=!0;break}x++,E=!0}}if(S)break;if(!E&&x>=w){if((P=I$1(e,w+1))<=w)break;w=P}else{if(!(x>=w&&w<m))break;var P;if((P=I$1(e,w+1))<=w)break;w=P}}if(!$&&S)return null;x>=g&&g<m&&(x=g);var M=b?"type6":"type7",L=x,I=k$(e,k$2(e,g),m),R=e.slice(L,I),O=t+1<e.length&&"/"===e[t+1];if("type7"===M&&""===R.trim()){var A=e.slice(t,I);return(ze=I$1(A,0))<A.length&&ze++,v9(nt,je=A.slice(0,ze),I,{},void 0,O,!1,r,n)}return v9(nt,Ve=e.slice(t,I),I,{},void 0,O,"type6"===M,r,n)}return null}if(!h)return null;if(-1!==c){var D=e.slice(t+1,c);if((c$1(D,"http://")||c$1(D,"https://"))&&(-1!==D.indexOf(" ")||-1!==D.indexOf("\t")))return null}if((f=t+(h.isClosing?2:1))<e.length){var N=e[f],F=b$2(N);if((F>=97&&F<=122||F>=65&&F<=90)&&f+1<e.length&&":"===e[f+1])return null}if(h.isClosing){if(h.attrs.trim().length>0)return null;if(!n.inline){m=e.length,g=I$1(e,t);for(var z=L=h.endPos;z<g&&(" "===e[z]||"\t"===e[z]||"\r"===e[z]);)z++;if(z>=g||"<"===e[z]&&((p=n1(e,z))&&m9(p.tagLower))){I=k$(e,k$2(e,g),m);(R=e.slice(L,I)).length>0&&("\r"===R[0]&&"\n"===R[1]?R=R.slice(2):"\n"!==R[0]&&"\r"!==R[0]||(R=R.slice(1)));let t=h.tagLower||h.tagName.toLowerCase();return v9(h.tagName,R,I,u1(h.whitespaceBeforeAttrs+h.attrs,t,h.tagName,r),h.whitespaceBeforeAttrs+h.attrs,!0,!1,r,n)}}var B=e.slice(t,h.endPos);return{type:O$1.htmlSelfClosing,tag:h.tagName,attrs:{},endPos:h.endPos,isClosingTag:!0,rawText:B}}if((f=t+(h.isClosing?2:1))<e.length){var j=e[f];if(" "===j||"\t"===j||"\n"===j||"\r"===j)return null}var H=h.tagLower,V=K9(h.tagName);let U=h.tagName.length>0&&h.tagName[0]>="A"&&h.tagName[0]<="Z";if(h.isSelfClosing||V&&"a"!==H){if(h.hasNewline&&!U)return null;if(!n.inHTML&&!n.inline&&!U)return null;var W=u1(h.attrs.replace(/\/\s*$/,""),H,h.tagName,r);B=n.inline?e.slice(t,h.endPos):void 0;let o={type:O$1.htmlSelfClosing,tag:h.tagName,attrs:W,endPos:h.endPos};return void 0!==B&&(o.rawText=B),o}if(n.inline){var Y=h.attrs.replace(/\/\s*$/,""),q=h.whitespaceBeforeAttrs+Y,G={...u1(Y,H,h.tagName,r)},K=h.endPos,X=[];if(!K9(h.tagName)){var Z=w6(e,h.endPos,H);if(null!==Z){var J=e.slice(h.endPos,Z[0]);J&&(X=n.inHTML&&H$.test(J)||h9(J)?d9(J,{...n,inline:!1,inHTML:!0,inAnchor:n.inAnchor||"a"===H},r):l1(J,0,J.length,{...n,inline:!0,inHTML:!!r.optimizeForStreaming||n.inHTML,inAnchor:n.inAnchor||"a"===H},r)),K=Z[1]}}return{type:O$1.htmlBlock,tag:h.tagName,attrs:G,rawAttrs:q,children:X,verbatim:!1,endPos:K}}if(!n.inline){m=e.length,g=I$1(e,t);for(var Q=h.tagLower,ee=w9(Q),te=!ee&&m9(h.tagName),ne=!1,re=t;re<h.endPos;){if(">"===e[re]){ne=!0;break}re++}for(z=h.endPos;z<g&&(" "===e[z]||"\t"===e[z]);)z++;var oe=z>=g||"\n"===e[z]||"\r"===e[z]||te&&z<g||!ne;if(ee&&ne&&!h.isClosing){var{tagName:ie,endPos:ae,attrs:se}=h,le=ae;"\n"===e[le]&&le++;for(var ce=le,ue=le,de=1,pe=Q.length+1;de>0;){var fe=e.indexOf("<",le);if(-1===fe){ue=m,le=m;break}var he=-1,me=-1;if("/"===e[fe+1])me=fe;else if(fe+pe+1<=m&&(e[fe+1]===Q[0]||e[fe+1]===ie[0])){e.substring(fe+1,fe+pe).toLowerCase()!==Q||" "!==e[fe+pe]&&">"!==e[fe+pe]||(he=fe)}if(-1!==he||-1!==me)if(-1!==he&&(-1===me||he<me))le=he+pe+1,de++;else{for(var ge=me+2;ge<m;){var ve=e[ge];if(" "!==ve&&"\t"!==ve&&"\n"!==ve&&"\r"!==ve)break;ge++}if(ge+Q.length>m)break;if(e.substring(ge,ge+Q.length).toLowerCase()!==Q){le=ge;continue}for(ge+=Q.length;ge<m;){var ye=e[ge];if(" "!==ye&&"\t"!==ye&&"\n"!==ye&&"\r"!==ye)break;ge++}if(ge>=m||">"!==e[ge]){le=ge;continue}var be=I$1(e,ge+1);ue=be,le=be+1,de--}else le=fe+1}for(var xe=0;le+xe<m&&"\n"===e[le+xe];)xe++;var $e=e.slice(t,le+xe),_e=e.slice(ce,ue),Ce=le+xe;return fZ(h.tagName,h.tagName,se,_e,$e,Ce,e,n,!1,r)}if(oe||!ne){M=te?"type6":"type7",L=h.endPos,I=k$(e,k$2(e,g),m);if("type6"===M&&!h.isClosing){let t=U?h.tagName:h.tagLower||h.tagName.toLowerCase();for(var we="</"+t,Se="<"+t,Ee=L,ke=1,Te=-1;Ee<I&&ke>0;){for(var Pe=e.indexOf(Se,Ee),Me=e.indexOf(we,Ee);-1!==Pe&&Pe<I;){var Le=Pe+Se.length;if(Le>=m){Pe=-1;break}var Ie=e[Le];if(" "===Ie||"\t"===Ie||"\n"===Ie||"\r"===Ie||">"===Ie)break;Pe=e.indexOf(Se,Le)}if((-1===Pe||Pe>=I)&&(Pe=I),(-1===Me||Me>=I)&&(Me=I),Pe<Me)ke++,Ee=Pe+Se.length;else{if(!(Me<I))break;if(0===--ke){Te=Me;break}Ee=Me+we.length}}if(-1!==Te&&Te<I){for(var Re=Te+we.length;Re<m&&(" "===e[Re]||"\t"===e[Re]);)Re++;if(Re<m&&">"===e[Re]){for(var Oe=Re+1,Ae=Oe;Ae<m&&"\n"!==e[Ae];)Ae++;for(Ae<m&&Ae++;Ae<m&&(" "===e[Ae]||"\t"===e[Ae]);)Ae++;if(Ae<m&&"<"===e[Ae]&&!c$1(e.slice(Ae),we))n1(e,Ae)&&(I=Oe)}}else if(-1!==(Te=e.indexOf(we,L))){var De=e.slice(L,Te);if(U||h9(De)){for(var Ne=Te+we.length;Ne<m&&(" "===e[Ne]||"\t"===e[Ne]);)Ne++;if(Ne<m&&">"===e[Ne])I=I$1(e,Ne+1)}}}R=e.slice(L,I);var Fe=h.whitespaceBeforeAttrs+h.attrs;O=h.isClosing;let o=()=>{let e=h.tagLower||h.tagName.toLowerCase(),t=h.whitespaceBeforeAttrs+h.attrs;return{parsed:u1(t,e,h.tagName,r),raw:t}};if("type7"===M&&""===R.trim()){if(-1!==e.slice(t,h.endPos).indexOf("\n"))return null;var ze,Be=h.endPos;(ze=I$1(e,Be))<e.length&&ze++;var je=e.slice(t,ze);let i=o();return v9(h.tagName,je,I,i.parsed,i.raw,O,!1,r,n)}if((h.hasNewline||!ne)&&"type7"===M){var He=h.endPos,Ve=e.slice(t,He)+R;let i=o();return v9(h.tagName,Ve,I,i.parsed,i.raw,O,!1,r,n)}let i=h.tagLower||h.tagName.toLowerCase();var Ue={...u1(Fe,i,h.tagName,r)};if("type6"===M){var We=R,Ye=R.indexOf("</"+i);if(Ye>=0){for(z=Ye+2+h.tagName.length;z<R.length&&(" "===R[z]||"\t"===R[z]);)z++;z<R.length&&">"===R[z]&&(We=R.slice(0,Ye))}if(h9(We))return fZ(h.tagName,h.tagName,Fe,We,e.slice(t,h.endPos),I,e,n,!1,r)}var qe=R;qe.length>0&&("\r"===qe[0]&&"\n"===qe[1]?qe=qe.slice(2):"\n"!==qe[0]&&"\r"!==qe[0]||(qe=qe.slice(1)));for(var Ge=qe.split("\n"),Ke=1/0,Xe=0;Xe<Ge.length;Xe++){var Ze=Ge[Xe];if(0!==Ze.trim().length){for(y=0;y<Ze.length&&(" "===Ze[y]||"\t"===Ze[y]);)y++;y<Ke&&(Ke=y)}}if(Ke>0&&Ke<1/0){for(var Je=[],Qe=0;Qe<Ge.length;Qe++){var et=Ge[Qe];0===et.trim().length?Je.push(et):Je.push(et.slice(Ke))}qe=Je.join("\n")}return v9(h.tagName,qe,I,Ue,Fe,O,"type6"===M,r,n)}}if(n.inline)return null;var tt,nt;if(!(tt=i$(e,t+1)))return null;if(!K9(nt=tt.tagName))return null;let rt=tt.tagLower;for(var ot=tt.nextPos,it=e.length;ot<it&&j1(e[ot]);)ot++;for(var at=ot;ot<it&&">"!==e[ot];)ot++;if(ot>=it)return null;let st=e.slice(at,ot).trim(),lt=ot+1;for(;lt<it&&j1(e[lt]);)lt++;let ct="</"+rt+">",ut=e.toLowerCase().indexOf(ct,lt);if(-1!==ut&&e.slice(lt,ut).trim())return null;let dt=++ot;for(;ot<it&&j1(e[ot]);)ot++;ot<it&&"\n"===e[ot]&&ot++;let pt=u1(st,nt,nt,r);return{type:O$1.htmlSelfClosing,tag:nt,attrs:pt,endPos:dt}}function i6(e,t){if("<"!==e[t])return null;var n=e.length,r=!1,o=t+1;t+1<n&&"/"===e[t+1]&&(r=!0,o=t+2);var i=i$(e,o);if(!i)return null;var{tagName:a,tagLower:s,nextPos:l}=i;if(l<n){var c=e[l];if(">"===c||"/"===c){var u=">"===c?l+1:l+2;if("/"===c&&(l+1>=n||">"!==e[l+1]))return null;var d="/"===c,p=m9(a);return{kind:"tag",tagNameLower:s,tagName:a,isClosing:r,isSelfClosing:d,hasNewline:!1,type6Candidate:p,type7Candidate:!w9(s)&&!p,endPos:u,attrs:"",whitespaceBeforeAttrs:""}}}for(var f=l,h=!1;l<n;){var m=e[l],g=b$2(e,l);if(" "===m||"\t"===m);else{if(10!==g&&13!==g)break;h=!0}l++}for(var v=e.slice(f,l),y=l,b=0,x=!1,$=!1,_=0;y<n;){var C=e[y];g=b$2(e,y);if(1===_){if('"'===C){if(y+1<n&&'"'===e[y+1])return null;_=0}y++}else if(2===_)"'"===C&&(_=0),y++;else if('"'===C)_=1,y++;else if("'"===C)_=2,y++;else if("{"===C||"}"===C&&b>0)b+="{"===C?1:-1,y++;else{if(">"===C&&0===b){if(y>l){for(var w=y-1;w>=l;){var S=e[w];if(" "!==S&&"\t"!==S)break;w--}w>=l&&"/"===e[w]&&(x=!0,$=w<y-1)}y++;break}if("*"===C||"#"===C||"!"===C){for(var E=y+1;E<n;){var k=e[E];if("="===k||" "===k||"\t"===k||"\n"===k||"\r"===k||">"===k)break;E++}if(E<n&&"="===e[E])return null}10!==g&&13!==g||(h=!0),y++}}if(y>n||">"!==e[y-1])return null;if(1===_||2===_)return null;if(b>0)return null;if($)return null;var T=y-1;x&&T--;for(var P=e.slice(l,T),M=x,L=-1,I=!1,R="",O=!1,A=0;A<P.length;A++){m=P[A];if(I)m===R&&(I=!1,L=A,R="",O=!1);else if('"'===m||"'"===m)I=!0,R=m,O=!1;else if("="===m)O=!0;else if(-1!==L&&A===L+1){if(U9(g=m.charCodeAt(0)))return null}else{if(O&&!I&&("*"===m||"#"===m||"!"===m))return null;j1(m)&&(O=!1)}}var D=m9(a);return{kind:"tag",tagNameLower:s,tagName:a,isClosing:r,isSelfClosing:M,hasNewline:h,type6Candidate:D,type7Candidate:!w9(s)&&!D,endPos:y,attrs:P,whitespaceBeforeAttrs:v}}function U$(e,t){if(t>=e.length||"<"!==e[t])return null;var n=e.length;if(t+1>=n)return null;var r=e[t+1];if("!"===r){if(t+4<=n&&"\x3c!--"===e.slice(t,t+4)){if((o=t+4)<n&&">"===e[o])return{kind:"comment",hasNewline:!1,endPos:o+1,text:e.slice(t,o+1),raw:!0};if(o+1<n&&"-"===e[o]&&">"===e[o+1])return{kind:"comment",hasNewline:!1,endPos:o+2,text:e.slice(t,o+2),raw:!0};for(;o+2<n;){if("--\x3e"===e.slice(o,o+3))return{kind:"comment",hasNewline:!1,endPos:o+3,text:e.slice(t,o+3),raw:!0};o++}return null}if(t+9<=n&&"<![CDATA["===e.slice(t,t+9)){for(var o=t+9;o+2<n;){if("]]>"===e.slice(o,o+3))return{kind:"cdata",hasNewline:!1,endPos:o+3,text:e.slice(t,o+3),raw:!0};o++}return null}if(t+2<n&&U9(e.charCodeAt(t+2))){for(o=t+2;o<n&&">"!==e[o];)o++;return o>=n?null:{kind:"declaration",hasNewline:!1,endPos:o+1,text:e.slice(t,o+1),raw:!0}}return null}if("?"===r){for(o=t+2;o+1<n;){if("?>"===e.slice(o,o+2))return{kind:"pi",hasNewline:!1,endPos:o+2,text:e.slice(t,o+2),raw:!0};o++}return null}return i6(e,t)}function h$(e,t){if(t>=e.length)return!1;var n=e[t];return"="===n||"-"===n||"_"===n||"*"===n||"#"===n||">"===n||"`"===n||"~"===n||"["===n||n>="0"&&n<="9"}function J$(e,t){if(t>=e.length)return!1;var n=e[t];return'"'===n||"'"===n||"("===n}function c6(e,t,n){var r=e.length;if(t>=r||e[t]!==n)return null;for(var o=++t,i=!1;t<r&&e[t]!==n;){var a=e.charCodeAt(t);if(a===d$1){if(i)return null;i=!0,t++}else if(a===V0)if(t+1<r&&e.charCodeAt(t+1)===d$1){if(i)return null;i=!0,t+=2}else i=!1,t++;else i=!1,a===k1&&t+1<r&&t++,t++}return t>=r?null:{value:e.slice(o,t),endPos:t+1}}function a6(e,t){var n=e.length;if(t>=n||"("!==e[t])return null;for(var r=++t,o=1,i=!1;t<n&&o>0;){var a=e.charCodeAt(t);if(a===d$1){if(i)return null;i=!0,t++}else if(a===V0)if(t+1<n&&e.charCodeAt(t+1)===d$1){if(i)return null;i=!0,t+=2}else i=!1,t++;else i=!1,a===k1&&t+1<n?t++:a===FZ?o++:a===OZ&&o--,t++}return 0!==o?null:{value:e.slice(r,t-1),endPos:t}}function r6(e,t){for(var n=e.length,r=t;r<n;){var o=0===r||"\n"===e[r-1];if(e.charCodeAt(r)===d$1&&r>t){var i=r+1;if(i<n&&e.charCodeAt(i)===V0&&i++,i<n&&e.charCodeAt(i)===d$1){for(var a=i+1;a<n&&(" "===e[a]||"\t"===e[a]);)a++;var s=a-(r+1);if(e.charCodeAt(r+1)===V0&&s--,a<n&&e.charCodeAt(a)!==d$1&&e.charCodeAt(a)!==V0&&s<4)return r}}if(o&&c$1(e,"[^",r)){for(var l=r+2;l<n&&"]"!==e[l];)l++;if(l<n&&"]"===e[l]&&l+1<n&&":"===e[l+1])return r}r++}return n}function s6(e,t,n){let r=e.length,o=t,i=o<r&&"<"===e[o];i&&o++;let a=o,s=a;if(a>=r){if(!i)return null;s=a}else{if(n>0&&a<r&&"\n"===e[a])return null;for(;s<r&&(!i||">"!==e[s]);){if("\n"===e[s]){let t=s+1;if(t>=r)break;if(t<r&&"\n"===e[t])break;let n=t;for(;n<r&&(" "===e[n]||"\t"===e[n]);)n++;if(n<r&&J$(e,n))break;if(n<r&&"["===e[n])break;if(n<r){let t=e[n];if(h$(e,n))break;if(t>="a"&&t<="z"){let t=n+1;for(;t<r&&t<n+32&&(e[t]>="a"&&e[t]<="z"||e[t]>="A"&&e[t]<="Z"||e[t]>="0"&&e[t]<="9"||"+"===e[t]||"."===e[t]||"-"===e[t]);)t++;if(!(t<r&&":"===e[t]))break}}s=n;continue}if(!i&&(" "===e[s]||"\t"===e[s])){let t=s+1;for(;t<r&&(" "===e[t]||"\t"===e[t]);)t++;if(t<r&&J$(e,t))break;if(t<r&&"\n"===e[t]){let n=t+1;if(n<r&&"\n"===e[n])break;let o=n;for(;o<r&&(" "===e[o]||"\t"===e[o]);)o++;if(o<r&&J$(e,o))break}}s++}}if(i&&(s>=r||">"!==e[s]))return null;let l=e.slice(a,s),c=[],u=0;for(let C=0;C<=l.length;C++)if(C===l.length||"\n"===l[C]){let e=l.slice(u,C);e=e.trim(),e.length>0||0===c.length?(c.push(e),C<l.length&&c.push("\n")):C<l.length&&c.push("\n"),u=C+1}l=c.join(""),l=l.trim(),o=i?s+1:s;var d=!1;if(o<r&&"\n"===e[o]){for(var p=o+1;p<r&&(" "===e[p]||"\t"===e[p]);)p++;if(p<r){let t=e[p];if(h$(e,p)&&(d=!0),!d&&"="!==t&&"-"!==t){var f=I$1(e,p);if(f<r){for(var h=k$2(e,f);h<r&&(" "===e[h]||"\t"===e[h]);)h++;if(h<r){var m=e[h];"="!==m&&"-"!==m||(d=!0)}}}}}if(!d&&o<r&&J$(e,o))return null;let g,v=0;for(;o<r&&!d;){let t=e[o];if("\n"===t){if(v++,v>1)break;o++;var y=o;if(o=g0(e,o),o<r&&V9(e[o])&&"\n"!==e[o]){o=y-1;break}if(o<r&&(e[o],h$(e,o))){d=!0,o=y-1;break}}else{if(" "!==t&&"\t"!==t){if(V9(t))break;break}o++}}if(o<r){let t=e[o];var b="("===t?a6(e,o):'"'===t||"'"===t?c6(e,o,t):null;if(null===b&&('"'===t||"'"===t||"("===t))return null;if(b){g=b.value,o=b.endPos;for(var x=o;x<r&&(" "===e[x]||"\t"===e[x]);)x++;if(x<r&&"\n"!==e[x]&&"\r"!==e[x])return null;o=x}}if(o=g0(e,o),o<r&&"\n"!==e[o])for(var $=o;$<r&&"\n"!==e[$];){if(" "!==e[$]&&"\t"!==e[$])return null;$++}if(void 0===g&&o<r&&"\n"!==e[o])for(var _=o;_<r&&"\n"!==e[_];){if(" "!==e[_]&&"\t"!==e[_])return null;_++}return{endPos:o<r&&"\n"===e[o]?o+1:o,target:l,title:g}}function o6(e,t){let n=r6(e,t),r=n<e.length&&"\n"===e[n]&&"\n"===e[n+1],o=n;var i=[];let a=t,s=0,l=!1;for(;a<o;){let t=I$1(e,a);if(t>o&&(t=o),0===s){let n=t;for(;n>a&&(" "===e[n-1]||"\t"===e[n-1]);)n--;let r=e.slice(a,n);i.push(r),l=0===r.length}else{let n=0,r=a;for(;r<t&&r<a+4&&" "===e[r];)n++,r++;let o=!1;for(let i=a;i<t;i++)if(" "!==e[i]&&"\t"!==e[i]&&"\r"!==e[i]){o=!0;break}let s=!o;n>=4&&l||4!==n||l?i.push(e.slice(a,t)):i.push(e.slice(a+4,t)),l=s}if(t<o){let n=b$2(e,t);n===V0||n===d$1?(i.push("\n"),a=k$2(e,t)):a=o}else a=o;s++}let c=i.join("");r&&(c=c.replace(/\n$/,""));for(var u=c.length;u>0;){var d=c[u-1];if("\n"!==d&&" "!==d)break;u--}return u<c.length&&(c=c.slice(0,u)),{endPos:n,target:c,title:void 0}}function B9(e,n,r,o,i){if("["!==e[n])return null;var a=n+1<e.length&&"^"===e[n+1];if(i?!a:a)return null;for(var s=n;s>0&&"\n"!==e[s-1];)s--;if(t(e,s,n).spaceEquivalent>=4||r.inline)return null;var l=n+(i?2:1),c=e.length,u=R6(e,l,c,"]");if(-1===u)return null;var d=e.slice(l,u);if(d.length>999)return null;for(var p=!1,f=!1,h=!1,m=0;m<d.length;m++){var g=d[m];if("\\"===g&&m+1<d.length)m++;else{var v=b$2(g);v===g1||v===H9?f=!0:v===d$1||v===V0?h=!0:v!==C$2&&v!==l$1&&(p=!0)}}if(!p||f)return null;var y=u+1;if(h){var b=b$2(e,l),x=b$2(e,u-1);if(b===d$1||b===V0||x===d$1||x===V0||y>=c||":"!==e[y])return null}else if((y>=c||":"!==e[y])&&((y=g0(e,y))<c&&b$2(e,y)===d$1&&(y=g0(e,y+1)),y>=c||":"!==e[y]))return null;y++;for(var $=0;y<c;){var _=b$2(e,y);if(_===d$1){if(++$>1)break;y=g0(e,y+1)}else{if(_!==C$2&&_!==l$1)break;y++}}let C=i?o6(e,y):s6(e,y,$);if(!C)return null;let w=hZ(d),S=r.refs||{},E=i?`^${w}`:w;return S[E]||(S[E]={target:Q$(C.target.trim()),title:C.title?Q$(C.title):void 0},r.refs=S),{type:i?O$1.footnote:O$1.ref,endPos:C.endPos}}function rZ(e,t,n){for(var r=[],o=0;o<t.length;){var i=t[o];if(!i||"*"!==i.type&&"_"!==i.type&&"~"!==i.type&&"="!==i.type)o++;else if(i.canClose&&i.active){for(var a=6*("*"===i.type?0:"_"===i.type?1:"~"===i.type?2:3)+i.length%3*2+(i.canOpen?1:0),s=void 0!==r[a]?r[a]:-1,l=-1,c=i.type,u=i.inAnchor,d=i.canOpen,p=i.length,f=p%3,h=o-1;h>s;h--){var m=t[h];if(m&&m.active&&m.type===c&&m.canOpen&&m.inAnchor===u){var g=m.length;if(!d&&!m.canClose||0===f||(g+p)%3!=0){l=h;break}}}if(l>=0){var v=t[l],y=(g=v.length)>=2&&p>=2,b=y?2:1;if(b>g||b>p){o++;continue}var x=v.nodeIndex,$=i.nodeIndex,_=x+1,C=$,w=e.slice(_,C);if(w.length>0){var S=C-_;e.splice(_,S);for(var E=0;E<t.length;E++)t[E].nodeIndex>_&&(t[E].nodeIndex-=S);$>_&&($-=S)}var k="~"===v.type?"del":"="===v.type?"mark":y?"strong":"em",T={type:O$1.textFormatted,tag:k,children:w},P=e[x];if(!P||!P.text){v.active=i.active=!1;continue}var M=P.text.length<=b;if(M){e.splice(x,1);for(E=0;E<t.length;E++)t[E].nodeIndex>x&&t[E].nodeIndex--;$>x&&$--}else P.text=P.text.slice(b);var L=e[$];if(!L||!L.text){v.active=i.active=!1;continue}var I=L.text.length<=b;if(I){e.splice($,1);for(E=0;E<t.length;E++)t[E].nodeIndex>$&&t[E].nodeIndex--}else L.text=L.text.slice(b);var R=M?x<$?$-1:x:x+1;(R<0||R>e.length)&&(R=R<0?0:e.length),e.splice(R,0,T);for(E=0;E<t.length;E++)t[E].nodeIndex>=R&&t[E].nodeIndex++;for(E=l+1;E<o;E++)t[E].active=!1;M?v.active=!1:(v.length-=b,0===v.length&&(v.active=!1)),I?(i.active=!1,o++):(i.length-=b,0===i.length&&(i.active=!1,o++))}else r[a]=o-1,i.canOpen||(i.active=!1),o++}else o++}var O=0;for(h=0;h<t.length;h++)t[h].active&&(t[O++]=t[h]);t.length=O}function i9(e,n,r){var o=[],i=0,a=-3;if(n.inline)return l1(e,0,e.length,n,r);if(0===i&&e.startsWith("---")){var s=h6(e,i);s&&(o.push(s),i=s.endPos)}for(;i<e.length;){for(;i<e.length&&"\n"===e[i];)i++;if(i>=e.length)break;a=-3;let s=e[i],c=l9(e,i,n,r);if(c){if(c.type===O$1.codeBlock){var l="`"===s||"~"===s;if(!l&&(" "===s||"\t"===s)){let n=t(e,i,I$1(e,i));l=n.spaceEquivalent<=3&&i+n.charCount<e.length&&("`"===e[i+n.charCount]||"~"===e[i+n.charCount])}}if(c.type===O$1.htmlComment){o.push(c);let t=i;i=c.endPos;let n=I$1(e,t);if(i<n){let t=e.slice(i,n);t.trim().length>0&&o.push({type:O$1.text,text:t}),(i=n)<e.length&&"\n"===e[i]&&i++}continue}if(c.type!==O$1.htmlBlock&&c.type!==O$1.htmlSelfClosing){o.push(c),i=c.endPos;continue}if(c.type!==O$1.htmlSelfClosing||!0!==c.isClosingTag||n.inline||n.inHTML){o.push(c),i=c.endPos;continue}}let u=-3!==a?a:i;if(-3===a){if(j1(s)){let n=t(e,i,I$1(e,i)),r=i+n.charCount;u=n.spaceEquivalent<=3&&r<e.length&&"["===e[r]?r:-1}else u="["===s?i:-1;a=u}if(u>=0&&u+1<e.length&&"^"===e[u+1]&&(u=-1),u>=0){let t=B9(e,u,n,r,!1);if(t){o.push(t),i=t.endPos;continue}let a=S6(e,u,0===i);if(a.shouldSkip){i=a.newPos;continue}}let d=pZ(e,i,n,r);if(d){o.push(d),i=d.endPos;continue}let p=i;if(j1(e[p])){p=i+t(e,i,I$1(e,i)).charCount}if(p<e.length&&"["===e[p]&&p+1<e.length&&"^"===e[p+1]){let t=B9(e,p,n,r,!0);if(t){i=t.endPos;continue}}let f=a$(e,i,n,r);f?(o.push(f),i=f.endPos):i++}let c=n.refs||{},u={};for(let t in c)u[t]=c[t];return e9(u)?[{type:O$1.refCollection,refs:u},...o]:o}function v$(e,n,r){var o=0,i=!0;let a=e.length;for(;o<a;){for(var s=0;o<a&&b$2(e,o)===d$1;)s++,o++;if(o>=a)break;s>0&&(i=!0);let x=b$2(e,o);if(x===t0||x===e1){var l=$Z(e,o,{},r);if(l){o=l.endPos,i=!0;continue}}for(var c=o,u=0;c<a&&u<4;){let t=b$2(e,c);if(t===C$2)u++,c++;else{if(t!==l$1)break;u+=4-u%4,c++}}if(u<4&&c<a&&b$2(e,c)===g1&&i){if(c+1<a&&b$2(e,c+1)===D9){i=!1,o=(p=I$1(e,o))>=a?a:k$2(e,p);continue}var d=B9(e,c,{inline:!1,refs:n},r,!1);if(d){o=d.endPos,i=!0;continue}var p=I$1(e,o),f=e.indexOf(":",c+1);if(-1===f||f>=p){var h=t(e,o,p);!w1(e,o,p)&&x!==T9&&x!==C1&&x!==D1&&x!==d1&&h.spaceEquivalent<4&&(i=!1)}o=p>=a?a:k$2(e,p)}else{if(x===C1&&i){for(var m=o,g=[];m<a;){p=I$1(e,m);for(var v=m;v<p;){let t=b$2(e,v);if(t!==C$2&&t!==l$1)break;v++}if(v>=p||b$2(e,v)!==C1)break;var y=v+1;y<p&&(b$2(e,y)===C$2||b$2(e,y)===l$1)&&y++,g.push(e.slice(y,p)),m=k$2(e,p)}if(g.length){v$(g.join("\n"),n,r),o=m,i=!0;continue}}if((p=I$1(e,o))>=a)o=a;else{var b=w1(e,o,p);h=t(e,o,p);o=k$2(e,p),i=x===T9||x===C1||x===D1||x===d1||b||h.spaceEquivalent>=4}}}}var t6=/^\n+/,ZZ=typeof reactExports.createContext<"u"?reactExports.createContext(void 0):void 0;function e6(e){let t=!1;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>127||n===k1||n===t0){t=!0;break}}if(!t)return e;let n="";for(let r=0;r<e.length;r++){let t=e[r];if("%"===t&&r+2<e.length&&/[0-9A-Fa-f]/.test(e[r+1])&&/[0-9A-Fa-f]/.test(e[r+2]))n+=e[r]+e[r+1]+e[r+2],r+=2;else if(t.charCodeAt(0)===k1)n+="%5C";else if(t.charCodeAt(0)===t0)n+="%60";else{n+=t.charCodeAt(0)>127?encodeURIComponent(t):t}}return n}function $5(e,t,n,r,o,i,a,s){switch(e.type){case O$1.blockQuote:{let o={key:n.key};return e.alert&&(o.className="markdown-alert-"+i(e.alert.toLowerCase(),J1),e.children.unshift({attrs:{},children:[{type:O$1.text,text:e.alert}],verbatim:!0,type:O$1.htmlBlock,tag:"header"})),r("blockquote",o,t(e.children,n))}case O$1.breakLine:return r("br",{key:n.key});case O$1.breakThematic:return r("hr",{key:n.key});case O$1.frontmatter:return s.preserveFrontmatter?r("pre",{key:n.key},e.text):null;case O$1.codeBlock:let l=e.lang?M9(e.lang):"";return r("pre",{key:n.key},r("code",{...s9(e.attrs||{}),className:l?`language-${l} lang-${l}`:""},e.text));case O$1.codeInline:return r("code",{key:n.key},e.text);case O$1.footnoteReference:return r("a",{key:n.key,href:o(e.target,"a","href")},r("sup",{key:n.key},e.text));case O$1.gfmTask:return r("input",{checked:e.completed,key:n.key,readOnly:!0,type:"checkbox"});case O$1.heading:return r(`h${e.level}`,{id:e.id,key:n.key},t(e.children,n));case O$1.htmlBlock:{let l=e;if(s.tagfilter&&$$(l.tag)){let e;if("rawText"in l&&"string"==typeof l.rawText)e=l.rawText;else{let t="";if(l.attrs)for(let[e,n]of Object.entries(l.attrs))!0===n?t+=` ${e}`:null!=n&&!1!==n&&(t+=` ${e}="${String(n)}"`);e=`<${l.tag}${t}>`}return r("span",{key:n.key},e)}if(l.rawText&&l.verbatim){let c=function(e){var t,n;if(e.type===O$1.htmlSelfClosing&&"isClosingTag"in e&&e.isClosingTag)return[];if(e.type===O$1.paragraph){let t=e.children;return t?t.flatMap(c):[]}return e.type===O$1.text?(null==(t=e.text)?void 0:t.trim())?[e]:[]:e.type===O$1.htmlBlock&&e.children?[{...e,children:null==(n=e.children)?void 0:n.flatMap(c)}]:[e]},u=l.tag.toLowerCase(),d=w9(u),p=/<[a-z][^>]{0,100}>/i.test(l.rawText),f=/<\/?pre\b/i.test(l.rawText);if(d&&!p){let t=l.rawText.replace(new RegExp("\\s*</"+u+">\\s*$","i"),"");return s.tagfilter&&(t=Z$(t)),r(e.tag,{key:n.key,...e.attrs},t)}if(f){let t=s.tagfilter?Z$(l.rawText):l.rawText;return r(e.tag,{key:n.key,...e.attrs,dangerouslySetInnerHTML:{__html:t}})}let h={slugify:e=>i(e,J1),sanitizer:o,tagfilter:!0},m=l.rawText.replace(/>\s+</g,"><").replace(/\n+/g," ").trim();if(new RegExp(`^<${l.tag}(\\s[^>]*)?>(\\s*</${l.tag}>)?$`,"i").test(m))return r(e.tag,{key:n.key,...e.attrs});let g=i9(m,{inline:!1,refs:a,inHTML:!1},h),v="</"+l.tag.toLowerCase()+">",y=new RegExp(`^<${l.tag}(\\s|>)`,"i").test(m),b=m.toLowerCase().trimEnd().endsWith(v),x=y&&b,$=!l.attrs||0===Object.keys(l.attrs).length,_=l.children&&l.children.length>0;return x&&$?t(g.flatMap(c),n):r(e.tag,{key:n.key,...e.attrs},t(x&&_?l.children:g.flatMap(c),n))}return r(e.tag,{key:n.key,...e.attrs},e.children?t(e.children,n):"")}case O$1.htmlSelfClosing:{let t=e;if(s.tagfilter&&$$(t.tag)){let e;if("rawText"in t&&"string"==typeof t.rawText)e=t.rawText;else{let n="";if(t.attrs)for(let[e,r]of Object.entries(t.attrs))!0===r?n+=` ${e}`:null!=r&&!1!==r&&(n+=` ${e}="${String(r)}"`);e=`<${t.tag}${n} />`}return r("span",{key:n.key},e)}return r(e.tag,{key:n.key,...e.attrs})}case O$1.image:return r("img",{key:n.key,alt:e.alt&&e.alt.length>0?e.alt:void 0,title:e.title||void 0,src:o(e.target,"img","src")});case O$1.link:{let o={key:n.key};return null!=e.target&&(o.href=e6(e.target)),e.title&&(o.title=e.title),r("a",o,t(e.children,n))}case O$1.table:{let o=e;return r("table",{key:n.key},r("thead",null,r("tr",null,o.header.map(function(e,i){return r("th",{key:i,style:null==o.align[i]?{}:{textAlign:o.align[i]}},t(e,n))}))),r("tbody",null,o.cells.map(function(e,i){return r("tr",{key:i},e.map(function(e,i){return r("td",{key:i,style:null==o.align[i]?{}:{textAlign:o.align[i]}},t(e,n))}))})))}case O$1.text:return e.text;case O$1.textFormatted:return r(e.tag,{key:n.key},t(e.children,n));case O$1.orderedList:case O$1.unorderedList:{let o=e.type===O$1.orderedList?"ol":"ul";return r(o,{key:n.key,start:e.type===O$1.orderedList?e.start:void 0},e.items.map(function(e,o){return r("li",{key:o},t(e,n))}))}case O$1.paragraph:return r("p",{key:n.key},t(e.children,n));case O$1.ref:default:return null}}var Z5=(e,t,n,r,o,i)=>{let a=(a,s,l)=>{let c=()=>$5(a,s,l,t,n,r,o,i);return e?e(c,a,s,l):c()},s=(e,t={})=>{let n=(t.renderDepth||0)+1;if(n>2500)return(e=>e.map(e=>"text"in e?e.text:""))(e);t.renderDepth=n;let r=t.key,o=[],i=!1;for(let l=0;l<e.length;l++){t.key=l;let n=a(e[l],s,t),r="string"==typeof n;if(r&&i)o[o.length-1]+=n;else if(null!==n)if(Array.isArray(n))for(let e=0;e<n.length;e++)o.push(n[e]);else o.push(n);i=r}return t.key=r,t.renderDepth=n-1,o};return s},G5=(...e)=>e.filter(Boolean).join(" "),GZ=(e,t,n)=>{let r=e,o=t.split("."),i=0;for(;i<o.length&&(r=null==r?void 0:r[o[i]],void 0!==r);)i++;return r||n},Y5=(e,t)=>{let n=GZ(t,e,void 0);return n?"function"==typeof n||"object"==typeof n&&"render"in n?n:GZ(t,`${e}.component`,e):e};function J5(e,t){let n={...t||{}};n.overrides=n.overrides||{};let r=n.slugify||J1,o=n.sanitizer||s1,i=n.createElement||reactExports.createElement,a=e=>A$(e,{...n,wrapper:null});function s(e,t,...r){let o=GZ(n.overrides,`${e}.props`,{}),s=s9(t||{});if(a)for(let[n,i]of Object.entries(s))"string"==typeof i&&i.length>0&&"<"===i[0]&&(gZ.test(i)||CZ.test(i)||n1(i,0))&&(s[n]=a(i.trim()));return i(Y5(e,n.overrides),{...s,...o,className:G5(null==s?void 0:s.className,o.className)||void 0},...r)}let l=[];for(let g=0;g<e.length;g++){let t=e[g];if(t.type===O$1.htmlBlock&&"rawText"in t&&t.rawText&&/<\/?pre\b/i.test(t.rawText)&&g+1<e.length&&e[g+1].type===O$1.paragraph&&"removedClosingTags"in e[g+1]&&e[g+1].removedClosingTags){let n=function(e){let t="";for(let r of e){let e=r.type;if(e===O$1.text)t+=r.text;else if(e===O$1.htmlSelfClosing&&"rawText"in r&&r.rawText)t+=r.rawText;else if(e===O$1.textFormatted){let e=r,o="em"===e.tag?"_":"strong"===e.tag?"**":"";t+=o+n(e.children)+o}else"children"in r&&r.children&&(t+=n(r.children))}return t},r=t,o=e[g+1],i=n(o.children);o.removedClosingTags&&(i+=o.removedClosingTags.filter(e=>e.type===O$1.htmlSelfClosing&&"rawText"in e&&e.rawText&&-1===e.rawText.indexOf(`</${r.tag}>`)).map(e=>e.type===O$1.htmlSelfClosing&&"rawText"in e&&e.rawText||"").join("")),r.rawText=(r.rawText||"")+"\n"+i,r.text=r.rawText,g++}l.push(t)}e=l;let c={...n,slugify:e=>r(e,J1),sanitizer:o,tagfilter:!1!==n.tagfilter},u=e[0]&&e[0].type===O$1.refCollection?e[0].refs:{},d=Z5(n.renderRule,s,o,r,u,n),p=d(e,{inline:n.forceInline,refs:u}),f=[];for(let g in u)g.charCodeAt(0)===D9&&f.push({identifier:g,footnote:u[g].target});if(f.length&&p.push(s("footer",{key:"footer"},f.map(function(e){let t=e.identifier.charCodeAt(0)===D9?e.identifier.slice(1):e.identifier,n=i9(e.footnote,{inline:!0,refs:u},c);return s("div",{id:r(t,J1),key:e.identifier},t+": ",d(n,{inline:!0,refs:u}))}))),null===n.wrapper)return p;let h,m=n.wrapper||(n.forceInline?"span":"div");return p.length>1||n.forceWrapper?(h=p,i(m,{key:"outer",...n.wrapperProps},h)):1===p.length?p[0]:null}function A$(e="",t={}){let n={...t||{}};n.overrides=n.overrides||{};let r=n.slugify||J1,o=n.sanitizer||s1;let i={};return function(e){let t=n.forceInline||!n.forceBlock&&!T$.test(e),a={...n,slugify:e=>r(e,J1),sanitizer:o,tagfilter:!1!==n.tagfilter};t||v$(e,i,a);let s=e;if(!t){let e=s.length;for(;e>0&&("\n"===s[e-1]||"\r"===s[e-1]);)e--;s=s.slice(0,e),s=`${s.replace(t6,"")}\n\n`}if(n.optimizeForStreaming){let e=s.lastIndexOf("<");-1!==e&&-1===s.slice(e).indexOf(">")&&(s=s.slice(0,e))}return J5(i9(t?e:s,{inline:t,refs:i},a),{...a,forceInline:t})}(e)}var oZ=({children:e,options:t,...n})=>{if(!(typeof reactExports.useContext<"u")){return A$(null==e?"":e,{...t,overrides:{...null==t?void 0:t.overrides},wrapperProps:{...null==t?void 0:t.wrapperProps,...n}})}let r=reactExports.useContext(ZZ),o=reactExports.useMemo(()=>({...r,...t,overrides:{...null==r?void 0:r.overrides,...null==t?void 0:t.overrides},wrapperProps:{...null==r?void 0:r.wrapperProps,...null==t?void 0:t.wrapperProps,...n}}),[r,t,n]),i=null==e?"":e;return reactExports.useMemo(()=>A$(i,o),[i,o])},X5=oZ,e$1=function(){return e$1=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},e$1.apply(this,arguments)};function o$1(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"==typeof SuppressedError&&SuppressedError;var n$1=function(e){return factory$1(Box$1,e$1({},e))},f$1=function(e){return factory$1(Typography,e$1({},e))},b$1=function(e){var t=e.children,n=void 0===t?"":t,r=e.style,o=o$1(e,["children","style"]);return factory$1("pre",e$1({style:e$1({borderRadius:"0.5rem",padding:"0.5rem 0.75rem",overflow:"auto"},r)},o,{children:n}))},g$1=function(e){var t=e.children,n=void 0===t?"":t,r=e.language,o=void 0===r?"tsx":r,i=e.Highlight,a=e.themes,s=e.theme,l=e.hideLineNumbers;return factory$1(i,{code:n,language:o,theme:s||a.vsDark,children:function(t){var n=t.style,r=t.tokens,o=t.getLineProps,i=t.getTokenProps;return factory$1("pre",{style:e$1(e$1({borderRadius:"0.5rem",padding:"0.5rem 0.75rem",overflow:"auto"},n),e.styles),children:r.map(function(e,t){return factory$1("div",e$1({},o({line:e}),{children:[!l&&factory$1("span",{children:[t+1," "]}),e.map(function(e,t){return factory$1("span",e$1({},i({token:e})),t)})]}),t)})})}})},y$1=function(e){var t=e.children,n=e.Highlight,r=e.themes,o=e.prismTheme,i=e.styles,a=e.hideLineNumbers;if(t&&t.props&&t.props.className&&t.props.className.startsWith("lang-")){var s=t.props.children,l=t.props.className?t.props.className.replace("lang-",""):"tsx";if("enableMermaid"in e&&e.enableMermaid&&"mermaid"===l){if(e.enableMermaid&&"DiagramComponent"in e&&e.DiagramComponent)return factory$1(e.DiagramComponent,{enableMermaid:!0,mermaidConfig:e.mermaidConfig,children:s});console.error("Make sure you've passed the Diagram component to the MuiMarkdown properly, you can import it from 'mui-markdown/Diagram'.")}return n&&r?factory$1(g$1,{Highlight:n,themes:r,language:l,theme:o,styles:i,hideLineNumbers:a,children:s}):factory$1(b$1,{style:i,children:s})}return factory$1(n$1,{component:"pre",sx:{whiteSpace:"pre-wrap"},children:t})},k$1=function(e){return factory$1(TableCell,e$1({},e,{sx:e$1({whiteSpace:"nowrap"},e.sx)}))},x$1=function(e){return factory$1(Table,e$1({},e))},w$1={a:function(e){return factory$1(Link$1,e$1({},e))},blockquote:function(e){var t=e.children;return factory$1(n$1,{component:"blockquote",dir:"auto",sx:{borderInlineStart:"3px solid",paddingInlineStart:"1.5rem",borderColor:"text.secondary",m:"0.25rem 0"},children:t})},code:function(e){var t=e.children,n=e.style,r=o$1(e,["children","style"]);return factory$1("code",e$1({style:e$1({backgroundColor:"rgba(126, 125, 124, 0.1)",borderRadius:"0.25rem",padding:"0.25rem 0.5rem"},n)},r,{children:t}))},h1:function(e){var t=e.children,n=e.component,r=void 0===n?"h1":n,o=e.variant,i=void 0===o?"h1":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},h2:function(e){var t=e.children,n=e.component,r=void 0===n?"h2":n,o=e.variant,i=void 0===o?"h2":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},h3:function(e){var t=e.children,n=e.component,r=void 0===n?"h3":n,o=e.variant,i=void 0===o?"h3":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},h4:function(e){var t=e.children,n=e.component,r=void 0===n?"h4":n,o=e.variant,i=void 0===o?"h4":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},h5:function(e){var t=e.children,n=e.component,r=void 0===n?"h5":n,o=e.variant,i=void 0===o?"h5":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},h6:function(e){var t=e.children,n=e.component,r=void 0===n?"h6":n,o=e.variant,i=void 0===o?"h6":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},hr:function(e){return factory$1(Divider,e$1({},e))},ol:function(e){var t=e.children,n=e.component,r=void 0===n?"ol":n,o=o$1(e,["children","component"]);return factory$1(f$1,e$1({component:r},o,{children:t}))},p:function(e){var t=e.children,n=e.component,r=void 0===n?"p":n,o=e.variant,i=void 0===o?"body1":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},pre:y$1,span:function(e){var t=e.children,n=e.component,r=void 0===n?"span":n,o=e.variant,i=void 0===o?"body1":o,a=o$1(e,["children","component","variant"]);return factory$1(f$1,e$1({component:r,variant:i},a,{children:t}))},table:function(e){var t=e.children,n=e.sx,r=o$1(e,["children","sx"]);return factory$1(n$1,{sx:n?e$1({overflow:"auto"},n):function(e){var t,n=e.palette;return e$1({overflow:"auto"},{"::-webkit-scrollbar":{width:"8px",height:"6px"},"::-webkit-scrollbar-track":{background:"dark"===(t=n).mode?t.background.default:t.background.paper,borderRadius:"8px",overflow:"hidden"},"::-webkit-scrollbar-thumb":{background:darken$1(t.background.default,.05),borderRadius:"8px"}})},children:factory$1(n$1,{sx:{width:"100%",display:"table",tableLayout:"fixed"},children:factory$1(x$1,e$1({},r,{children:t}))})})},tbody:function(e){return factory$1(TableBody,e$1({},e))},td:k$1,tfoot:function(e){return factory$1(TableFooter,e$1({},e))},th:k$1,thead:function(e){return factory$1(TableHead,e$1({},e))},tr:function(e){return factory$1(TableRow,e$1({},e))},ul:function(e){var t=e.children,n=e.component,r=void 0===n?"ul":n,o=o$1(e,["children","component"]);return factory$1(f$1,e$1({component:r},o,{children:t}))}},C$1=function(e){void 0===e&&(e={});var t=e.overrides,n=o$1(e,["overrides"]);return e$1(e$1(e$1({},w$1),t),{pre:{component:y$1,props:n}})},M$1=function(e){var t,n=e.children,r=void 0===n?"":n,o=function(e){var t=e.options,n=e.overrides,r=C$1(e);return t?t.overrides?t:e$1(e$1({},t),{overrides:r}):{overrides:n||r}}(e);return"options"in(t=e)&&"overrides"in t&&console.error("Cannot set both 'options' and 'overrides' in the MuiMarkdown component props."),factory$1(X5,{options:o,children:r})};e$1({},w$1);const 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={},shared={},flatTokensSymbol$1=shared.flatTokensSymbol=Symbol("flat-tokens"),htmlFlowSymbol$1=shared.htmlFlowSymbol=Symbol("html-flow"),newLineRe$1=shared.newLineRe=/\r\n?|\n/g;shared.nextLinesRe=/[\r\n][\s\S]*$/;const{flatTokensSymbol:flatTokensSymbol,htmlFlowSymbol:htmlFlowSymbol}=shared;function inHtmlFlow(e){return Boolean(e[htmlFlowSymbol])}function isHtmlFlowComment(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}function addRangeToSet(e,t,n){for(let r=t;r<=n;r++)e.add(r)}function filterByPredicate(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 filterByTypes(e,t,n){const r=e=>t.includes(e.type)&&(n||!inHtmlFlow(e)),o=e[flatTokensSymbol];return o?o.filter(r):filterByPredicate(e,r)}function getBlockQuotePrefixText(e,t,n=1){return filterByTypes(e,["blockQuotePrefix","linePrefix"]).filter(e=>e.startLine===t).map(e=>e.text).join("").trimEnd().concat("\n").repeat(n)}function getDescendantsByType(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}function getHeadingLevel(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}function getHeadingStyle(e){if("setextHeading"===e.type)return"setext";return 1===e.children.filter(e=>"atxHeadingSequence"===e.type).length?"atx":"atx_closed"}function getHeadingText(e){return getDescendantsByType(e,[["atxHeadingText","setextHeadingText"]]).flatMap(e=>e.children.filter(e=>"htmlText"!==e.type)).map(e=>e.text).join("").replace(/[\r\n]+/g," ")||""}function getHtmlTagInfo(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}function getParentOfType(e,t){let n=e;for(;(n=n.parent)&&!t.includes(n.type););return n}const docfxTabSyntaxRe=/^#tab\//;function isDocfxTab(e){if("atxHeading"===(null==e?void 0:e.type)){const t=getDescendantsByType(e,["atxHeadingText"]);if(1===t.length&&1===t[0].children.length&&"link"===t[0].children[0].type){const e=filterByTypes(t[0].children[0].children,["resourceDestinationString"]);return 1===e.length&&docfxTabSyntaxRe.test(e[0].text)}}return!1}const nonContentTokens=new Set(["blockQuoteMarker","blockQuotePrefix","blockQuotePrefixWhitespace","lineEnding","lineEndingBlank","linePrefix","listItemIndent","undefinedReference","undefinedReferenceCollapsed","undefinedReferenceFull","undefinedReferenceShortcut"]);var micromarkHelpers={addRangeToSet:addRangeToSet,filterByPredicate:filterByPredicate,filterByTypes:filterByTypes,getBlockQuotePrefixText:getBlockQuotePrefixText,getDescendantsByType:getDescendantsByType,getHeadingLevel:getHeadingLevel,getHeadingStyle:getHeadingStyle,getHeadingText:getHeadingText,getHtmlTagInfo:getHtmlTagInfo,getParentOfType:getParentOfType,inHtmlFlow:inHtmlFlow,isDocfxTab:isDocfxTab,isHtmlFlowComment:isHtmlFlowComment,nonContentTokens:nonContentTokens};const micromark=micromarkHelpers,{newLineRe:newLineRe,nextLinesRe:nextLinesRe}=shared;var newLineRe_1=helpers.newLineRe=newLineRe,nextLinesRe_1=helpers.nextLinesRe=nextLinesRe,frontMatterRe=helpers.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;const inlineCommentStartRe=/(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi;var inlineCommentStartRe_1=helpers.inlineCommentStartRe=inlineCommentStartRe,endOfLineHtmlEntityRe=helpers.endOfLineHtmlEntityRe=/&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/,endOfLineGemojiCodeRe=helpers.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 allPunctuation=".,;:!?。,;:!?";var allPunctuation_1=helpers.allPunctuation=allPunctuation,allPunctuationNoQuestion=helpers.allPunctuationNoQuestion=allPunctuation.replace(/[??]/gu,"");function isNumber(e){return"number"==typeof e}var isNumber_1=helpers.isNumber=isNumber;function isString(e){return"string"==typeof e}var isString_1=helpers.isString=isString;function isEmptyString(e){return 0===e.length}var isEmptyString_1=helpers.isEmptyString=isEmptyString;function isObject(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}var isObject_1=helpers.isObject=isObject;function isUrl(e){return!!e&&Object.getPrototypeOf(e)===URL.prototype}var isUrl_1=helpers.isUrl=isUrl;function cloneIfArray(e){return Array.isArray(e)?[...e]:e}var cloneIfArray_1=helpers.cloneIfArray=cloneIfArray;function cloneIfUrl(e){return isUrl(e)?new URL(e):e}var cloneIfUrl_1=helpers.cloneIfUrl=cloneIfUrl,getHtmlAttributeRe=helpers.getHtmlAttributeRe=function(e){return new RegExp(`\\s${e}\\s*=\\s*['"]?([^'"\\s>]*)`,"iu")};function isBlankLine(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()}var isBlankLine_1=helpers.isBlankLine=isBlankLine;const htmlCommentBegin="\x3c!--",htmlCommentEnd="--\x3e",safeCommentCharacter=".",startsWithPipeRe=/^ *\|/,notCrLfRe=/[^\r\n]/g,notSpaceCrLfRe=/[^ \r\n]/g,trailingSpaceRe=/ +[\r\n]/g,replaceTrailingSpace=e=>e.replace(notCrLfRe,safeCommentCharacter);var clearHtmlCommentText=helpers.clearHtmlCommentText=function(e){let t=0;for(;-1!==(t=e.indexOf(htmlCommentBegin,t));){const n=e.indexOf(htmlCommentEnd,t+2);if(-1===n)break;if(n>t+htmlCommentBegin.length){const r=e.slice(t+htmlCommentBegin.length,n),o=e.lastIndexOf("\n",t)+1,i=e.slice(o,t),a=0===i.trim().length,s=startsWithPipeRe.test(i)&&r.includes("\n");if(a||!(s||r.startsWith(">")||r.startsWith("->")||r.endsWith("-")||r.includes("--"))){const o=r.replace(notSpaceCrLfRe,safeCommentCharacter).replace(trailingSpaceRe,replaceTrailingSpace);e=e.slice(0,t+htmlCommentBegin.length)+o+e.slice(n)}}t=n+htmlCommentEnd.length}return e},escapeForRegExp=helpers.escapeForRegExp=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")};function ellipsify(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}var ellipsify_1=helpers.ellipsify=ellipsify;function addError$1(e,t,n,r,o,i){e({lineNumber:t,detail:n,context:r,range:o,fixInfo:i})}var addError_1=helpers.addError=addError$1;function addErrorDetailIf(e,t,n,r,o,i,a,s){n!==r&&addError$1(e,t,"Expected: "+n+"; Actual: "+r+(o?"; "+o:""),i,a,s)}var addErrorDetailIf_1=helpers.addErrorDetailIf=addErrorDetailIf;function addErrorContext(e,t,n,r,o,i,a){addError$1(e,t,void 0,n=ellipsify(n.replace(newLineRe,"\n"),r,o),i,a)}var addErrorContext_1=helpers.addErrorContext=addErrorContext;const positionLessThanOrEqual=(e,t,n,r)=>e<n||e===n&&t<=r;var hasOverlap=helpers.hasOverlap=function(e,t){const n=positionLessThanOrEqual(e.startLine,e.startColumn,t.startLine,t.startColumn),r=n?e:t,o=n?t:e;return positionLessThanOrEqual(o.startLine,o.startColumn,r.endLine,r.endColumn)},frontMatterHasTitle=helpers.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))};function getReferenceLinkImageData$1(e){var t;const n=e=>e.toLowerCase().trim().replace(/\s+/g," "),r=e=>null==e?void 0:e.children.filter(e=>"blockQuotePrefix"!==e.type).map(e=>e.text).join(""),o=new Map,i=new Map,a=(e,t,r)=>{const a=[e.startLine-1,e.startColumn-1,e.text.length],s=n(t),l=r?i:o,c=l.get(s)||[];c.push(a),l.set(s,c)},s=new Map,l=[],c=[],u=micromark.filterByTypes(e,["definition","gfmFootnoteDefinition","definitionLabelString","gfmFootnoteDefinitionLabelString","gfmFootnoteCall","image","link","undefinedReferenceCollapsed","undefinedReferenceFull","undefinedReferenceShortcut"]);for(const d of u){let e="";switch(d.type){case"definition":case"gfmFootnoteDefinition":for(let e=d.startLine;e<=d.endLine;e++)l.push(e-1);break;case"gfmFootnoteDefinitionLabelString":e="^";case"definitionLabelString":{const r=n(`${e}${d.text}`);if(s.has(r))c.push([r,d.startLine-1]);else{const e=micromark.getParentOfType(d,["definition"]),n=e&&(null==(t=micromark.getDescendantsByType(e,["definitionDestination","definitionDestinationRaw","definitionDestinationString"])[0])?void 0:t.text);s.set(r,[d.startLine-1,n])}}break;case"gfmFootnoteCall":case"image":case"link":{let e=1===d.children.length;const t=2===d.children.length&&!d.children.some(e=>"resource"===e.type),[n]=micromark.getDescendantsByType(d,["label","labelText"]),[o]=micromark.getDescendantsByType(d,["reference","referenceString"]);let i=r(n);if(!e&&!t){const[t,n]=d.children.filter(e=>["gfmFootnoteCallMarker","gfmFootnoteCallString"].includes(e.type));t&&n&&(i=`${t.text}${n.text}`,e=!0)}(e||t)&&a(d,r(o)||i,e)}break;case"undefinedReferenceCollapsed":case"undefinedReferenceFull":case"undefinedReferenceShortcut":{const e=micromark.getDescendantsByType(d,["undefinedReference"])[0].children.map(e=>e.text).join("");a(d,e,"undefinedReferenceShortcut"===d.type)}}}return{references:o,shortcuts:i,definitions:s,duplicateDefinitions:c,definitionLineIndices:l}}var getReferenceLinkImageData_1=helpers.getReferenceLinkImageData=getReferenceLinkImageData$1;function getPreferredLineEnding(e,t){let n=0,r=0,o=0;const i=e.match(newLineRe)||[];for(const s of i)switch(s){case"\r":n++;break;case"\n":r++;break;case"\r\n":o++}let a=null;return a=n||r||o?r>=o&&r>=n?"\n":o>=n?"\r\n":"\r":t&&t.EOL||"\n",a}var getPreferredLineEnding_1=helpers.getPreferredLineEnding=getPreferredLineEnding;function expandTildePath(e,t){const n=t&&t.homedir&&t.homedir();return n?e.replace(/^~($|\/|\\)/,`${n}$1`):e}helpers.expandTildePath=expandTildePath;const map=new Map;let params;function initialize(e){map.clear(),params=e}function micromarkTokens(){return(null==params?void 0:params.parsers.micromark.tokens)||[]}function getCached(e,t){if(map.has(e))return map.get(e);const n=t();return map.set(e,n),n}function filterByTypesCached(e,t){return getCached(JSON.stringify(arguments),()=>micromarkHelpers.filterByTypes(micromarkTokens(),e,t))}function getReferenceLinkImageData(){return getCached(getReferenceLinkImageData.name,()=>getReferenceLinkImageData_1(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}=helpers;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=micromarkHelpers.getHeadingLevel(r);e>n&&addErrorDetailIf_1(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=micromarkHelpers.getHeadingStyle(r);if("consistent"===n&&(n=e),e!==n){const o=micromarkHelpers.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"),addErrorDetailIf_1(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=micromarkHelpers.getParentOfType(t,["listOrdered","listUnordered"]);)e++}const a=micromarkHelpers.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;addErrorDetailIf_1(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)addErrorDetailIf_1(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?r-n:e,u=o?c-n:s;addError_1(t,i,o?`Expected: (${r}); Actual: (${c})`:`Expected: ${e}; Actual: ${s}`,void 0,l,{editColumn:Math.min(u,a)+1,deleteCount:Math.max(u-a,0),insertText:"".padEnd(Math.max(a-u,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=micromarkHelpers.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))};addErrorDetailIf_1(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"]))micromarkHelpers.addRangeToSet(i,u.startLine+1,u.endLine-1);for(const u of filterByTypesCached(["codeIndented"]))micromarkHelpers.addRangeToSet(i,u.startLine,u.endLine);const a=new Set;if(r)for(const u of filterByTypesCached(["listOrdered","listUnordered"])){micromarkHelpers.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"]))micromarkHelpers.addRangeToSet(s,e.startLine,e.endLine-1);for(const e of filterByTypesCached(["codeText"]))micromarkHelpers.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;addError_1(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 micromarkHelpers.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=>hasOverlap(e,i))||addError_1(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"]))micromarkHelpers.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=>hasOverlap(e,u))||addError_1(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"]))micromarkHelpers.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&&addErrorDetailIf_1(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,f=e.config.tables,h=void 0===f||!!f,m=e.config.headings,g=void 0===m||!!m,v=new Set;for(const w of filterByTypesCached(["atxHeading","setextHeading"]))micromarkHelpers.addRangeToSet(v,w.startLine,w.endLine);const y=new Set;for(const w of filterByTypesCached(["codeFenced","codeIndented"]))micromarkHelpers.addRangeToSet(y,w.startLine,w.endLine);const b=new Set;for(const w of filterByTypesCached(["table"]))micromarkHelpers.addRangeToSet(b,w.startLine,w.endLine);const x=new Set;for(const w of filterByTypesCached(["autolink","image","link","literalAutolink"]))micromarkHelpers.addRangeToSet(x,w.startLine,w.endLine);const $=new Set;for(const w of filterByTypesCached(["paragraph"]))for(const e of micromarkHelpers.getDescendantsByType(w,["data"]))micromarkHelpers.addRangeToSet($,e.startLine,e.endLine);const _=new Set;for(const w of x)$.has(w)||_.add(w);const C=new Set(getReferenceLinkImageData().definitionLineIndices);for(let w=0;w<e.lines.length;w++){const s=e.lines[w],d=w+1,f=v.has(d),m=y.has(d),x=b.has(d),$=m?o:f?r:n,S=m?u:f?c:l;!p&&m||!h&&x||!g&&f||C.has(w)||!i&&(a&&sternModeRe.test(s)||_.has(d))||!S.test(s)||addErrorDetailIf_1(t,d,$,s.length,void 0,void 0,[$+1,s.length-$])}}},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;addErrorContext_1(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"]))micromarkHelpers.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;addErrorContext_1(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;addErrorContext_1(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"===micromarkHelpers.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"===micromarkHelpers.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"]))micromarkHelpers.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,f=!r,h=!s||!!l,m=l?`${l} `:"";if(f||h){const e=f?[1,d+1]:[i.length-u-p,p+1];addErrorContext_1(t,o+1,i.trim(),f,h,e,{editColumn:1,deleteCount:i.length,insertText:`${n} ${a} ${m}${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[micromarkHelpers.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&&isBlankLine_1(o[e-2-t]);t++)n++;addErrorDetailIf_1(t,e,c,n,"Above",l,void 0,{insertText:micromarkHelpers.getBlockQuotePrefixText(i,e-1,c-n)})}const u=r(a);if(u>=0){let n=0;for(let e=0;e<u&&isBlankLine_1(o[s+e]);e++)n++;addErrorDetailIf_1(t,e,u,n,"Below",l,void 0,{lineNumber:s+1,insertText:micromarkHelpers.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;addErrorContext_1(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=micromarkHelpers.getHeadingText(a);if(n){const e=micromarkHelpers.getHeadingLevel(a);for(;o<e;)o++,r[o]=[];for(;o>e;)r[o]=[],o--;i=r[e]}i.includes(e)?addErrorContext_1(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===micromarkHelpers.getHeadingLevel(e)&&!micromarkHelpers.isDocfxTab(e));if(o.length>0){const n=frontMatterHasTitle(e.frontMatterLines,e.config.front_matter_title);let i=n;if(!i){i=r.slice(0,r.indexOf(o[0])).every(e=>micromarkHelpers.nonContentTokens.has(e.type)||micromarkHelpers.isHtmlFlowComment(e))}if(i)for(const e of o.slice(n?0:1))addErrorContext_1(t,e.startLine,micromarkHelpers.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?allPunctuationNoQuestion:n);const r=new RegExp("\\s*["+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&&!endOfLineHtmlEntityRe.test(o)&&!endOfLineGemojiCodeRe.test(o)){const r=a[0],o=r.length,i=e-o;addError_1(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)&&!micromarkHelpers.getParentOfType(s,listTypes))){const{startColumn:n,startLine:r,text:o}=s,{length:i}=o,a=e.lines[r-1];addErrorContext_1(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)addError_1(t,e);break}break}}}}},listStyleExamples={one:"1/1/1",ordered:"1/2/3",zero:"0/0/0"};function getOrderedListItemValue(e){return Number(micromarkHelpers.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=micromarkHelpers.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);addErrorDetailIf_1(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)};addErrorDetailIf_1(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`};addErrorContext_1(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&&micromarkHelpers.getParentOfType(i,["listOrdered","listUnordered"])||(isBlankLine_1(o[i.startLine-2])||addError(t,o,i.startLine,!0),isBlankLine_1(o[i.endLine])||isBlankLine_1(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=micromarkHelpers.filterByPredicate(r.micromark.tokens,isList,e=>isList(e)||"htmlFlow"===e.type?[]:e.children);for(const a of i){const e=a.startLine;isBlankLine_1(n[e-2])||addErrorContext_1(t,e,n[e-1].trim(),void 0,void 0,void 0,{insertText:micromarkHelpers.getBlockQuotePrefixText(o,e)});const r=micromarkHelpers.filterByPredicate(a.children,e=>!micromarkHelpers.nonContentTokens.has(e.type),e=>micromarkHelpers.nonContentTokens.has(e.type)?[]:e.children);let i=a.endLine;r.length>0&&(i=r[r.length-1].endLine);const s=i;isBlankLine_1(n[s])||addErrorContext_1(t,s,n[s-1].trim(),void 0,void 0,void 0,{lineNumber:s+1,insertText:micromarkHelpers.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=micromarkHelpers.getHtmlTagInfo(r);if(e&&!e.close&&!n.includes(e.name.toLowerCase())){const n=[r.startColumn,r.text.replace(nextLinesRe_1,"").length];addError_1(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,micromarkHelpers.filterByPredicate(n,e=>{var t;if("literalAutolink"===e.type&&!micromarkHelpers.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=micromarkHelpers.getHtmlTagInfo(e);if(o&&!o.close){let e=1;for(let n=r+1;n<t.length;n++){const i=t[n],a=micromarkHelpers.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}>`};addErrorContext_1(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),addErrorDetailIf_1(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?allPunctuation_1: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=micromarkHelpers.getDescendantsByType(o,i);for(const n of e)1!==n.children.length||"data"!==n.children[0].type||r.test(n.text)||addErrorContext_1(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=micromarkHelpers.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&&!micromarkHelpers.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}`;addError_1(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}`;addError_1(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=micromarkHelpers.getDescendantsByType(r,["codeTextData"]);if(e.length>0){const n=micromarkHelpers.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,"",""],f="`"===p[1],h=p[2].length-(f&&!u?1:0),m=h>0,g=c&&m&&o&&u&&!s&&!f,v=r.text;if(c){const e=(g?o:i).startColumn,n=l+(g?o.text.length:0);addErrorContext_1(t,i.startLine,v,!0,!1,[e,n],{editColumn:e,deleteCount:n})}if(m){const e=(g?u:d).endColumn,n=h+(g?u.text.length:0);addErrorContext_1(t,d.endLine,v,!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;addErrorContext_1(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=micromarkHelpers.getDescendantsByType(a,["codeFencedFence"])[0],{startLine:i,text:s}=e,l=null==(n=micromarkHelpers.getDescendantsByType(e,["codeFencedFenceInfo"])[0])?void 0:n.text;l?r.length>0&&!r.includes(l)&&addError_1(t,i,`"${l}" is not allowed`):addErrorContext_1(t,i,s),o&&micromarkHelpers.getDescendantsByType(e,["codeFencedFenceMeta"]).length>0&&addError_1(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=micromarkHelpers.filterByTypes(t,["htmlText"],!0),n=e.length>0&&micromarkHelpers.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(!frontMatterHasTitle(e.frontMatterLines,e.config.front_matter_title)){let i=0;for(const e of o){const{startLine:t,type:o}=e;if(!micromarkHelpers.nonContentTokens.has(o)&&!micromarkHelpers.isHtmlFlowComment(e)){let a=null;if("atxHeading"===o||"setextHeading"===o){micromarkHelpers.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&&addErrorContext_1(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=micromarkHelpers.getDescendantsByType(i,["label","labelText"]),n=micromarkHelpers.getDescendantsByType(i,["reference"]),o=micromarkHelpers.getDescendantsByType(i,["resource"]),a=micromarkHelpers.getDescendantsByType(n,["referenceString"]),s=micromarkHelpers.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 f=!1;l&&(!c&&!u||c&&!d)?f=r(e[0]):d&&!p?f=r(a[0]):!d&&p?f="#"===s[0].text.trim():d||p||(f=!0),f&&addErrorContext_1(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=micromarkHelpers.getHeadingText(d),n=micromarkHelpers.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--:(addErrorDetailIf_1(t,d.startLine,u,r),a=!0))}const u=n.length-o;a||!(u>1||1===u&&"*"!==n[o])||!s&&n.every(e=>"*"===e)||addErrorContext_1(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,f,h){let m,g;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),v};function v(t){return 35===t?(m=a,y(t)):46===t?(m=s,y(t)):h&&markdownSpace(t)?factorySpace(e,v,"whitespace")(t):!h&&markdownLineEndingOrSpace(t)?factoryWhitespace(e,v)(t):null===t||markdownLineEnding(t)||unicodeWhitespace(t)||unicodePunctuation(t)&&45!==t&&95!==t?P(t):(e.enter(i),e.enter(l),e.consume(t),$)}function y(t){const n=m+"Marker";return e.enter(i),e.enter(m),e.enter(n),e.consume(t),e.exit(n),b}function b(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=m+"Value";return e.enter(r),e.consume(t),x}function x(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=m+"Value";return e.exit(n),e.exit(m),e.exit(i),v(t)}return e.consume(t),x}function $(t){return null===t||markdownLineEnding(t)||unicodeWhitespace(t)||unicodePunctuation(t)&&45!==t&&46!==t&&58!==t&&95!==t?(e.exit(l),h&&markdownSpace(t)?factorySpace(e,_,"whitespace")(t):!h&&markdownLineEndingOrSpace(t)?factoryWhitespace(e,_)(t):_(t)):(e.consume(t),$)}function _(t){return 61===t?(e.enter(c),e.consume(t),e.exit(c),C):(e.exit(i),v(t))}function C(t){return null===t||60===t||61===t||62===t||96===t||125===t||h&&markdownLineEnding(t)?n(t):34===t||39===t?(e.enter(u),e.enter(p),e.consume(t),e.exit(p),g=t,S):h&&markdownSpace(t)?factorySpace(e,C,"whitespace")(t):!h&&markdownLineEndingOrSpace(t)?factoryWhitespace(e,C)(t):(e.enter(d),e.enter(f),e.consume(t),g=void 0,w)}function w(t){return null===t||34===t||39===t||60===t||61===t||62===t||96===t?n(t):125===t||markdownLineEndingOrSpace(t)?(e.exit(f),e.exit(d),e.exit(i),v(t)):(e.consume(t),w)}function S(t){return t===g?(e.enter(p),e.consume(t),e.exit(p),e.exit(u),e.exit(i),T):(e.enter(d),E(t))}function E(t){return t===g?(e.exit(d),S(t)):null===t?n(t):markdownLineEnding(t)?h?n(t):factoryWhitespace(e,E)(t):(e.enter(f),e.consume(t),k)}function k(t){return t===g||null===t||markdownLineEnding(t)?(e.exit(f),E(t)):(e.consume(t),k)}function T(e){return 125===e||markdownLineEndingOrSpace(e)?v(e):P(e)}function P(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 h(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?f:p):(e.exit("chunkText"),h(t))}function f(t){return 91===t||92===t||93===t?(e.consume(t),l++,p):p(t)}function h(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?_(o):markdownLineEnding(o)?r.interrupt?t(o):e.attempt(nonLazyLine,f,_)(o):n(o)}function f(t){return null===t?_(t):markdownLineEnding(t)?e.check(nonLazyLine,y,_)(t):(e.enter("directiveContainerContent"),h(t))}function h(t){return e.attempt({tokenize:C,partial:!0},$,i?factorySpace(e,m,"linePrefix",i+1):m)(t)}function m(t){return null===t?$(t):markdownLineEnding(t)?e.check(nonLazyLine,v,$)(t):v(t)}function g(t){if(null===t){const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,$(t)}return markdownLineEnding(t)?e.check(nonLazyLine,b,x)(t):(e.consume(t),g)}function v(t){const n=e.enter("chunkDocument",{contentType:"document",previous:a});return a&&(a.next=n),a=n,g(t)}function y(t){return e.enter("directiveContainerContent"),h(t)}function b(t){e.consume(t);const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,h}function x(t){const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,$(t)}function $(t){return e.exit("directiveContainerContent"),_(t)}function _(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$2={};function gfmAutolinkLiteral(){return{text:text$2}}let code=48;for(;code<123;)text$2[code]=emailAutolink,code++,58===code?code=65:91===code&&(code=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(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$2[43]=emailAutolink,text$2[45]=emailAutolink,text$2[46]=emailAutolink,text$2[95]=emailAutolink,text$2[72]=[emailAutolink,protocolAutolink],text$2[104]=[emailAutolink,protocolAutolink],text$2[87]=[emailAutolink,wwwAutolink],text$2[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(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=push(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=push(l,resolveAll(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=push(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(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={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,f,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 f(t){return e.attempt(o,y,h)(t)}function h(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return a>0&&markdownSpace(t)?factorySpace(e,g,"linePrefix",a+1)(t):g(t)}function g(t){return null===t||markdownLineEnding(t)?e.check(nonLazyContinuation$1,f,y)(t):(e.enter("codeFlowValue"),v(t))}function v(t){return null===t||markdownLineEnding(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),v)}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,f=n,h=0,m=0;const g=[m];for(;f;){for(;e.get(++o)[1]!==f;);i.push(o),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=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&&(m=p+1,g.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),p=g.length;p--;){const t=s.slice(g[p],g[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[h+l[p][0]]=h+l[p][1],h+=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"}),h(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?f:p)}function f(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function h(o){return u||null!==o&&41!==o&&!markdownLineEndingOrSpace(o)?u<c&&40===o?(e.consume(o),u++,h):41===o?(e.consume(o),u--,h):null===o||32===o||40===o||asciiControl(o)?n(o):(e.consume(o),92===o?m:h):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o))}function m(t){return 40===t||41===t||92===t?(e.consume(t),h):h(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,f):63===s?(e.consume(s),o=3,r.interrupt?t:O):asciiAlpha(s)?(e.consume(s),a=String.fromCharCode(s),h):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:O):n(i)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:O):n(o)}function p(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:E:p):n(o)}function f(t){return asciiAlpha(t)?(e.consume(t),a=String.fromCharCode(t),h):n(t)}function h(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),m):r.interrupt?t(s):E(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?g(s):v(s)):(o=1,r.interrupt?t(s):E(s))}return 45===s||asciiAlphanumeric(s)?(e.consume(s),a+=String.fromCharCode(s),h):n(s)}function m(o){return 62===o?(e.consume(o),r.interrupt?t:E):n(o)}function g(t){return markdownSpace(t)?(e.consume(t),g):w(t)}function v(t){return 47===t?(e.consume(t),w):58===t||95===t||asciiAlpha(t)?(e.consume(t),y):markdownSpace(t)?(e.consume(t),v):w(t)}function y(t){return 45===t||46===t||58===t||95===t||asciiAlphanumeric(t)?(e.consume(t),y):b(t)}function b(t){return 61===t?(e.consume(t),x):markdownSpace(t)?(e.consume(t),b):v(t)}function x(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,$):markdownSpace(t)?(e.consume(t),x):_(t)}function $(t){return t===l?(e.consume(t),l=null,C):null===t||markdownLineEnding(t)?n(t):(e.consume(t),$)}function _(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||markdownLineEndingOrSpace(t)?b(t):(e.consume(t),_)}function C(e){return 47===e||62===e||markdownSpace(e)?v(e):n(e)}function w(t){return 62===t?(e.consume(t),S):n(t)}function S(t){return null===t||markdownLineEnding(t)?E(t):markdownSpace(t)?(e.consume(t),S):n(t)}function E(t){return 45===t&&2===o?(e.consume(t),M):60===t&&1===o?(e.consume(t),L):62===t&&4===o?(e.consume(t),A):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),R):!markdownLineEnding(t)||6!==o&&7!==o?null===t||markdownLineEnding(t)?(e.exit("htmlFlowData"),k(t)):(e.consume(t),E):(e.exit("htmlFlowData"),e.check(blankLineBefore,D,k)(t))}function k(t){return e.check(nonLazyContinuationStart,T,D)(t)}function T(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),P}function P(t){return null===t||markdownLineEnding(t)?k(t):(e.enter("htmlFlowData"),E(t))}function M(t){return 45===t?(e.consume(t),O):E(t)}function L(t){return 47===t?(e.consume(t),a="",I):E(t)}function I(t){if(62===t){const n=a.toLowerCase();return htmlRawNames.includes(n)?(e.consume(t),A):E(t)}return asciiAlpha(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),I):E(t)}function R(t){return 93===t?(e.consume(t),O):E(t)}function O(t){return 62===t?(e.consume(t),A):45===t&&2===o?(e.consume(t),O):E(t)}function A(t){return null===t||markdownLineEnding(t)?(e.exit("htmlFlowData"),D(t)):(e.consume(t),A)}function D(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),x):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,f):asciiAlpha(t)?(e.consume(t),v):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?L(e):45===e?d(e):u(e)}function f(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?h:f):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),m):markdownLineEnding(t)?(a=h,I(t)):(e.consume(t),h)}function m(t){return 93===t?(e.consume(t),g):h(t)}function g(t){return 62===t?L(t):93===t?(e.consume(t),g):h(t)}function v(t){return null===t||62===t?L(t):markdownLineEnding(t)?(a=v,I(t)):(e.consume(t),v)}function y(t){return null===t?n(t):63===t?(e.consume(t),b):markdownLineEnding(t)?(a=y,I(t)):(e.consume(t),y)}function b(e){return 62===e?L(e):y(e)}function x(t){return asciiAlpha(t)?(e.consume(t),$):n(t)}function $(t){return 45===t||asciiAlphanumeric(t)?(e.consume(t),$):_(t)}function _(t){return markdownLineEnding(t)?(a=_,I(t)):markdownSpace(t)?(e.consume(t),_):L(t)}function C(t){return 45===t||asciiAlphanumeric(t)?(e.consume(t),C):47===t||62===t||markdownLineEndingOrSpace(t)?w(t):n(t)}function w(t){return 47===t?(e.consume(t),L):58===t||95===t||asciiAlpha(t)?(e.consume(t),S):markdownLineEnding(t)?(a=w,I(t)):markdownSpace(t)?(e.consume(t),w):L(t)}function S(t){return 45===t||46===t||58===t||95===t||asciiAlphanumeric(t)?(e.consume(t),S):E(t)}function E(t){return 61===t?(e.consume(t),k):markdownLineEnding(t)?(a=E,I(t)):markdownSpace(t)?(e.consume(t),E):w(t)}function k(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,T):markdownLineEnding(t)?(a=k,I(t)):markdownSpace(t)?(e.consume(t),k):(e.consume(t),P)}function T(t){return t===o?(e.consume(t),o=void 0,M):null===t?n(t):markdownLineEnding(t)?(a=T,I(t)):(e.consume(t),T)}function P(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||markdownLineEndingOrSpace(t)?w(t):(e.consume(t),P)}function M(e){return 47===e||62===e||markdownLineEndingOrSpace(e)?w(e):n(e)}function L(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"),R}function R(t){return markdownSpace(t)?factorySpace(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(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(i,e.slice(r+1,r+s+3)),i=push(i,[["enter",u,t]]),i=push(i,resolveAll(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=push(i,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),i=push(i,e.slice(o+1)),i=push(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={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,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(){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?x:s;if(i===x&&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?h(t):124===t?(o=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),f):b(t)}function f(t){return markdownSpace(t)?factorySpace(e,h,"whitespace")(t):h(t)}function h(t){return 58===t?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(a+=1,m(t)):null===t||markdownLineEnding(t)?y(t):b(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):b(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(t))}function v(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)):b(n)}function b(e){return n(e)}function x(t){return e.enter("tableRow"),$(t)}function $(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),$):null===n||markdownLineEnding(n)?(e.exit("tableRow"),t(n)):markdownSpace(n)?factorySpace(e,$,"whitespace")(n):(e.enter("data"),_(n))}function _(t){return null===t||124===t||markdownLineEndingOrSpace(t)?(e.exit("data"),$(t)):(e.consume(t),92===t?C:_)}function C(t){return 92===t||124===t?(e.consume(t),_):_(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 f=e[i],h=f[1];"enter"===f[0]?"tableHead"===h.type?(u=!1,0!==d&&(flushTableEnd(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(i,0,[["enter",n,t]])):"tableRow"===h.type||"tableDelimiterRow"===h.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({},h.start),end:Object.assign({},h.end)},p.add(i,0,[["enter",r,t]])),s="tableDelimiterRow"===h.type?2:r?3:1):!s||"data"!==h.type&&"tableDelimiterMarker"!==h.type&&"tableDelimiterFiller"!==h.type?"tableCellDivider"===h.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"===h.type?(u=!0,d=i):"tableRow"===h.type||"tableDelimiterRow"===h.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"!==h.type&&"tableDelimiterMarker"!==h.type&&"tableDelimiterFiller"!==h.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,m)(n)}function d(t){return e.attempt({tokenize:g,partial:!0},m,p)(t)}function p(t){return(i?factorySpace(e,f,"linePrefix",i+1):f)(t)}function f(t){return null===t?m(t):markdownLineEnding(t)?e.attempt(nonLazyContinuation,d,m)(t):(e.enter("mathFlowValue"),h(t))}function h(t){return null===t||markdownLineEnding(t)?(e.exit("mathFlowValue"),f(t)):(e.consume(t),h)}function m(n){return e.exit("mathFlow"),t(n)}function g(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={}.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.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){hasOwnProperty.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$2={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}v(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 h(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(containerConstruct,u,d)(o)}function u(e){return r&&y(),v(a),p(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,i=t.now().offset,h(e)}function p(n){return t.containerState={},e.attempt(containerConstruct,f,h)(n)}function f(e){return a++,n.push([t.currentConstruct,t.containerState]),p(e)}function h(n){return null===n?(r&&y(),v(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),m(n))}function m(n){return null===n?(g(e.exit("chunkFlow"),!0),v(0),void e.consume(n)):markdownLineEnding(n)?(e.consume(n),g(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),m)}function g(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(v(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 v(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$1=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$1={42:list,43:list,45:list,48:list,49:list,50:list,51:list,52:list,53:list,54:list,55:list,56:list,57:list,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={[-5]:lineEnding,[-4]:lineEnding,[-3]:lineEnding,33:labelStartImage,38:characterReference,42:attention,60:[autolink,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$1,flow:flow,flowInitial:flowInitial,insideSpan:insideSpan,string:string,text:text},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:g(function(e,t){v(e,t.from)}),check:g(m),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:g(m,{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(a,e),f(),null!==a[a.length-1])return[];return v(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 f(){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;)h(t.charCodeAt(r._bufferIndex));else h(t)}}function h(e){u=u(e)}function m(e,t){t.restore()}function g(e,t){return function(n,o,i){let a,u,d,f;return Array.isArray(n)?h(n):"tokenize"in n?h([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return h([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function h(e){return a=e,u=0,0===e.length?i:m(e[u])}function m(e){return function(n){f=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 v();return e.tokenize.call(t?Object.assign(Object.create(c),t):c,l,g,v)(n)}}function g(t){return e(d,f),o}function v(e){return f.restore(),++u<a.length?m(a[u]):i}}}function v(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$1(e){const t={constructs:combineExtensions([defaultConstructs,...(e||{}).extensions||[]]),content:n(content),defined:[],document:n(document$2),flow:n(flow$1),lazy:{},string:n(string$1),text:n(text$1)};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}}function getText(e,t){return e.slice(t.start.offset,t.end.offset)}function getEvents(e,t={}){const n=[directive(),gfmAutolinkLiteral(),gfmFootnote(),gfmTable(),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],f=p&&p[1];f&&f.end.line===c.start.line&&f.end.column===c.start.column&&(0===d.length?(f.type="undefinedReferenceCollapsed",f.end=l.end):(c.type="undefinedReferenceFull",c.start=f.start,r.pop()));const h=d.filter(e=>"enter"===e[0]).map(t=>getText(e,t[1])).join("").trim();if(h.length>0&&!h.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$1({...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(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,f=null,h=!1;for(const m of a){const[a,s]=m,{type:g,start:v,end:y}=s,{column:b,line:x}=v,{column:$,line:_}=y,C=getText(e,s);if("enter"!==a||h)"exit"===a&&("htmlFlow"===g&&(h=!1),h||(i&&(Object.freeze(d.children),Object.freeze(d)),d=u.pop()));else{const i=d;if(u.push(i),d={type:g,startLine:x+r,startColumn:b,endLine:_+r,endColumn:$,text:C,children:[],parent:i===c?o||null:i},o&&Object.defineProperty(d,htmlFlowSymbol$1,{value:!0}),i.children.push(d),l.push(d),"htmlFlow"===d.type&&!micromarkHelpers.isHtmlFlowComment(d)){h=!0,p&&f||(p={...n,extensions:[{disable:{null:["codeIndented","htmlFlow"]}}]},f=e.split(newLineRe$1));const r=parseInternal(f.slice(d.startLine-1,d.endLine).join("\n"),t,p,d.startLine-1,d);d.children=r,l=l.concat(r[flatTokensSymbol$1])}}}return Object.defineProperty(s,flatTokensSymbol$1,{value:l}),i&&Object.freeze(s),s}function parse(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=micromarkHelpers.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=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=>hasOverlap(e,p))){let e=[];u.has(a)||(e=micromarkHelpers.filterByTypes(parse(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=>hasOverlap(e,p))||addErrorDetailIf_1(t,a.startLine,d,o,void 0,void 0,[i,s],{editColumn:i,deleteCount:s,insertText:d})}c.push(p)}}}}},altRe=getHtmlAttributeRe("alt"),ariaHiddenRe=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(micromarkHelpers.getDescendantsByType(i,["label","labelText"]).some(e=>0===e.text.length)){const e=i.startLine===i.endLine?[i.startColumn,i.endColumn-i.startColumn]:void 0;addError_1(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=micromarkHelpers.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(nextLinesRe_1,"").length];addError_1(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]),addErrorDetailIf_1(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];isBlankLine_1(r)||addError_1(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=micromarkHelpers.getDescendantsByType(o,["codeFencedFence","codeFencedFenceSequence"])[0],{startLine:r,text:i}=e;"consistent"===n&&(n=fencedCodeBlockStyleFor(i)),addErrorDetailIf_1(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=micromarkHelpers.filterByPredicate(l.micromark.tokens,e=>e.type===n,e=>"htmlFlow"===e.type?[]:e.children);for(const u of c){const e=micromarkHelpers.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])addError_1(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=getHtmlAttributeRe("id"),nameRe=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=micromarkHelpers.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 micromarkHelpers.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=micromarkHelpers.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)&&micromarkHelpers.isDocfxTab(e.parent.parent))});for(const r of e){const e=micromarkHelpers.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||addError_1(t,r.startLine,`Expected: ${d}; Actual: ${l}`,o,a,c)):addError_1(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);addError_1(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];addError_1(t,a+1,`Unused link or image reference definition: "${e}"`,ellipsify_1(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];addError_1(t,o+1,`Duplicate link or image reference definition: "${e}"`,ellipsify_1(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:f}=getReferenceLinkImageData(),h=filterByTypesCached(["autolink","image","link"]);for(const m of h){let e=null,a=null;const{endColumn:h,endLine:g,startColumn:v,startLine:y,text:b,type:x}=m,$="image"===x;let _=!1;if("autolink"===x)a=null==(n=micromarkHelpers.getDescendantsByType(m,[["autolinkEmail","autolinkProtocol"]])[0])?void 0:n.text,e=a,_=!s&&Boolean(a);else if(e=micromarkHelpers.getDescendantsByType(m,["label","labelText"])[0].text,a=null==(r=micromarkHelpers.getDescendantsByType(m,["resource","resourceDestination",["resourceDestinationLiteral","resourceDestinationRaw"],"resourceDestinationString"])[0])?void 0:r.text,a){const t=null==(o=micromarkHelpers.getDescendantsByType(m,["resource","resourceTitle","resourceTitleString"])[0])?void 0:o.text;_=!l||!p&&s&&!$&&!t&&e===a&&autolinkAble(a)}else{const t=0===micromarkHelpers.getDescendantsByType(m,["reference"]).length,n=null==(i=micromarkHelpers.getDescendantsByType(m,["reference","referenceString"])[0])?void 0:i.text,r=void 0===n,o=f.get(n||e);a=o&&o[1],_=a&&(t?!d:r?!u:!c)}if(_){let n,r;if(y===g){n=[v,h-v];let t=null;const o=l&&e,i=s&&!$&&autolinkAble(a);if(!o||!p&&i)i&&(t=`<${removeBackslashEscapes(a)}>`);else{t=`${$?"!":""}[${e.replace(/[[\]]/g,"\\$&")}](${a.replace(/[()]/g,"\\$&")})`}t&&(r={editColumn:n[0],insertText:t,deleteCount:n[1]})}addErrorContext_1(t,y,b.replace(nextLinesRe_1,""),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&&addErrorDetailIf_1(t,e.startLine,n,c,(r?"Missing":"Unexpected")+" leading pipe",void 0,makeRange$1(a.startColumn,e.startColumn)),l!==o&&addErrorDetailIf_1(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=micromarkHelpers.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)),addErrorDetailIf_1(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;isBlankLine_1(n[e-2])||addErrorContext_1(t,e,n[e-1].trim(),void 0,void 0,void 0,{insertText:micromarkHelpers.getBlockQuotePrefixText(r,e)});const o=i.endLine;isBlankLine_1(n[o])||addErrorContext_1(t,o,n[o-1].trim(),void 0,void 0,void 0,{lineNumber:o+1,insertText:micromarkHelpers.getBlockQuotePrefixText(r,o)})}}},allowedChildrenTypes=new Set(["codeText","htmlText"]),defaultProhibitedTexts=["click here","here","link","more"];function normalize(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));if(n.size>0){const e=filterByTypesCached(["link"]);for(const r of e){const e=micromarkHelpers.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(c))){const e=l===i?[s,o-s]:void 0;addErrorContext_1(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 _e of rules){const e=_e.names[0].toLowerCase();_e.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(isString_1)&&!t.some(isEmptyString_1)||(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||isUrl_1(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(newLineRe_1),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=inlineCommentStartRe_1.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 f=getEffectiveConfig(e,o,a);for(const m of e){const e=m.names[0].toUpperCase();c.push(e),s[e]=!!f[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 h=[];for(const[m,g]of c.entries())u.some(e=>e[g])&&h.push(e[m]);return{effectiveConfig:f,enabledRulesPerLineNumber:u,enabledRuleList:h}}function lintContent(e,t,n,r,o,i,a,s,l,c,u,d,p){const f=e=>p(e instanceof Error?e:new Error(e)),h=removeFrontMatter(r=r.replace(/^\uFEFF/,""),s),{frontMatterLines:m}=h;r=h.content;const{effectiveConfig:g,enabledRulesPerLineNumber:v,enabledRuleList:y}=getEnabledRulesPerLineNumber(e,r.split(newLineRe_1),m,c,i,a,t),b=y.some(e=>"markdownit"===e.parser||void 0===e.parser),x=y.some(e=>"micromark"===e.parser),$=e.length!==rules.length,_=x?parse(r,{freezeTokens:$}):[],C=r,w=(r=clearHtmlCommentText(r)).split(newLineRe_1),S=e=>{const t=Object.freeze({markdownit:Object.freeze({tokens:e})}),r=Object.freeze({micromark:Object.freeze({tokens:_})}),o=Object.freeze({}),i={name:n,version:version,lines:Object.freeze(w),frontMatterLines:Object.freeze(m)};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:g[c]};function f(e){throw new Error(`Value of '${e}' passed to onError by '${c}' is incorrect for '${n}'.`)}function h(e){(!e||!isNumber_1(e.lineNumber)||e.lineNumber<1||e.lineNumber>w.length)&&f("lineNumber");const t=e.lineNumber+m.length;if(!v[t][c])return;e.detail&&!isString_1(e.detail)&&f("detail"),e.context&&!isString_1(e.context)&&f("context"),e.information&&!isUrl_1(e.information)&&f("information"),e.range&&(!Array.isArray(e.range)||2!==e.range.length||!isNumber_1(e.range[0])||e.range[0]<1||!isNumber_1(e.range[1])||e.range[1]<1||e.range[0]+e.range[1]-1>w[e.lineNumber-1].length)&&f("range");const n=e.fixInfo,r={};if(n){isObject_1(n)||f("fixInfo"),void 0!==n.lineNumber&&((!isNumber_1(n.lineNumber)||n.lineNumber<1||n.lineNumber>w.length)&&f("fixInfo.lineNumber"),r.lineNumber=n.lineNumber+m.length);const t=n.lineNumber||e.lineNumber;void 0!==n.editColumn&&((!isNumber_1(n.editColumn)||n.editColumn<1||n.editColumn>w[t-1].length+1)&&f("fixInfo.editColumn"),r.editColumn=n.editColumn),void 0!==n.deleteCount&&((!isNumber_1(n.deleteCount)||n.deleteCount<-1||n.deleteCount>w[t-1].length)&&f("fixInfo.deleteCount"),r.deleteCount=n.deleteCount),void 0!==n.insertText&&(isString_1(n.insertText)||f("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=>h({lineNumber:1,detail:`This rule threw an exception: ${e.message||e}`}),b=()=>s.function(p,h);if(s.asynchronous){const e=Promise.resolve().then(b);return l?e.catch(y):e}try{b()}catch(x){if(!l)throw x;y(x)}return null},c=y.filter(e=>e.asynchronous),d=y.filter(e=>!e.asynchronous),h=[...c,...d],b=()=>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=h.map(s);c.length>0?Promise.all(e.slice(0,c.length)).then(b).catch(f):b()}catch(x){f(x)}finally{initialize()}};if(!b||d){const e=b?deferRequire.requireMarkdownItCjs().getMarkdownItTokens(o(),C,w):[];S(e)}else Promise.all([__vitePreload(()=>import("./markdownit-Do8mUcqc.js").then(e=>e.m),[]),new Promise(e=>e(o()))]).then(([e,t])=>{const n=e.getMarkdownItTokens(t,C,w);S(n)}).catch(f)}function lintFile(e,t,n,r,o,i,a,s,l,c,u,d,p){u.readFile(n,"utf8",function(u,f){return u?p(u):lintContent(e,t,n,f,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:cloneIfArray_1(e.names),description:e.description,information:cloneIfUrl_1(e.information),tags:cloneIfArray_1(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?frontMatterRe:e.frontMatter,p=!!e.handleRuleFailures,f=!!e.noInlineConfig,h=void 0===e.resultVersion?3:e.resultVersion,m=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.")}),g=e.fs||fs,v=mapAliasToRuleNames(o),y=newResults(o);let b=!1,x=0;function $(){let e=null;function r(t,r){return x--,t?(b=!0,n(t)):(y[e]=r,$(),null)}if(b);else if(a.length>0)x++,e=a.shift(),lintFile(o,v,e,m,c,u,d,p,f,h,g,t,r);else if(e=l.shift())x++,lintContent(o,v,e,s[e]||"",m,c,u,d,p,f,h,t,r);else if(0===x)return b=!0,n(null,y);return null}$(),$(),$(),$(),$(),$(),$(),$()}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=getPreferredLineEnding_1(e,os),r=e.split(newLineRe_1);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)}const CustomLink=e=>factory$1(Link$1,{...e,onClick:t=>{e.href&&(t.preventDefault(),ik(e.href))},children:e.children}),CustomHeader=e=>factory$1(Typography,{...e,color:"#2196f3",variant:"h5",sx:{pt:1,pb:1},children:e.children}),CustomDivider=e=>factory$1(Divider,{...e,sx:{pt:1,pb:2}}),CustomStrong=e=>factory$1(Typography,{component:"span",fontWeight:"bold",...e,children:e.children}),CustomParagraph_1=compiledBlock(e=>e.v0,{name:"CustomParagraph_1",portals:["v0"]}),CustomParagraph_2=compiledBlock(e=>e.v0,{name:"CustomParagraph_2",portals:["v0"]}),CustomParagraph_3=compiledBlock(e=>e.v0,{name:"CustomParagraph_3",portals:["v0"]}),CustomParagraph=e=>{const{children:t}=e;if("string"==typeof t){const n=t.split("\n").map((e,t,n)=>t<n.length-1?factory$1("span",{children:[e,factory$1("br",{})]}):factory$1("span",{children:e}));return factory$1(CustomParagraph_1,{v0:factory$1(Typography,{...e,children:n})})}if(Array.isArray(t)||"string"!=typeof t){const n=(e,t)=>"string"==typeof e?e.split("\n").map((e,t,n)=>t<n.length-1?factory$1("span",{children:[e,factory$1("br",{})]}):factory$1("span",{children:e})):factory$1("span",{children:e}),r=Array.isArray(t)?t.map(n):n(t);return factory$1(CustomParagraph_2,{v0:factory$1(Typography,{...e,children:r})})}return factory$1(CustomParagraph_3,{v0:factory$1(Typography,{...e,children:t})})},Markdown=({content:e})=>{const[t]=kc(async()=>{try{const{content:t}=await lintPromise({strings:{content:e}});if(!t.length)return e;const n=applyFixes(e,t);return n||e}catch(t){return console.log("Markdown lint failed",t),e}},{onLoadStart:()=>ioc.layoutService.setAppbarLoader(!0),onLoadEnd:()=>ioc.layoutService.setAppbarLoader(!1),deps:[e]});return t?factory$1(M$1,{overrides:{...w$1,a:{component:CustomLink},h1:{component:CustomHeader},h2:{component:CustomHeader},h3:{component:CustomHeader},h4:{component:CustomHeader},h5:{component:CustomHeader},h6:{component:CustomHeader},hr:{component:CustomDivider},p:{component:CustomParagraph},strong:{component:CustomStrong}},children:t}):null},signal_fields=[{type:Mn$1.Paper,transparentPaper:!0,fieldBottomMargin:"1",fields:[{type:Mn$1.Typography,typoVariant:"h6",placeholder:"General Information"},{type:Mn$1.Outline,sx:{mb:3},fields:[{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"symbol",title:"Symbol",readonly:!0,compute:e=>e.symbol||"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"position",title:"Position",readonly:!0,compute:e=>"long"===e.position?"LONG":"short"===e.position?"SHORT":"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"status",title:"Status",readonly:!0,compute:e=>({opened:"Opened",scheduled:"Scheduled",closed:"Closed",cancelled:"Cancelled"}[e.status]||e.status||"Unknown")},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"exchangeName",title:"Exchange",readonly:!0,compute:e=>e.exchangeName||"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"strategyName",title:"Strategy",readonly:!0,compute:e=>e.strategyName||"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"minuteEstimatedTime",title:"Estimated Time (min)",readonly:!0,compute:e=>{var t;return(null==(t=e.minuteEstimatedTime)?void 0:t.toString())||"Not specified"}}]},{type:Mn$1.Typography,typoVariant:"h6",placeholder:"Timestamps"},{type:Mn$1.Outline,sx:{mb:3},fields:[{type:Mn$1.Text,outlined:!1,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",name:"createdAt",title:"Created",readonly:!0,compute:e=>e.createdAt?dayjs(e.createdAt).format("DD/MM/YYYY HH:mm:ss"):""},{type:Mn$1.Text,outlined:!1,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",name:"updatedAt",title:"Updated",readonly:!0,compute:e=>e.updatedAt?dayjs(e.updatedAt).format("DD/MM/YYYY HH:mm:ss"):""},{type:Mn$1.Text,outlined:!1,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",name:"scheduledAt",title:"Scheduled",readonly:!0,isVisible:e=>!!e.scheduledAt,compute:e=>e.scheduledAt?dayjs(e.scheduledAt).format("DD/MM/YYYY HH:mm:ss"):""},{type:Mn$1.Text,outlined:!1,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",name:"pendingAt",title:"Activated",readonly:!0,isVisible:e=>!!e.pendingAt,compute:e=>e.pendingAt?dayjs(e.pendingAt).format("DD/MM/YYYY HH:mm:ss"):"N/A"}]},{type:Mn$1.Typography,typoVariant:"h6",placeholder:"Price Levels"},{type:Mn$1.Outline,sx:{mb:3},fields:[{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"priceOpen",title:"Entry Price",readonly:!0,compute:e=>e.priceOpen?`${e.priceOpen.toFixed(6)}$`:"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"priceTakeProfit",title:"Take Profit",readonly:!0,compute:e=>e.priceTakeProfit?`${e.priceTakeProfit.toFixed(6)}$`:"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"priceStopLoss",title:"Stop Loss",readonly:!0,compute:e=>e.priceStopLoss?`${e.priceStopLoss.toFixed(6)}$`:"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"originalPriceTakeProfit",title:"Original TP",readonly:!0,isVisible:e=>null!=e.originalPriceTakeProfit&&e.originalPriceTakeProfit!==e.priceTakeProfit,compute:e=>e.originalPriceTakeProfit?`${e.originalPriceTakeProfit.toFixed(6)}$`:""},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"originalPriceStopLoss",title:"Original SL",readonly:!0,isVisible:e=>null!=e.originalPriceStopLoss&&e.originalPriceStopLoss!==e.priceStopLoss,compute:e=>e.originalPriceStopLoss?`${e.originalPriceStopLoss.toFixed(6)}$`:""},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"originalPriceOpen",title:"Original Entry",readonly:!0,isVisible:e=>null!=e.originalPriceOpen&&e.originalPriceOpen!==e.priceOpen,compute:e=>null!=e.originalPriceOpen?`${e.originalPriceOpen.toFixed(6)}$`:"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"totalEntries",title:"DCA Entries",readonly:!0,isVisible:e=>null!=e.totalEntries&&e.totalEntries>1,compute:e=>null!=e.totalEntries?String(e.totalEntries):"Not specified"},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"partialExecuted",title:"Partial Closed",readonly:!0,isVisible:e=>e.partialExecuted>0,compute:e=>{var t;return`${(null==(t=e.partialExecuted)?void 0:t.toFixed(2))||0}%`}}]},{type:Mn$1.Typography,typoVariant:"h6",placeholder:"Result (PNL)",isVisible:e=>"closed"===e.status&&e.pnl},{type:Mn$1.Outline,isVisible:e=>"closed"===e.status&&e.pnl,sx:{mb:3},fields:[{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"pnl.pnlPercentage",title:"PNL %",readonly:!0,compute:e=>{var t;const n=null==(t=e.pnl)?void 0:t.pnlPercentage;if(null==n)return"N/A";return`${n>=0?"+":""}${n.toFixed(2)}%`}},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"pnl.priceOpen",title:"Entry Price (w/ fees)",readonly:!0,compute:e=>{var t;return(null==(t=e.pnl)?void 0:t.priceOpen)?`${e.pnl.priceOpen.toFixed(6)}$`:"N/A"}},{type:Mn$1.Text,outlined:!1,desktopColumns:"4",tabletColumns:"4",phoneColumns:"12",name:"pnl.priceClose",title:"Exit Price",readonly:!0,compute:e=>{var t;return(null==(t=e.pnl)?void 0:t.priceClose)?`${e.pnl.priceClose.toFixed(6)}$`:"N/A"}}]},{type:Mn$1.Typography,typoVariant:"h6",placeholder:"Note",isVisible:e=>!!e.note},{type:Mn$1.Outline,isVisible:e=>!!e.note,sx:{mb:3},child:{type:Mn$1.Component,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"note",element:({note:e})=>factory$1(Box$1,{children:factory$1(Markdown,{content:e||"No note"})})}},{type:Mn$1.Box,sx:{display:"grid",gridTemplateColumns:"auto 1fr"},fields:[{type:Mn$1.Component,element:({id:e})=>factory$1(cS,{label:"Signal ID",content:e})},{type:Mn$1.Div}]}]}],SignalView=({data:e})=>factory$1(Box$1,{sx:{height:"100%",width:"100%",pt:1},children:factory$1(nm,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:factory$1("div",{children:[factory$1(bf,{slots:defaultSlots,fields:signal_fields,handler:()=>e}),factory$1(Box$1,{sx:{paddingBottom:"65px"}})]})})});var defaultBindingOptions={allowDownsampling:!0};function bindToDevicePixelRatio(e,t){return void 0===t&&(t=defaultBindingOptions),new DevicePixelRatioBinding(e,t)}var DevicePixelRatioBinding=function(){function e(e,t){var n=this;this._resolutionMediaQueryList=null,this._resolutionListener=function(e){return n._onResolutionChanged()},this._canvasConfiguredListeners=[],this.canvas=e,this._canvasSize={width:this.canvas.clientWidth,height:this.canvas.clientHeight},this._options=t,this._configureCanvas(),this._installResolutionListener()}return e.prototype.destroy=function(){this._canvasConfiguredListeners.length=0,this._uninstallResolutionListener(),this.canvas=null},Object.defineProperty(e.prototype,"canvasSize",{get:function(){return{width:this._canvasSize.width,height:this._canvasSize.height}},enumerable:!0,configurable:!0}),e.prototype.resizeCanvas=function(e){this._canvasSize={width:e.width,height:e.height},this._configureCanvas()},Object.defineProperty(e.prototype,"pixelRatio",{get:function(){var e=this.canvas.ownerDocument.defaultView;if(null==e)throw new Error("No window is associated with the canvas");return e.devicePixelRatio>1||this._options.allowDownsampling?e.devicePixelRatio:1},enumerable:!0,configurable:!0}),e.prototype.subscribeCanvasConfigured=function(e){this._canvasConfiguredListeners.push(e)},e.prototype.unsubscribeCanvasConfigured=function(e){this._canvasConfiguredListeners=this._canvasConfiguredListeners.filter(function(t){return t!=e})},e.prototype._configureCanvas=function(){var e=this.pixelRatio;this.canvas.style.width=this._canvasSize.width+"px",this.canvas.style.height=this._canvasSize.height+"px",this.canvas.width=this._canvasSize.width*e,this.canvas.height=this._canvasSize.height*e,this._emitCanvasConfigured()},e.prototype._emitCanvasConfigured=function(){var e=this;this._canvasConfiguredListeners.forEach(function(t){return t.call(e)})},e.prototype._installResolutionListener=function(){if(null!==this._resolutionMediaQueryList)throw new Error("Resolution listener is already installed");var e=this.canvas.ownerDocument.defaultView;if(null==e)throw new Error("No window is associated with the canvas");var t=e.devicePixelRatio;this._resolutionMediaQueryList=e.matchMedia("all and (resolution: "+t+"dppx)"),this._resolutionMediaQueryList.addListener(this._resolutionListener)},e.prototype._uninstallResolutionListener=function(){null!==this._resolutionMediaQueryList&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},e.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},e.prototype._onResolutionChanged=function(){this._configureCanvas(),this._reinstallResolutionListener()},e}(),i,n;
226
226
  /*!
227
227
  * @license
228
228
  * TradingView Lightweight Charts v3.3.0